[PATCH] libertas: remove unused variables in wlan_dev_t

Dan Williams dcbw at redhat.com
Sat Mar 17 00:57:07 EDT 2007


On Mon, 2007-02-26 at 15:31 +0100, Holger Schurig wrote:
> 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.

Applied.

> Signed-off-by: Holger Schurig <hs4233 at mail.mn-solutions.de>
> ---
>  drivers/net/wireless/libertas/cmd.c        |    6 +-
>  drivers/net/wireless/libertas/cmdresp.c    |   12 +++---
>  drivers/net/wireless/libertas/debugfs.c    |    4 +-
>  drivers/net/wireless/libertas/dev.h        |   40 +++++++------------
>  drivers/net/wireless/libertas/if_bootcmd.c |    2 +-
>  drivers/net/wireless/libertas/if_usb.c     |   44 ++++++++++----------
>  drivers/net/wireless/libertas/ioctl.c      |    2 +-
>  drivers/net/wireless/libertas/join.c       |   12 +++---
>  drivers/net/wireless/libertas/main.c       |   58 ++++++++++++++--------------
>  drivers/net/wireless/libertas/rx.c         |    4 +-
>  drivers/net/wireless/libertas/scan.c       |   10 ++--
>  drivers/net/wireless/libertas/tx.c         |   12 +++---
>  12 files changed, 97 insertions(+), 109 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
> index 32904a4..fe206c6 100644
> --- a/drivers/net/wireless/libertas/cmd.c
> +++ b/drivers/net/wireless/libertas/cmd.c
> @@ -1822,7 +1822,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);
>  }
> @@ -1841,7 +1841,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)
> @@ -1925,7 +1925,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");
>  	}
> diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
> index 1b3d54d..f497dd0 100644
> --- a/drivers/net/wireless/libertas/cmdresp.c
> +++ b/drivers/net/wireless/libertas/cmdresp.c
> @@ -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));
> @@ -220,7 +220,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);
>  
> @@ -775,14 +775,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!");
> diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
> index f5f4461..14cd12a 100644
> --- a/drivers/net/wireless/libertas/debugfs.c
> +++ b/drivers/net/wireless/libertas/debugfs.c
> @@ -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);
> diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
> index 2961a8b..57e9159 100644
> --- a/drivers/net/wireless/libertas/dev.h
> +++ b/drivers/net/wireless/libertas/dev.h
> @@ -90,31 +90,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;
>  
> diff --git a/drivers/net/wireless/libertas/if_bootcmd.c b/drivers/net/wireless/libertas/if_bootcmd.c
> index bf8dc9f..b64430c 100644
> --- a/drivers/net/wireless/libertas/if_bootcmd.c
> +++ b/drivers/net/wireless/libertas/if_bootcmd.c
> @@ -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;
>  
> diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
> index 804b62d..b5d1099 100644
> --- a/drivers/net/wireless/libertas/if_usb.c
> +++ b/drivers/net/wireless/libertas/if_usb.c
> @@ -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);
> @@ -281,7 +281,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;
> @@ -360,7 +360,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);
>  
> @@ -386,7 +386,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 */
> @@ -419,7 +419,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;
> @@ -470,7 +470,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;
>  
> @@ -574,7 +574,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,
> @@ -597,18 +597,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,
> @@ -629,7 +629,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;
> @@ -680,7 +680,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:
> @@ -706,20 +706,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);
>  	}
> @@ -735,7 +735,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;
> @@ -747,7 +747,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);
> @@ -790,12 +790,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));
> @@ -811,7 +811,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;
> diff --git a/drivers/net/wireless/libertas/ioctl.c b/drivers/net/wireless/libertas/ioctl.c
> index 803d270..7178d27 100644
> --- a/drivers/net/wireless/libertas/ioctl.c
> +++ b/drivers/net/wireless/libertas/ioctl.c
> @@ -694,7 +694,7 @@ static void adjust_mtu(wlan_private * priv)
>  	if (priv->adapter->radiomode == WLAN_RADIOMODE_RADIOTAP)
>  		mtu_increment += max(sizeof(struct tx_radiotap_hdr),
>  				     sizeof(struct rx_radiotap_hdr));
> -	priv->wlan_dev.netdev->mtu = ETH_FRAME_LEN
> +	priv->dev->mtu = ETH_FRAME_LEN
>  	    - sizeof(struct ethhdr)
>  	    + mtu_increment;
>  }
> diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c
> index d80fe31..65752c8 100644
> --- a/drivers/net/wireless/libertas/join.c
> +++ b/drivers/net/wireless/libertas/join.c
> @@ -930,14 +930,14 @@ 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);
>  
>  	lbs_deb_join("ASSOC_RESP: Associated \n");
>  
>  	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);
> @@ -1022,13 +1022,13 @@ 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);
>  
>  	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);
> diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
> index 6913280..c1cb750 100644
> --- a/drivers/net/wireless/libertas/main.c
> +++ b/drivers/net/wireless/libertas/main.c
> @@ -254,9 +254,9 @@ 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);
>  	} else
> -		netif_carrier_off(priv->wlan_dev.netdev);
> +		netif_carrier_off(priv->dev);
>  
>  	lbs_deb_leave(LBS_DEB_NET);
>  	return 0;
> @@ -276,7 +276,7 @@ static int mesh_open(struct net_device *dev)
>  	priv->mesh_open = 1 ;
>  	netif_start_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;
>  }
>  
> @@ -293,9 +293,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;
>  }
>  
> @@ -305,7 +305,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(dev);
>  	priv->open = 0;
>  
>  	lbs_deb_leave(LBS_DEB_NET);
> @@ -325,7 +325,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;
>  }
> @@ -340,10 +340,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;
>  }
> @@ -356,12 +356,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);
>  
>  	if (libertas_process_tx(priv, skb) == 0)
>  		dev->trans_start = jiffies;
> @@ -383,7 +383,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;
>  }
> @@ -413,7 +413,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) {
> @@ -425,7 +425,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);
>  
>  	lbs_deb_leave(LBS_DEB_TX);
>  }
> @@ -597,14 +597,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",
> @@ -619,7 +619,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);
> @@ -628,7 +628,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) {
> @@ -657,7 +657,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) {
> @@ -688,7 +688,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(
> @@ -696,7 +696,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,
> @@ -722,7 +722,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 
> @@ -774,8 +774,8 @@ wlan_private *libertas_add_card(void *card)
>  		goto done;
>  	}
>  
> -	priv->wlan_dev.netdev = dev;
> -	priv->wlan_dev.card = card;
> +	priv->dev = dev;
> +	priv->card = card;
>  	priv->mesh_open = 0;
>  	priv->infra_open = 0;
>  
> @@ -827,7 +827,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);
> @@ -917,8 +917,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;
> @@ -973,7 +973,7 @@ int libertas_remove_card(wlan_private *priv)
>  		goto out;
>  
>  	adapter = priv->adapter;
> -	dev = priv->wlan_dev.netdev;
> +	dev = priv->dev;
>  
>  	if (adapter) {
>  		if (dev) {
> @@ -1011,7 +1011,7 @@ int libertas_remove_card(wlan_private *priv)
>  	libertas_debugfs_remove_one(priv);
>  
>  	if (dev) {
> -		priv->wlan_dev.netdev = NULL;
> +		priv->dev = NULL;
>  		free_netdev(dev);
>  	}
>  
> diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c
> index ca16411..b1a6234 100644
> --- a/drivers/net/wireless/libertas/rx.c
> +++ b/drivers/net/wireless/libertas/rx.c
> @@ -143,8 +143,8 @@ int 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);
> diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
> index 6db967f..8510f1b 100644
> --- a/drivers/net/wireless/libertas/scan.c
> +++ b/drivers/net/wireless/libertas/scan.c
> @@ -760,7 +760,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);
> @@ -832,8 +832,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);
>  	}
>  
>  	ret = wlan_scan_channel_list(priv,
> @@ -852,8 +852,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);
>  	}
>  
>  out:
> diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c
> index 89bf76c..e52f4f3 100644
> --- a/drivers/net/wireless/libertas/tx.c
> +++ b/drivers/net/wireless/libertas/tx.c
> @@ -157,7 +157,7 @@ done:
>  		   received from FW */
>  		skb_orphan(skb);
>  		/* stop processing outgoing pkts */
> -		netif_stop_queue(priv->wlan_dev.netdev);
> +		netif_stop_queue(priv->dev);
>  		/* freeze any packets already in our queues */
>  		priv->adapter->TxLockFlag = 1;
>  	} else {
> @@ -195,9 +195,9 @@ 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);
>  	else
> -		netif_start_queue(priv->wlan_dev.netdev);
> +		netif_start_queue(priv->dev);
>  
>  	spin_unlock(&adapter->txqueue_lock);
>  }
> @@ -216,9 +216,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;
>  	}
>  
> @@ -279,6 +279,6 @@ 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);
>  }
>  EXPORT_SYMBOL_GPL(libertas_send_tx_feedback);




More information about the libertas-dev mailing list