diff options
author | Holger Schurig <hs4233@mail.mn-solutions.de> | 2007-05-25 13:05:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:40 -0400 |
commit | 634b8f49c11f49272b09d13a34b22a17b8c3d419 (patch) | |
tree | 75ccd1d8160390235ada42d1c311710534392a02 /drivers/net/wireless/libertas/if_usb.c | |
parent | ec3eef28d9bc3fbcc5d3dd668dffcaa675015b11 (diff) |
[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: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/if_usb.c')
-rw-r--r-- | drivers/net/wireless/libertas/if_usb.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index d87915dbe827..ad28ecc92285 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) | |||
61 | { | 61 | { |
62 | wlan_private *priv = (wlan_private *) (urb->context); | 62 | wlan_private *priv = (wlan_private *) (urb->context); |
63 | wlan_adapter *adapter = priv->adapter; | 63 | wlan_adapter *adapter = priv->adapter; |
64 | struct net_device *dev = priv->wlan_dev.netdev; | 64 | struct net_device *dev = priv->dev; |
65 | 65 | ||
66 | /* handle the transmission complete validations */ | 66 | /* handle the transmission complete validations */ |
67 | 67 | ||
@@ -74,7 +74,7 @@ static void if_usb_write_bulk_callback(struct urb *urb) | |||
74 | lbs_deb_usbd(&urb->dev->dev, "Actual length transmitted %d\n", | 74 | lbs_deb_usbd(&urb->dev->dev, "Actual length transmitted %d\n", |
75 | urb->actual_length); | 75 | urb->actual_length); |
76 | */ | 76 | */ |
77 | priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED; | 77 | priv->dnld_sent = DNLD_RES_RECEIVED; |
78 | /* Wake main thread if commands are pending */ | 78 | /* Wake main thread if commands are pending */ |
79 | if (!adapter->cur_cmd) | 79 | if (!adapter->cur_cmd) |
80 | wake_up_interruptible(&priv->mainthread.waitq); | 80 | wake_up_interruptible(&priv->mainthread.waitq); |
@@ -239,7 +239,7 @@ err_activate_card: | |||
239 | unregister_netdev(priv->mesh_dev); | 239 | unregister_netdev(priv->mesh_dev); |
240 | free_netdev(priv->mesh_dev); | 240 | free_netdev(priv->mesh_dev); |
241 | err_add_mesh: | 241 | err_add_mesh: |
242 | free_netdev(priv->wlan_dev.netdev); | 242 | free_netdev(priv->dev); |
243 | kfree(priv->adapter); | 243 | kfree(priv->adapter); |
244 | dealloc: | 244 | dealloc: |
245 | if_usb_free(cardp); | 245 | if_usb_free(cardp); |
@@ -289,7 +289,7 @@ static void if_usb_disconnect(struct usb_interface *intf) | |||
289 | */ | 289 | */ |
290 | static int if_prog_firmware(wlan_private * priv) | 290 | static int if_prog_firmware(wlan_private * priv) |
291 | { | 291 | { |
292 | struct usb_card_rec *cardp = priv->wlan_dev.card; | 292 | struct usb_card_rec *cardp = priv->card; |
293 | struct FWData *fwdata; | 293 | struct FWData *fwdata; |
294 | struct fwheader *fwheader; | 294 | struct fwheader *fwheader; |
295 | u8 *firmware = priv->firmware->data; | 295 | u8 *firmware = priv->firmware->data; |
@@ -368,7 +368,7 @@ static int if_prog_firmware(wlan_private * priv) | |||
368 | static int libertas_do_reset(wlan_private *priv) | 368 | static int libertas_do_reset(wlan_private *priv) |
369 | { | 369 | { |
370 | int ret; | 370 | int ret; |
371 | struct usb_card_rec *cardp = priv->wlan_dev.card; | 371 | struct usb_card_rec *cardp = priv->card; |
372 | 372 | ||
373 | lbs_deb_enter(LBS_DEB_USB); | 373 | lbs_deb_enter(LBS_DEB_USB); |
374 | 374 | ||
@@ -394,7 +394,7 @@ static int libertas_do_reset(wlan_private *priv) | |||
394 | int usb_tx_block(wlan_private * priv, u8 * payload, u16 nb) | 394 | int usb_tx_block(wlan_private * priv, u8 * payload, u16 nb) |
395 | { | 395 | { |
396 | /* pointer to card structure */ | 396 | /* pointer to card structure */ |
397 | struct usb_card_rec *cardp = priv->wlan_dev.card; | 397 | struct usb_card_rec *cardp = priv->card; |
398 | int ret = -1; | 398 | int ret = -1; |
399 | 399 | ||
400 | /* check if device is removed */ | 400 | /* check if device is removed */ |
@@ -427,7 +427,7 @@ static int __if_usb_submit_rx_urb(wlan_private * priv, | |||
427 | void (*callbackfn) | 427 | void (*callbackfn) |
428 | (struct urb *urb)) | 428 | (struct urb *urb)) |
429 | { | 429 | { |
430 | struct usb_card_rec *cardp = priv->wlan_dev.card; | 430 | struct usb_card_rec *cardp = priv->card; |
431 | struct sk_buff *skb; | 431 | struct sk_buff *skb; |
432 | struct read_cb_info *rinfo = &cardp->rinfo; | 432 | struct read_cb_info *rinfo = &cardp->rinfo; |
433 | int ret = -1; | 433 | int ret = -1; |
@@ -478,7 +478,7 @@ static void if_usb_receive_fwload(struct urb *urb) | |||
478 | struct read_cb_info *rinfo = (struct read_cb_info *)urb->context; | 478 | struct read_cb_info *rinfo = (struct read_cb_info *)urb->context; |
479 | wlan_private *priv = rinfo->priv; | 479 | wlan_private *priv = rinfo->priv; |
480 | struct sk_buff *skb = rinfo->skb; | 480 | struct sk_buff *skb = rinfo->skb; |
481 | struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card; | 481 | struct usb_card_rec *cardp = (struct usb_card_rec *)priv->card; |
482 | struct fwsyncheader *syncfwheader; | 482 | struct fwsyncheader *syncfwheader; |
483 | struct bootcmdrespStr bootcmdresp; | 483 | struct bootcmdrespStr bootcmdresp; |
484 | 484 | ||
@@ -582,7 +582,7 @@ static inline void process_cmdtypedata(int recvlength, struct sk_buff *skb, | |||
582 | skb_put(skb, recvlength); | 582 | skb_put(skb, recvlength); |
583 | skb_pull(skb, MESSAGE_HEADER_LEN); | 583 | skb_pull(skb, MESSAGE_HEADER_LEN); |
584 | libertas_process_rxed_packet(priv, skb); | 584 | libertas_process_rxed_packet(priv, skb); |
585 | priv->wlan_dev.upld_len = (recvlength - MESSAGE_HEADER_LEN); | 585 | priv->upld_len = (recvlength - MESSAGE_HEADER_LEN); |
586 | } | 586 | } |
587 | 587 | ||
588 | static inline void process_cmdrequest(int recvlength, u8 *recvbuff, | 588 | static inline void process_cmdrequest(int recvlength, u8 *recvbuff, |
@@ -605,18 +605,18 @@ static inline void process_cmdrequest(int recvlength, u8 *recvbuff, | |||
605 | /* take care of cur_cmd = NULL case by reading the | 605 | /* take care of cur_cmd = NULL case by reading the |
606 | * data to clear the interrupt */ | 606 | * data to clear the interrupt */ |
607 | if (!priv->adapter->cur_cmd) { | 607 | if (!priv->adapter->cur_cmd) { |
608 | cmdbuf = priv->wlan_dev.upld_buf; | 608 | cmdbuf = priv->upld_buf; |
609 | priv->adapter->hisregcpy &= ~his_cmdupldrdy; | 609 | priv->adapter->hisregcpy &= ~his_cmdupldrdy; |
610 | } else | 610 | } else |
611 | cmdbuf = priv->adapter->cur_cmd->bufvirtualaddr; | 611 | cmdbuf = priv->adapter->cur_cmd->bufvirtualaddr; |
612 | 612 | ||
613 | cardp->usb_int_cause |= his_cmdupldrdy; | 613 | cardp->usb_int_cause |= his_cmdupldrdy; |
614 | priv->wlan_dev.upld_len = (recvlength - MESSAGE_HEADER_LEN); | 614 | priv->upld_len = (recvlength - MESSAGE_HEADER_LEN); |
615 | memcpy(cmdbuf, recvbuff + MESSAGE_HEADER_LEN, | 615 | memcpy(cmdbuf, recvbuff + MESSAGE_HEADER_LEN, |
616 | priv->wlan_dev.upld_len); | 616 | priv->upld_len); |
617 | 617 | ||
618 | kfree_skb(skb); | 618 | kfree_skb(skb); |
619 | libertas_interrupt(priv->wlan_dev.netdev); | 619 | libertas_interrupt(priv->dev); |
620 | spin_unlock(&priv->adapter->driver_lock); | 620 | spin_unlock(&priv->adapter->driver_lock); |
621 | 621 | ||
622 | lbs_deb_usbd(&cardp->udev->dev, | 622 | lbs_deb_usbd(&cardp->udev->dev, |
@@ -637,7 +637,7 @@ static void if_usb_receive(struct urb *urb) | |||
637 | struct read_cb_info *rinfo = (struct read_cb_info *)urb->context; | 637 | struct read_cb_info *rinfo = (struct read_cb_info *)urb->context; |
638 | wlan_private *priv = rinfo->priv; | 638 | wlan_private *priv = rinfo->priv; |
639 | struct sk_buff *skb = rinfo->skb; | 639 | struct sk_buff *skb = rinfo->skb; |
640 | struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card; | 640 | struct usb_card_rec *cardp = (struct usb_card_rec *)priv->card; |
641 | 641 | ||
642 | int recvlength = urb->actual_length; | 642 | int recvlength = urb->actual_length; |
643 | u8 *recvbuff = NULL; | 643 | u8 *recvbuff = NULL; |
@@ -689,7 +689,7 @@ static void if_usb_receive(struct urb *urb) | |||
689 | cardp->usb_event_cause = le32_to_cpu(cardp->usb_event_cause) << 3; | 689 | cardp->usb_event_cause = le32_to_cpu(cardp->usb_event_cause) << 3; |
690 | cardp->usb_int_cause |= his_cardevent; | 690 | cardp->usb_int_cause |= his_cardevent; |
691 | kfree_skb(skb); | 691 | kfree_skb(skb); |
692 | libertas_interrupt(priv->wlan_dev.netdev); | 692 | libertas_interrupt(priv->dev); |
693 | spin_unlock(&priv->adapter->driver_lock); | 693 | spin_unlock(&priv->adapter->driver_lock); |
694 | goto rx_exit; | 694 | goto rx_exit; |
695 | default: | 695 | default: |
@@ -715,20 +715,20 @@ static int if_usb_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 n | |||
715 | { | 715 | { |
716 | int ret = -1; | 716 | int ret = -1; |
717 | u32 tmp; | 717 | u32 tmp; |
718 | struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card; | 718 | struct usb_card_rec *cardp = (struct usb_card_rec *)priv->card; |
719 | 719 | ||
720 | lbs_deb_usbd(&cardp->udev->dev,"*** type = %u\n", type); | 720 | lbs_deb_usbd(&cardp->udev->dev,"*** type = %u\n", type); |
721 | lbs_deb_usbd(&cardp->udev->dev,"size after = %d\n", nb); | 721 | lbs_deb_usbd(&cardp->udev->dev,"size after = %d\n", nb); |
722 | 722 | ||
723 | if (type == MVMS_CMD) { | 723 | if (type == MVMS_CMD) { |
724 | tmp = cpu_to_le32(CMD_TYPE_REQUEST); | 724 | tmp = cpu_to_le32(CMD_TYPE_REQUEST); |
725 | priv->wlan_dev.dnld_sent = DNLD_CMD_SENT; | 725 | priv->dnld_sent = DNLD_CMD_SENT; |
726 | memcpy(cardp->bulk_out_buffer, (u8 *) & tmp, | 726 | memcpy(cardp->bulk_out_buffer, (u8 *) & tmp, |
727 | MESSAGE_HEADER_LEN); | 727 | MESSAGE_HEADER_LEN); |
728 | 728 | ||
729 | } else { | 729 | } else { |
730 | tmp = cpu_to_le32(CMD_TYPE_DATA); | 730 | tmp = cpu_to_le32(CMD_TYPE_DATA); |
731 | priv->wlan_dev.dnld_sent = DNLD_DATA_SENT; | 731 | priv->dnld_sent = DNLD_DATA_SENT; |
732 | memcpy(cardp->bulk_out_buffer, (u8 *) & tmp, | 732 | memcpy(cardp->bulk_out_buffer, (u8 *) & tmp, |
733 | MESSAGE_HEADER_LEN); | 733 | MESSAGE_HEADER_LEN); |
734 | } | 734 | } |
@@ -744,7 +744,7 @@ static int if_usb_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 n | |||
744 | /* called with adapter->driver_lock held */ | 744 | /* called with adapter->driver_lock held */ |
745 | static int if_usb_get_int_status(wlan_private * priv, u8 * ireg) | 745 | static int if_usb_get_int_status(wlan_private * priv, u8 * ireg) |
746 | { | 746 | { |
747 | struct usb_card_rec *cardp = priv->wlan_dev.card; | 747 | struct usb_card_rec *cardp = priv->card; |
748 | 748 | ||
749 | *ireg = cardp->usb_int_cause; | 749 | *ireg = cardp->usb_int_cause; |
750 | cardp->usb_int_cause = 0; | 750 | cardp->usb_int_cause = 0; |
@@ -756,7 +756,7 @@ static int if_usb_get_int_status(wlan_private * priv, u8 * ireg) | |||
756 | 756 | ||
757 | static int if_usb_read_event_cause(wlan_private * priv) | 757 | static int if_usb_read_event_cause(wlan_private * priv) |
758 | { | 758 | { |
759 | struct usb_card_rec *cardp = priv->wlan_dev.card; | 759 | struct usb_card_rec *cardp = priv->card; |
760 | priv->adapter->eventcause = cardp->usb_event_cause; | 760 | priv->adapter->eventcause = cardp->usb_event_cause; |
761 | /* Re-submit rx urb here to avoid event lost issue */ | 761 | /* Re-submit rx urb here to avoid event lost issue */ |
762 | if_usb_submit_rx_urb(priv); | 762 | if_usb_submit_rx_urb(priv); |
@@ -798,12 +798,12 @@ static int if_usb_unregister_dev(wlan_private * priv) | |||
798 | */ | 798 | */ |
799 | static int if_usb_register_dev(wlan_private * priv) | 799 | static int if_usb_register_dev(wlan_private * priv) |
800 | { | 800 | { |
801 | struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card; | 801 | struct usb_card_rec *cardp = (struct usb_card_rec *)priv->card; |
802 | 802 | ||
803 | lbs_deb_enter(LBS_DEB_USB); | 803 | lbs_deb_enter(LBS_DEB_USB); |
804 | 804 | ||
805 | cardp->priv = priv; | 805 | cardp->priv = priv; |
806 | cardp->eth_dev = priv->wlan_dev.netdev; | 806 | cardp->eth_dev = priv->dev; |
807 | priv->hotplug_device = &(cardp->udev->dev); | 807 | priv->hotplug_device = &(cardp->udev->dev); |
808 | 808 | ||
809 | SET_NETDEV_DEV(cardp->eth_dev, &(cardp->udev->dev)); | 809 | SET_NETDEV_DEV(cardp->eth_dev, &(cardp->udev->dev)); |
@@ -820,7 +820,7 @@ static int if_usb_register_dev(wlan_private * priv) | |||
820 | 820 | ||
821 | static int if_usb_prog_firmware(wlan_private * priv) | 821 | static int if_usb_prog_firmware(wlan_private * priv) |
822 | { | 822 | { |
823 | struct usb_card_rec *cardp = priv->wlan_dev.card; | 823 | struct usb_card_rec *cardp = priv->card; |
824 | int i = 0; | 824 | int i = 0; |
825 | static int reset_count = 10; | 825 | static int reset_count = 10; |
826 | int ret = 0; | 826 | int ret = 0; |