Commit 634b8f49 authored by Holger Schurig's avatar Holger Schurig Committed by John W. Linville

[PATCH] libertas: remove unused variables in wlan_dev_t

Actually, this patch removev wlan_dev_t totally and puts the used variables
of it directly into wlan_private. That reduces one level of indirection and
looks a little bit simpler. It's now "priv->card" and not
"priv->wlan_dev.card" and "priv->dev" instead of "priv->wlan_dev.netdev"

Changed two occurences of "((wlan_private *) dev->priv)->wlan_dev.netdev"
into "dev", because I didn't see the point in doing pointer-ping-pong.

The variables "ioport", "upld_rcv" and "upld_type" where unused. They have
been removed.
Signed-off-by: default avatarHolger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ec3eef28
......@@ -1823,7 +1823,7 @@ void libertas_send_iwevcustom_event(wlan_private * priv, s8 * str)
lbs_deb_cmd("Event Indication String length = %d\n", iwrq.data.length);
lbs_deb_cmd("Sending wireless event IWEVCUSTOM for %s\n", str);
wireless_send_event(priv->wlan_dev.netdev, IWEVCUSTOM, &iwrq, buf);
wireless_send_event(priv->dev, IWEVCUSTOM, &iwrq, buf);
lbs_deb_leave(LBS_DEB_CMD);
}
......@@ -1842,7 +1842,7 @@ static int sendconfirmsleep(wlan_private * priv, u8 * cmdptr, u16 size)
lbs_dbg_hex("SEND_SLEEPC_CMD: Sleep confirm command", cmdptr, size);
ret = priv->hw_host_to_card(priv, MVMS_CMD, cmdptr, size);
priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED;
priv->dnld_sent = DNLD_RES_RECEIVED;
spin_lock_irqsave(&adapter->driver_lock, flags);
if (adapter->intcounter || adapter->currenttxskb)
......@@ -1926,7 +1926,7 @@ void libertas_ps_confirm_sleep(wlan_private * priv, u16 psmode)
lbs_deb_enter(LBS_DEB_CMD);
if (priv->wlan_dev.dnld_sent) {
if (priv->dnld_sent) {
allowed = 0;
lbs_deb_cmd("D");
}
......
......@@ -42,15 +42,15 @@ void libertas_mac_event_disconnected(wlan_private * priv)
*/
msleep_interruptible(1000);
wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL);
wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
/* Free Tx and Rx packets */
kfree_skb(priv->adapter->currenttxskb);
priv->adapter->currenttxskb = NULL;
/* report disconnect to upper layer */
netif_stop_queue(priv->wlan_dev.netdev);
netif_carrier_off(priv->wlan_dev.netdev);
netif_stop_queue(priv->dev);
netif_carrier_off(priv->dev);
/* reset SNR/NF/RSSI values */
memset(adapter->SNR, 0x00, sizeof(adapter->SNR));
......@@ -218,7 +218,7 @@ static int wlan_ret_get_hw_spec(wlan_private * priv,
ETH_ALEN);
}
memcpy(priv->wlan_dev.netdev->dev_addr, adapter->current_addr, ETH_ALEN);
memcpy(priv->dev->dev_addr, adapter->current_addr, ETH_ALEN);
if (priv->mesh_dev)
memcpy(priv->mesh_dev->dev_addr, adapter->current_addr,
ETH_ALEN);
......@@ -774,14 +774,14 @@ int libertas_process_rx_command(wlan_private * priv)
resp = (struct cmd_ds_command *)(adapter->cur_cmd->bufvirtualaddr);
lbs_dbg_hex("CMD_RESP:", adapter->cur_cmd->bufvirtualaddr,
priv->wlan_dev.upld_len);
priv->upld_len);
respcmd = le16_to_cpu(resp->command);
result = le16_to_cpu(resp->result);
lbs_deb_cmd("CMD_RESP: %x result: %d length: %d\n", respcmd,
result, priv->wlan_dev.upld_len);
result, priv->upld_len);
if (!(respcmd & 0x8000)) {
lbs_deb_cmd("Invalid response to command!");
......
......@@ -197,7 +197,7 @@ static ssize_t libertas_extscan(struct file *file, const char __user *userbuf,
libertas_send_specific_SSID_scan(priv, &extscan_ssid, 1);
memset(&wrqu, 0, sizeof(union iwreq_data));
wireless_send_event(priv->wlan_dev.netdev, SIOCGIWSCAN, &wrqu, NULL);
wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL);
out_unlock:
free_page(addr);
......@@ -387,7 +387,7 @@ static ssize_t libertas_setuserscan(struct file *file,
!priv->adapter->nr_cmd_pending);
memset(&wrqu, 0x00, sizeof(union iwreq_data));
wireless_send_event(priv->wlan_dev.netdev, SIOCGIWSCAN, &wrqu, NULL);
wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL);
out_unlock:
free_page(addr);
......
......@@ -89,31 +89,6 @@ struct sleep_params {
u16 sp_reserved;
};
/** Data structure for the Marvell WLAN device */
typedef struct _wlan_dev {
/** device name */
char name[DEV_NAME_LEN];
/** card pointer */
void *card;
/** IO port */
u32 ioport;
/** Upload received */
u32 upld_rcv;
/** Upload type */
u32 upld_typ;
/** Upload length */
u32 upld_len;
/** netdev pointer */
struct net_device *netdev;
/* Upload buffer */
u8 upld_buf[WLAN_UPLD_SIZE];
/* Download sent:
bit0 1/0=data_sent/data_tx_done,
bit1 1/0=cmd_sent/cmd_tx_done,
all other bits reserved 0 */
u8 dnld_sent;
} wlan_dev_t, *pwlan_dev_t;
/* Mesh statistics */
struct wlan_mesh_stats {
u32 fwd_bcast_cnt; /* Fwd: Broadcast counter */
......@@ -132,8 +107,11 @@ struct _wlan_private {
int mesh_open;
int infra_open;
char name[DEV_NAME_LEN];
void *card;
wlan_adapter *adapter;
wlan_dev_t wlan_dev;
struct net_device *dev;
struct net_device_stats stats;
struct net_device *mesh_dev ; /* Virtual device */
......@@ -154,6 +132,16 @@ struct _wlan_private {
u32 bbp_offset;
u32 rf_offset;
/** Upload length */
u32 upld_len;
/* Upload buffer */
u8 upld_buf[WLAN_UPLD_SIZE];
/* Download sent:
bit0 1/0=data_sent/data_tx_done,
bit1 1/0=cmd_sent/cmd_tx_done,
all other bits reserved 0 */
u8 dnld_sent;
const struct firmware *firmware;
struct device *hotplug_device;
......
......@@ -22,7 +22,7 @@
*/
int if_usb_issue_boot_command(wlan_private *priv, int ivalue)
{
struct usb_card_rec *cardp = priv->wlan_dev.card;
struct usb_card_rec *cardp = priv->card;
struct bootcmdstr sbootcmd;
int i;
......
......@@ -61,7 +61,7 @@ static void if_usb_write_bulk_callback(struct urb *urb)
{
wlan_private *priv = (wlan_private *) (urb->context);
wlan_adapter *adapter = priv->adapter;
struct net_device *dev = priv->wlan_dev.netdev;
struct net_device *dev = priv->dev;
/* handle the transmission complete validations */
......@@ -74,7 +74,7 @@ static void if_usb_write_bulk_callback(struct urb *urb)
lbs_deb_usbd(&urb->dev->dev, "Actual length transmitted %d\n",
urb->actual_length);
*/
priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED;
priv->dnld_sent = DNLD_RES_RECEIVED;
/* Wake main thread if commands are pending */
if (!adapter->cur_cmd)
wake_up_interruptible(&priv->mainthread.waitq);
......@@ -239,7 +239,7 @@ static int if_usb_probe(struct usb_interface *intf,
unregister_netdev(priv->mesh_dev);
free_netdev(priv->mesh_dev);
err_add_mesh:
free_netdev(priv->wlan_dev.netdev);
free_netdev(priv->dev);
kfree(priv->adapter);
dealloc:
if_usb_free(cardp);
......@@ -289,7 +289,7 @@ static void if_usb_disconnect(struct usb_interface *intf)
*/
static int if_prog_firmware(wlan_private * priv)
{
struct usb_card_rec *cardp = priv->wlan_dev.card;
struct usb_card_rec *cardp = priv->card;
struct FWData *fwdata;
struct fwheader *fwheader;
u8 *firmware = priv->firmware->data;
......@@ -368,7 +368,7 @@ static int if_prog_firmware(wlan_private * priv)
static int libertas_do_reset(wlan_private *priv)
{
int ret;
struct usb_card_rec *cardp = priv->wlan_dev.card;
struct usb_card_rec *cardp = priv->card;
lbs_deb_enter(LBS_DEB_USB);
......@@ -394,7 +394,7 @@ static int libertas_do_reset(wlan_private *priv)
int usb_tx_block(wlan_private * priv, u8 * payload, u16 nb)
{
/* pointer to card structure */
struct usb_card_rec *cardp = priv->wlan_dev.card;
struct usb_card_rec *cardp = priv->card;
int ret = -1;
/* check if device is removed */
......@@ -427,7 +427,7 @@ static int __if_usb_submit_rx_urb(wlan_private * priv,
void (*callbackfn)
(struct urb *urb))
{
struct usb_card_rec *cardp = priv->wlan_dev.card;
struct usb_card_rec *cardp = priv->card;
struct sk_buff *skb;
struct read_cb_info *rinfo = &cardp->rinfo;
int ret = -1;
......@@ -478,7 +478,7 @@ static void if_usb_receive_fwload(struct urb *urb)
struct read_cb_info *rinfo = (struct read_cb_info *)urb->context;
wlan_private *priv = rinfo->priv;
struct sk_buff *skb = rinfo->skb;
struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card;
struct usb_card_rec *cardp = (struct usb_card_rec *)priv->card;
struct fwsyncheader *syncfwheader;
struct bootcmdrespStr bootcmdresp;
......@@ -582,7 +582,7 @@ static inline void process_cmdtypedata(int recvlength, struct sk_buff *skb,
skb_put(skb, recvlength);
skb_pull(skb, MESSAGE_HEADER_LEN);
libertas_process_rxed_packet(priv, skb);
priv->wlan_dev.upld_len = (recvlength - MESSAGE_HEADER_LEN);
priv->upld_len = (recvlength - MESSAGE_HEADER_LEN);
}
static inline void process_cmdrequest(int recvlength, u8 *recvbuff,
......@@ -605,18 +605,18 @@ static inline void process_cmdrequest(int recvlength, u8 *recvbuff,
/* take care of cur_cmd = NULL case by reading the
* data to clear the interrupt */
if (!priv->adapter->cur_cmd) {
cmdbuf = priv->wlan_dev.upld_buf;
cmdbuf = priv->upld_buf;
priv->adapter->hisregcpy &= ~his_cmdupldrdy;
} else
cmdbuf = priv->adapter->cur_cmd->bufvirtualaddr;
cardp->usb_int_cause |= his_cmdupldrdy;
priv->wlan_dev.upld_len = (recvlength - MESSAGE_HEADER_LEN);
priv->upld_len = (recvlength - MESSAGE_HEADER_LEN);
memcpy(cmdbuf, recvbuff + MESSAGE_HEADER_LEN,
priv->wlan_dev.upld_len);
priv->upld_len);
kfree_skb(skb);
libertas_interrupt(priv->wlan_dev.netdev);
libertas_interrupt(priv->dev);
spin_unlock(&priv->adapter->driver_lock);
lbs_deb_usbd(&cardp->udev->dev,
......@@ -637,7 +637,7 @@ static void if_usb_receive(struct urb *urb)
struct read_cb_info *rinfo = (struct read_cb_info *)urb->context;
wlan_private *priv = rinfo->priv;
struct sk_buff *skb = rinfo->skb;
struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card;
struct usb_card_rec *cardp = (struct usb_card_rec *)priv->card;
int recvlength = urb->actual_length;
u8 *recvbuff = NULL;
......@@ -689,7 +689,7 @@ static void if_usb_receive(struct urb *urb)
cardp->usb_event_cause = le32_to_cpu(cardp->usb_event_cause) << 3;
cardp->usb_int_cause |= his_cardevent;
kfree_skb(skb);
libertas_interrupt(priv->wlan_dev.netdev);
libertas_interrupt(priv->dev);
spin_unlock(&priv->adapter->driver_lock);
goto rx_exit;
default:
......@@ -715,20 +715,20 @@ static int if_usb_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 n
{
int ret = -1;
u32 tmp;
struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card;
struct usb_card_rec *cardp = (struct usb_card_rec *)priv->card;
lbs_deb_usbd(&cardp->udev->dev,"*** type = %u\n", type);
lbs_deb_usbd(&cardp->udev->dev,"size after = %d\n", nb);
if (type == MVMS_CMD) {
tmp = cpu_to_le32(CMD_TYPE_REQUEST);
priv->wlan_dev.dnld_sent = DNLD_CMD_SENT;
priv->dnld_sent = DNLD_CMD_SENT;
memcpy(cardp->bulk_out_buffer, (u8 *) & tmp,
MESSAGE_HEADER_LEN);
} else {
tmp = cpu_to_le32(CMD_TYPE_DATA);
priv->wlan_dev.dnld_sent = DNLD_DATA_SENT;
priv->dnld_sent = DNLD_DATA_SENT;
memcpy(cardp->bulk_out_buffer, (u8 *) & tmp,
MESSAGE_HEADER_LEN);
}
......@@ -744,7 +744,7 @@ static int if_usb_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 n
/* called with adapter->driver_lock held */
static int if_usb_get_int_status(wlan_private * priv, u8 * ireg)
{
struct usb_card_rec *cardp = priv->wlan_dev.card;
struct usb_card_rec *cardp = priv->card;
*ireg = cardp->usb_int_cause;
cardp->usb_int_cause = 0;
......@@ -756,7 +756,7 @@ static int if_usb_get_int_status(wlan_private * priv, u8 * ireg)
static int if_usb_read_event_cause(wlan_private * priv)
{
struct usb_card_rec *cardp = priv->wlan_dev.card;
struct usb_card_rec *cardp = priv->card;
priv->adapter->eventcause = cardp->usb_event_cause;
/* Re-submit rx urb here to avoid event lost issue */
if_usb_submit_rx_urb(priv);
......@@ -798,12 +798,12 @@ static int if_usb_unregister_dev(wlan_private * priv)
*/
static int if_usb_register_dev(wlan_private * priv)
{
struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card;
struct usb_card_rec *cardp = (struct usb_card_rec *)priv->card;
lbs_deb_enter(LBS_DEB_USB);
cardp->priv = priv;
cardp->eth_dev = priv->wlan_dev.netdev;
cardp->eth_dev = priv->dev;
priv->hotplug_device = &(cardp->udev->dev);
SET_NETDEV_DEV(cardp->eth_dev, &(cardp->udev->dev));
......@@ -820,7 +820,7 @@ static int if_usb_register_dev(wlan_private * priv)
static int if_usb_prog_firmware(wlan_private * priv)
{
struct usb_card_rec *cardp = priv->wlan_dev.card;
struct usb_card_rec *cardp = priv->card;
int i = 0;
static int reset_count = 10;
int ret = 0;
......
......@@ -804,8 +804,8 @@ int libertas_ret_80211_associate(wlan_private * priv,
adapter->nextSNRNF = 0;
adapter->numSNRNF = 0;
netif_carrier_on(priv->wlan_dev.netdev);
netif_wake_queue(priv->wlan_dev.netdev);
netif_carrier_on(priv->dev);
netif_wake_queue(priv->dev);
netif_carrier_on(priv->mesh_dev);
netif_wake_queue(priv->mesh_dev);
......@@ -814,7 +814,7 @@ int libertas_ret_80211_associate(wlan_private * priv,
memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, ETH_ALEN);
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL);
wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
done:
lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
......@@ -899,8 +899,8 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
memcpy(&adapter->curbssparams.ssid,
&pbssdesc->ssid, sizeof(struct WLAN_802_11_SSID));
netif_carrier_on(priv->wlan_dev.netdev);
netif_wake_queue(priv->wlan_dev.netdev);
netif_carrier_on(priv->dev);
netif_wake_queue(priv->dev);
netif_carrier_on(priv->mesh_dev);
netif_wake_queue(priv->mesh_dev);
......@@ -908,7 +908,7 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
memset(&wrqu, 0, sizeof(wrqu));
memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, ETH_ALEN);
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL);
wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
lbs_deb_join("ADHOC_RESP: - Joined/Started Ad Hoc\n");
lbs_deb_join("ADHOC_RESP: channel = %d\n", adapter->adhocchannel);
......
......@@ -261,10 +261,10 @@ static int wlan_dev_open(struct net_device *dev)
priv->open = 1;
if (adapter->connect_status == libertas_connected) {
netif_carrier_on(priv->wlan_dev.netdev);
netif_carrier_on(priv->dev);
netif_carrier_on(priv->mesh_dev);
} else {
netif_carrier_off(priv->wlan_dev.netdev);
netif_carrier_off(priv->dev);
netif_carrier_off(priv->mesh_dev);
}
......@@ -286,7 +286,7 @@ static int mesh_open(struct net_device *dev)
priv->mesh_open = 1 ;
netif_wake_queue(priv->mesh_dev);
if (priv->infra_open == 0)
return wlan_dev_open(priv->wlan_dev.netdev) ;
return wlan_dev_open(priv->dev) ;
return 0;
}
......@@ -303,9 +303,9 @@ static int wlan_open(struct net_device *dev)
if(pre_open_check(dev) == -1)
return -1;
priv->infra_open = 1 ;
netif_wake_queue(priv->wlan_dev.netdev);
netif_wake_queue(priv->dev);
if (priv->open == 0)
return wlan_dev_open(priv->wlan_dev.netdev) ;
return wlan_dev_open(priv->dev) ;
return 0;
}
......@@ -315,7 +315,7 @@ static int wlan_dev_close(struct net_device *dev)
lbs_deb_enter(LBS_DEB_NET);
netif_carrier_off(priv->wlan_dev.netdev);
netif_carrier_off(priv->dev);
netif_carrier_off(priv->mesh_dev);
priv->open = 0;
......@@ -336,7 +336,7 @@ static int mesh_close(struct net_device *dev)
priv->mesh_open = 0;
netif_stop_queue(priv->mesh_dev);
if (priv->infra_open == 0)
return wlan_dev_close( ((wlan_private *) dev->priv)->wlan_dev.netdev) ;
return wlan_dev_close(dev);
else
return 0;
}
......@@ -351,10 +351,10 @@ static int wlan_close(struct net_device *dev)
{
wlan_private *priv = (wlan_private *) dev->priv;
netif_stop_queue(priv->wlan_dev.netdev);
netif_stop_queue(dev);
priv->infra_open = 0;
if (priv->mesh_open == 0)
return wlan_dev_close( ((wlan_private *) dev->priv)->wlan_dev.netdev) ;
return wlan_dev_close(dev);
else
return 0;
}
......@@ -367,12 +367,12 @@ static int wlan_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
lbs_deb_enter(LBS_DEB_NET);
if (priv->wlan_dev.dnld_sent || priv->adapter->TxLockFlag) {
if (priv->dnld_sent || priv->adapter->TxLockFlag) {
priv->stats.tx_dropped++;
goto done;
}
netif_stop_queue(priv->wlan_dev.netdev);
netif_stop_queue(priv->dev);
netif_stop_queue(priv->mesh_dev);
if (libertas_process_tx(priv, skb) == 0)
......@@ -395,7 +395,7 @@ static int mesh_pre_start_xmit(struct sk_buff *skb, struct net_device *dev)
SET_MESH_FRAME(skb);
ret = wlan_hard_start_xmit(skb, priv->wlan_dev.netdev);
ret = wlan_hard_start_xmit(skb, priv->dev);
lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret);
return ret;
}
......@@ -425,7 +425,7 @@ static void wlan_tx_timeout(struct net_device *dev)
lbs_pr_err("tx watch dog timeout\n");
priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED;
priv->dnld_sent = DNLD_RES_RECEIVED;
dev->trans_start = jiffies;
if (priv->adapter->currenttxskb) {
......@@ -437,7 +437,7 @@ static void wlan_tx_timeout(struct net_device *dev)
} else
wake_up_interruptible(&priv->mainthread.waitq);
} else if (priv->adapter->connect_status == libertas_connected) {
netif_wake_queue(priv->wlan_dev.netdev);
netif_wake_queue(priv->dev);
netif_wake_queue(priv->mesh_dev);
}
......@@ -611,14 +611,14 @@ static int wlan_service_main_thread(void *data)
lbs_deb_thread( "main-thread 111: intcounter=%d "
"currenttxskb=%p dnld_sent=%d\n",
adapter->intcounter,
adapter->currenttxskb, priv->wlan_dev.dnld_sent);
adapter->currenttxskb, priv->dnld_sent);
add_wait_queue(&thread->waitq, &wait);
set_current_state(TASK_INTERRUPTIBLE);
spin_lock_irq(&adapter->driver_lock);
if ((adapter->psstate == PS_STATE_SLEEP) ||
(!adapter->intcounter
&& (priv->wlan_dev.dnld_sent || adapter->cur_cmd ||
&& (priv->dnld_sent || adapter->cur_cmd ||
list_empty(&adapter->cmdpendingq)))) {
lbs_deb_thread(
"main-thread sleeping... Conn=%d IntC=%d PS_mode=%d PS_State=%d\n",
......@@ -633,7 +633,7 @@ static int wlan_service_main_thread(void *data)
lbs_deb_thread(
"main-thread 222 (waking up): intcounter=%d currenttxskb=%p "
"dnld_sent=%d\n", adapter->intcounter,
adapter->currenttxskb, priv->wlan_dev.dnld_sent);
adapter->currenttxskb, priv->dnld_sent);
set_current_state(TASK_RUNNING);
remove_wait_queue(&thread->waitq, &wait);
......@@ -642,7 +642,7 @@ static int wlan_service_main_thread(void *data)
lbs_deb_thread("main-thread 333: intcounter=%d currenttxskb=%p "
"dnld_sent=%d\n",
adapter->intcounter,
adapter->currenttxskb, priv->wlan_dev.dnld_sent);
adapter->currenttxskb, priv->dnld_sent);
if (kthread_should_stop()
|| adapter->surpriseremoved) {
......@@ -671,7 +671,7 @@ static int wlan_service_main_thread(void *data)
lbs_deb_thread("main-thread 444: intcounter=%d currenttxskb=%p "
"dnld_sent=%d\n",
adapter->intcounter,
adapter->currenttxskb, priv->wlan_dev.dnld_sent);
adapter->currenttxskb, priv->dnld_sent);
/* command response? */
if (adapter->hisregcpy & his_cmdupldrdy) {
......@@ -702,7 +702,7 @@ static int wlan_service_main_thread(void *data)
/* Check if we need to confirm Sleep Request received previously */
if (adapter->psstate == PS_STATE_PRE_SLEEP) {
if (!priv->wlan_dev.dnld_sent && !adapter->cur_cmd) {
if (!priv->dnld_sent && !adapter->cur_cmd) {
if (adapter->connect_status ==
libertas_connected) {
lbs_deb_thread(
......@@ -710,7 +710,7 @@ static int wlan_service_main_thread(void *data)
"dnld_sent=%d cur_cmd=%p, confirm now\n",
adapter->intcounter,
adapter->currenttxskb,
priv->wlan_dev.dnld_sent,
priv->dnld_sent,
adapter->cur_cmd);
libertas_ps_confirm_sleep(priv,
......@@ -736,7 +736,7 @@ static int wlan_service_main_thread(void *data)
continue;
/* Execute the next command */
if (!priv->wlan_dev.dnld_sent && !priv->adapter->cur_cmd)
if (!priv->dnld_sent && !priv->adapter->cur_cmd)
libertas_execute_next_command(priv);
/* Wake-up command waiters which can't sleep in
......@@ -784,8 +784,8 @@ wlan_private *libertas_add_card(void *card)
goto err_kzalloc;
}
priv->wlan_dev.netdev = dev;
priv->wlan_dev.card = card;
priv->dev = dev;
priv->card = card;
priv->mesh_open = 0;
priv->infra_open = 0;
......@@ -828,7 +828,7 @@ EXPORT_SYMBOL_GPL(libertas_add_card);
int libertas_activate_card(wlan_private *priv, char *fw_name)
{
struct net_device *dev = priv->wlan_dev.netdev;
struct net_device *dev = priv->dev;
int ret = -1;
lbs_deb_enter(LBS_DEB_MAIN);
......@@ -916,8 +916,8 @@ int libertas_add_mesh(wlan_private *priv)
mesh_dev->do_ioctl = libertas_do_ioctl;
mesh_dev->get_stats = wlan_get_stats;
mesh_dev->ethtool_ops = &libertas_ethtool_ops;
memcpy(mesh_dev->dev_addr, priv->wlan_dev.netdev->dev_addr,
sizeof(priv->wlan_dev.netdev->dev_addr));
memcpy(mesh_dev->dev_addr, priv->dev->dev_addr,
sizeof(priv->dev->dev_addr));
#ifdef WIRELESS_EXT
mesh_dev->wireless_handlers = (struct iw_handler_def *)&libertas_handler_def;
......@@ -984,10 +984,10 @@ int libertas_remove_card(wlan_private *priv)
if (!adapter)
goto out;
dev = priv->wlan_dev.netdev;
dev = priv->dev;
netif_stop_queue(priv->wlan_dev.netdev);
netif_carrier_off(priv->wlan_dev.netdev);
netif_stop_queue(priv->dev);
netif_carrier_off(priv->dev);
wake_pending_cmdnodes(priv);
......@@ -1003,7 +1003,7 @@ int libertas_remove_card(wlan_private *priv)
memset(wrqu.ap_addr.sa_data, 0xaa, ETH_ALEN);
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL);
wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
adapter->surpriseremoved = 1;
......@@ -1017,7 +1017,7 @@ int libertas_remove_card(wlan_private *priv)
lbs_deb_net("unregister finish\n");
priv->wlan_dev.netdev = NULL;
priv->dev = NULL;
free_netdev(dev);
out:
......
......@@ -143,8 +143,8 @@ void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb)
if (priv->mesh_dev && IS_MESH_FRAME(skb))
skb->dev = priv->mesh_dev;
else
skb->dev = priv->wlan_dev.netdev;
skb->protocol = eth_type_trans(skb, priv->wlan_dev.netdev);
skb->dev = priv->dev;
skb->protocol = eth_type_trans(skb, priv->dev);
skb->ip_summed = CHECKSUM_UNNECESSARY;
netif_rx(skb);
......
......@@ -733,7 +733,7 @@ static int wlan_scan_channel_list(wlan_private * priv,
priv->adapter->last_scanned_channel = ptmpchan->channumber;
memset(&wrqu, 0, sizeof(union iwreq_data));
wireless_send_event(priv->wlan_dev.netdev, SIOCGIWSCAN, &wrqu, NULL);
wireless_send_event(priv->dev, SIOCGIWSCAN, &wrqu, NULL);
done:
lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", ret);
......@@ -805,8 +805,8 @@ int wlan_scan_networks(wlan_private * priv,
/* Keep the data path active if we are only scanning our current channel */
if (!scancurrentchanonly) {
netif_stop_queue(priv->wlan_dev.netdev);
netif_carrier_off(priv->wlan_dev.netdev);
netif_stop_queue(priv->dev);
netif_carrier_off(priv->dev);
netif_stop_queue(priv->mesh_dev);
netif_carrier_off(priv->mesh_dev);
}
......@@ -827,8 +827,8 @@ int wlan_scan_networks(wlan_private * priv,
wlan_scan_process_results(priv);
if (priv->adapter->connect_status == libertas_connected) {
netif_carrier_on(priv->wlan_dev.netdev);
netif_wake_queue(priv->wlan_dev.netdev);
netif_carrier_on(priv->dev);
netif_wake_queue(priv->dev);
netif_carrier_on(priv->mesh_dev);
netif_wake_queue(priv->mesh_dev);
}
......
......@@ -157,7 +157,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb)
received from FW */
skb_orphan(skb);
/* stop processing outgoing pkts */
netif_stop_queue(priv->wlan_dev.netdev);
netif_stop_queue(priv->dev);
netif_stop_queue(priv->mesh_dev);
/* freeze any packets already in our queues */
priv->adapter->TxLockFlag = 1;
......@@ -196,10 +196,10 @@ static void wlan_tx_queue(wlan_private *priv, struct sk_buff *skb)
WARN_ON(priv->adapter->tx_queue_idx >= NR_TX_QUEUE);
adapter->tx_queue_ps[adapter->tx_queue_idx++] = skb;
if (adapter->tx_queue_idx == NR_TX_QUEUE) {
netif_stop_queue(priv->wlan_dev.netdev);
netif_stop_queue(priv->dev);
netif_stop_queue(priv->mesh_dev);
} else {
netif_start_queue(priv->wlan_dev.netdev);
netif_start_queue(priv->dev);
netif_start_queue(priv->mesh_dev);
}
......@@ -220,9 +220,9 @@ int libertas_process_tx(wlan_private * priv, struct sk_buff *skb)
lbs_deb_enter(LBS_DEB_TX);
lbs_dbg_hex("TX Data", skb->data, min_t(unsigned int, skb->len, 100));
if (priv->wlan_dev.dnld_sent) {
if (priv->dnld_sent) {
lbs_pr_alert( "TX error: dnld_sent = %d, not sending\n",
priv->wlan_dev.dnld_sent);
priv->dnld_sent);
goto done;
}
......@@ -283,7 +283,7 @@ void libertas_send_tx_feedback(wlan_private * priv)
adapter->currenttxskb = NULL;
priv->adapter->TxLockFlag = 0;
if (priv->adapter->connect_status == libertas_connected) {
netif_wake_queue(priv->wlan_dev.netdev);
netif_wake_queue(priv->dev);
netif_wake_queue(priv->mesh_dev);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment