diff options
Diffstat (limited to 'drivers/net/wireless/libertas/if_usb.c')
-rw-r--r-- | drivers/net/wireless/libertas/if_usb.c | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index 26176d54c576..4fce0baa0711 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c | |||
@@ -32,9 +32,12 @@ MODULE_DEVICE_TABLE(usb, if_usb_table); | |||
32 | static void if_usb_receive(struct urb *urb); | 32 | static void if_usb_receive(struct urb *urb); |
33 | static void if_usb_receive_fwload(struct urb *urb); | 33 | static void if_usb_receive_fwload(struct urb *urb); |
34 | static int if_usb_prog_firmware(struct usb_card_rec *cardp); | 34 | static int if_usb_prog_firmware(struct usb_card_rec *cardp); |
35 | static int if_usb_host_to_card(lbs_private *priv, u8 type, u8 *payload, u16 nb); | 35 | static int if_usb_host_to_card(struct lbs_private *priv, |
36 | static int if_usb_get_int_status(lbs_private *priv, u8 *); | 36 | u8 type, |
37 | static int if_usb_read_event_cause(lbs_private *); | 37 | u8 *payload, |
38 | u16 nb); | ||
39 | static int if_usb_get_int_status(struct lbs_private *priv, u8 *); | ||
40 | static int if_usb_read_event_cause(struct lbs_private *); | ||
38 | static int usb_tx_block(struct usb_card_rec *cardp, u8 *payload, u16 nb); | 41 | static int usb_tx_block(struct usb_card_rec *cardp, u8 *payload, u16 nb); |
39 | static void if_usb_free(struct usb_card_rec *cardp); | 42 | static void if_usb_free(struct usb_card_rec *cardp); |
40 | static int if_usb_submit_rx_urb(struct usb_card_rec *cardp); | 43 | static int if_usb_submit_rx_urb(struct usb_card_rec *cardp); |
@@ -52,7 +55,7 @@ static void if_usb_write_bulk_callback(struct urb *urb) | |||
52 | /* handle the transmission complete validations */ | 55 | /* handle the transmission complete validations */ |
53 | 56 | ||
54 | if (urb->status == 0) { | 57 | if (urb->status == 0) { |
55 | lbs_private *priv = cardp->priv; | 58 | struct lbs_private *priv = cardp->priv; |
56 | 59 | ||
57 | /* | 60 | /* |
58 | lbs_deb_usbd(&urb->dev->dev, "URB status is successfull\n"); | 61 | lbs_deb_usbd(&urb->dev->dev, "URB status is successfull\n"); |
@@ -64,7 +67,7 @@ static void if_usb_write_bulk_callback(struct urb *urb) | |||
64 | * valid at firmware load time. | 67 | * valid at firmware load time. |
65 | */ | 68 | */ |
66 | if (priv) { | 69 | if (priv) { |
67 | lbs_adapter *adapter = priv->adapter; | 70 | struct lbs_adapter *adapter = priv->adapter; |
68 | struct net_device *dev = priv->dev; | 71 | struct net_device *dev = priv->dev; |
69 | 72 | ||
70 | priv->dnld_sent = DNLD_RES_RECEIVED; | 73 | priv->dnld_sent = DNLD_RES_RECEIVED; |
@@ -124,7 +127,7 @@ static int if_usb_probe(struct usb_interface *intf, | |||
124 | struct usb_device *udev; | 127 | struct usb_device *udev; |
125 | struct usb_host_interface *iface_desc; | 128 | struct usb_host_interface *iface_desc; |
126 | struct usb_endpoint_descriptor *endpoint; | 129 | struct usb_endpoint_descriptor *endpoint; |
127 | lbs_private *priv; | 130 | struct lbs_private *priv; |
128 | struct usb_card_rec *cardp; | 131 | struct usb_card_rec *cardp; |
129 | int i; | 132 | int i; |
130 | 133 | ||
@@ -259,7 +262,7 @@ error: | |||
259 | static void if_usb_disconnect(struct usb_interface *intf) | 262 | static void if_usb_disconnect(struct usb_interface *intf) |
260 | { | 263 | { |
261 | struct usb_card_rec *cardp = usb_get_intfdata(intf); | 264 | struct usb_card_rec *cardp = usb_get_intfdata(intf); |
262 | lbs_private *priv = (lbs_private *) cardp->priv; | 265 | struct lbs_private *priv = (struct lbs_private *) cardp->priv; |
263 | 266 | ||
264 | lbs_deb_enter(LBS_DEB_MAIN); | 267 | lbs_deb_enter(LBS_DEB_MAIN); |
265 | 268 | ||
@@ -267,7 +270,7 @@ static void if_usb_disconnect(struct usb_interface *intf) | |||
267 | cardp->surprise_removed = 1; | 270 | cardp->surprise_removed = 1; |
268 | 271 | ||
269 | if (priv) { | 272 | if (priv) { |
270 | lbs_adapter *adapter = priv->adapter; | 273 | struct lbs_adapter *adapter = priv->adapter; |
271 | 274 | ||
272 | adapter->surpriseremoved = 1; | 275 | adapter->surpriseremoved = 1; |
273 | lbs_stop_card(priv); | 276 | lbs_stop_card(priv); |
@@ -290,7 +293,7 @@ static void if_usb_disconnect(struct usb_interface *intf) | |||
290 | 293 | ||
291 | /** | 294 | /** |
292 | * @brief This function download FW | 295 | * @brief This function download FW |
293 | * @param priv pointer to lbs_private | 296 | * @param priv pointer to struct lbs_private |
294 | * @return 0 | 297 | * @return 0 |
295 | */ | 298 | */ |
296 | static int if_prog_firmware(struct usb_card_rec *cardp) | 299 | static int if_prog_firmware(struct usb_card_rec *cardp) |
@@ -373,7 +376,7 @@ static int if_prog_firmware(struct usb_card_rec *cardp) | |||
373 | static int if_usb_reset_device(struct usb_card_rec *cardp) | 376 | static int if_usb_reset_device(struct usb_card_rec *cardp) |
374 | { | 377 | { |
375 | int ret; | 378 | int ret; |
376 | lbs_private * priv = cardp->priv; | 379 | struct lbs_private *priv = cardp->priv; |
377 | 380 | ||
378 | lbs_deb_enter(LBS_DEB_USB); | 381 | lbs_deb_enter(LBS_DEB_USB); |
379 | 382 | ||
@@ -394,7 +397,7 @@ static int if_usb_reset_device(struct usb_card_rec *cardp) | |||
394 | 397 | ||
395 | /** | 398 | /** |
396 | * @brief This function transfer the data to the device. | 399 | * @brief This function transfer the data to the device. |
397 | * @param priv pointer to lbs_private | 400 | * @param priv pointer to struct lbs_private |
398 | * @param payload pointer to payload data | 401 | * @param payload pointer to payload data |
399 | * @param nb data length | 402 | * @param nb data length |
400 | * @return 0 or -1 | 403 | * @return 0 or -1 |
@@ -571,7 +574,7 @@ exit: | |||
571 | 574 | ||
572 | static inline void process_cmdtypedata(int recvlength, struct sk_buff *skb, | 575 | static inline void process_cmdtypedata(int recvlength, struct sk_buff *skb, |
573 | struct usb_card_rec *cardp, | 576 | struct usb_card_rec *cardp, |
574 | lbs_private *priv) | 577 | struct lbs_private *priv) |
575 | { | 578 | { |
576 | if (recvlength > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE + | 579 | if (recvlength > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE + |
577 | MESSAGE_HEADER_LEN || recvlength < MRVDRV_MIN_PKT_LEN) { | 580 | MESSAGE_HEADER_LEN || recvlength < MRVDRV_MIN_PKT_LEN) { |
@@ -591,7 +594,7 @@ static inline void process_cmdtypedata(int recvlength, struct sk_buff *skb, | |||
591 | static inline void process_cmdrequest(int recvlength, u8 *recvbuff, | 594 | static inline void process_cmdrequest(int recvlength, u8 *recvbuff, |
592 | struct sk_buff *skb, | 595 | struct sk_buff *skb, |
593 | struct usb_card_rec *cardp, | 596 | struct usb_card_rec *cardp, |
594 | lbs_private *priv) | 597 | struct lbs_private *priv) |
595 | { | 598 | { |
596 | u8 *cmdbuf; | 599 | u8 *cmdbuf; |
597 | if (recvlength > MRVDRV_SIZE_OF_CMD_BUFFER) { | 600 | if (recvlength > MRVDRV_SIZE_OF_CMD_BUFFER) { |
@@ -640,7 +643,7 @@ static void if_usb_receive(struct urb *urb) | |||
640 | struct read_cb_info *rinfo = (struct read_cb_info *)urb->context; | 643 | struct read_cb_info *rinfo = (struct read_cb_info *)urb->context; |
641 | struct sk_buff *skb = rinfo->skb; | 644 | struct sk_buff *skb = rinfo->skb; |
642 | struct usb_card_rec *cardp = (struct usb_card_rec *) rinfo->cardp; | 645 | struct usb_card_rec *cardp = (struct usb_card_rec *) rinfo->cardp; |
643 | lbs_private * priv = cardp->priv; | 646 | struct lbs_private *priv = cardp->priv; |
644 | 647 | ||
645 | int recvlength = urb->actual_length; | 648 | int recvlength = urb->actual_length; |
646 | u8 *recvbuff = NULL; | 649 | u8 *recvbuff = NULL; |
@@ -708,13 +711,16 @@ rx_exit: | |||
708 | 711 | ||
709 | /** | 712 | /** |
710 | * @brief This function downloads data to FW | 713 | * @brief This function downloads data to FW |
711 | * @param priv pointer to lbs_private structure | 714 | * @param priv pointer to struct lbs_private structure |
712 | * @param type type of data | 715 | * @param type type of data |
713 | * @param buf pointer to data buffer | 716 | * @param buf pointer to data buffer |
714 | * @param len number of bytes | 717 | * @param len number of bytes |
715 | * @return 0 or -1 | 718 | * @return 0 or -1 |
716 | */ | 719 | */ |
717 | static int if_usb_host_to_card(lbs_private *priv, u8 type, u8 *payload, u16 nb) | 720 | static int if_usb_host_to_card(struct lbs_private *priv, |
721 | u8 type, | ||
722 | u8 *payload, | ||
723 | u16 nb) | ||
718 | { | 724 | { |
719 | struct usb_card_rec *cardp = (struct usb_card_rec *)priv->card; | 725 | struct usb_card_rec *cardp = (struct usb_card_rec *)priv->card; |
720 | 726 | ||
@@ -741,7 +747,7 @@ static int if_usb_host_to_card(lbs_private *priv, u8 type, u8 *payload, u16 nb) | |||
741 | } | 747 | } |
742 | 748 | ||
743 | /* called with adapter->driver_lock held */ | 749 | /* called with adapter->driver_lock held */ |
744 | static int if_usb_get_int_status(lbs_private *priv, u8 *ireg) | 750 | static int if_usb_get_int_status(struct lbs_private *priv, u8 *ireg) |
745 | { | 751 | { |
746 | struct usb_card_rec *cardp = priv->card; | 752 | struct usb_card_rec *cardp = priv->card; |
747 | 753 | ||
@@ -753,7 +759,7 @@ static int if_usb_get_int_status(lbs_private *priv, u8 *ireg) | |||
753 | return 0; | 759 | return 0; |
754 | } | 760 | } |
755 | 761 | ||
756 | static int if_usb_read_event_cause(lbs_private * priv) | 762 | static int if_usb_read_event_cause(struct lbs_private *priv) |
757 | { | 763 | { |
758 | struct usb_card_rec *cardp = priv->card; | 764 | struct usb_card_rec *cardp = priv->card; |
759 | 765 | ||
@@ -928,7 +934,7 @@ done: | |||
928 | static int if_usb_suspend(struct usb_interface *intf, pm_message_t message) | 934 | static int if_usb_suspend(struct usb_interface *intf, pm_message_t message) |
929 | { | 935 | { |
930 | struct usb_card_rec *cardp = usb_get_intfdata(intf); | 936 | struct usb_card_rec *cardp = usb_get_intfdata(intf); |
931 | lbs_private *priv = cardp->priv; | 937 | struct lbs_private *priv = cardp->priv; |
932 | 938 | ||
933 | lbs_deb_enter(LBS_DEB_USB); | 939 | lbs_deb_enter(LBS_DEB_USB); |
934 | 940 | ||
@@ -964,7 +970,7 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message) | |||
964 | static int if_usb_resume(struct usb_interface *intf) | 970 | static int if_usb_resume(struct usb_interface *intf) |
965 | { | 971 | { |
966 | struct usb_card_rec *cardp = usb_get_intfdata(intf); | 972 | struct usb_card_rec *cardp = usb_get_intfdata(intf); |
967 | lbs_private *priv = cardp->priv; | 973 | struct lbs_private *priv = cardp->priv; |
968 | 974 | ||
969 | lbs_deb_enter(LBS_DEB_USB); | 975 | lbs_deb_enter(LBS_DEB_USB); |
970 | 976 | ||