aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/winbond/wbusb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/winbond/wbusb.c')
-rw-r--r--drivers/staging/winbond/wbusb.c50
1 files changed, 10 insertions, 40 deletions
diff --git a/drivers/staging/winbond/wbusb.c b/drivers/staging/winbond/wbusb.c
index 3f60cf7e6ec..2163d60c2ea 100644
--- a/drivers/staging/winbond/wbusb.c
+++ b/drivers/staging/winbond/wbusb.c
@@ -14,10 +14,11 @@
14 14
15#include "core.h" 15#include "core.h"
16#include "mds_f.h" 16#include "mds_f.h"
17#include "mlmetxrx_f.h"
18#include "mto.h" 17#include "mto.h"
19#include "wbhal_f.h" 18#include "wbhal.h"
20#include "wblinux_f.h" 19#include "wb35reg_f.h"
20#include "wb35tx_f.h"
21#include "wb35rx_f.h"
21 22
22MODULE_DESCRIPTION("IS89C35 802.11bg WLAN USB Driver"); 23MODULE_DESCRIPTION("IS89C35 802.11bg WLAN USB Driver");
23MODULE_LICENSE("GPL"); 24MODULE_LICENSE("GPL");
@@ -181,10 +182,7 @@ static void hal_set_current_channel_ex(struct hw_data *pHwData, struct chan_info
181 RFSynthesizer_SwitchingChannel(pHwData, channel); /* Switch channel */ 182 RFSynthesizer_SwitchingChannel(pHwData, channel); /* Switch channel */
182 pHwData->Channel = channel.ChanNo; 183 pHwData->Channel = channel.ChanNo;
183 pHwData->band = channel.band; 184 pHwData->band = channel.band;
184#ifdef _PE_STATE_DUMP_ 185 pr_debug("Set channel is %d, band =%d\n", pHwData->Channel, pHwData->band);
185 printk("Set channel is %d, band =%d\n", pHwData->Channel,
186 pHwData->band);
187#endif
188 reg->M28_MacControl &= ~0xff; /* Clean channel information field */ 186 reg->M28_MacControl &= ~0xff; /* Clean channel information field */
189 reg->M28_MacControl |= channel.ChanNo; 187 reg->M28_MacControl |= channel.ChanNo;
190 Wb35Reg_WriteWithCallbackValue(pHwData, 0x0828, reg->M28_MacControl, 188 Wb35Reg_WriteWithCallbackValue(pHwData, 0x0828, reg->M28_MacControl,
@@ -339,10 +337,8 @@ static void hal_stop(struct hw_data *pHwData)
339static unsigned char hal_idle(struct hw_data *pHwData) 337static unsigned char hal_idle(struct hw_data *pHwData)
340{ 338{
341 struct wb35_reg *reg = &pHwData->reg; 339 struct wb35_reg *reg = &pHwData->reg;
342 struct wb_usb *pWbUsb = &pHwData->WbUsb;
343 340
344 if (!pHwData->SurpriseRemove 341 if (!pHwData->SurpriseRemove && reg->EP0vm_state != VM_STOP)
345 && (pWbUsb->DetectCount || reg->EP0vm_state != VM_STOP))
346 return false; 342 return false;
347 343
348 return true; 344 return true;
@@ -608,15 +604,6 @@ static void hal_led_control(unsigned long data)
608 } 604 }
609 break; 605 break;
610 } 606 }
611
612 /* Active send null packet to avoid AP disconnect */
613 if (pHwData->LED_LinkOn) {
614 pHwData->NullPacketCount += TimeInterval;
615 if (pHwData->NullPacketCount >=
616 DEFAULT_NULL_PACKET_COUNT) {
617 pHwData->NullPacketCount = 0;
618 }
619 }
620 } 607 }
621 608
622 pHwData->time_count += TimeInterval; 609 pHwData->time_count += TimeInterval;
@@ -651,13 +638,6 @@ static int hal_init_hardware(struct ieee80211_hw *hw)
651 638
652 SoftwareSet = hal_software_set(pHwData); 639 SoftwareSet = hal_software_set(pHwData);
653 640
654#ifdef Vendor2
655 /* Try to make sure the EEPROM contain */
656 SoftwareSet >>= 8;
657 if (SoftwareSet != 0x82)
658 return false;
659#endif
660
661 Wb35Rx_start(hw); 641 Wb35Rx_start(hw);
662 Wb35Tx_EP2VM_start(priv); 642 Wb35Tx_EP2VM_start(priv);
663 643
@@ -734,9 +714,7 @@ static int wb35_hw_init(struct ieee80211_hw *hw)
734 } 714 }
735 715
736 priv->sLocalPara.bAntennaNo = hal_get_antenna_number(pHwData); 716 priv->sLocalPara.bAntennaNo = hal_get_antenna_number(pHwData);
737#ifdef _PE_STATE_DUMP_ 717 pr_debug("Driver init, antenna no = %d\n", priv->sLocalPara.bAntennaNo);
738 printk("Driver init, antenna no = %d\n", psLOCAL->bAntennaNo);
739#endif
740 hal_get_hw_radio_off(pHwData); 718 hal_get_hw_radio_off(pHwData);
741 719
742 /* Waiting for HAL setting OK */ 720 /* Waiting for HAL setting OK */
@@ -769,7 +747,6 @@ static int wb35_probe(struct usb_interface *intf,
769 struct usb_host_interface *interface; 747 struct usb_host_interface *interface;
770 struct ieee80211_hw *dev; 748 struct ieee80211_hw *dev;
771 struct wbsoft_priv *priv; 749 struct wbsoft_priv *priv;
772 struct wb_usb *pWbUsb;
773 int nr, err; 750 int nr, err;
774 u32 ltmp; 751 u32 ltmp;
775 752
@@ -800,16 +777,13 @@ static int wb35_probe(struct usb_interface *intf,
800 777
801 priv = dev->priv; 778 priv = dev->priv;
802 779
803 pWbUsb = &priv->sHwData.WbUsb; 780 priv->sHwData.udev = udev;
804 pWbUsb->udev = udev;
805 781
806 interface = intf->cur_altsetting; 782 interface = intf->cur_altsetting;
807 endpoint = &interface->endpoint[0].desc; 783 endpoint = &interface->endpoint[0].desc;
808 784
809 if (endpoint[2].wMaxPacketSize == 512) { 785 if (endpoint[2].wMaxPacketSize == 512)
810 printk("[w35und] Working on USB 2.0\n"); 786 printk("[w35und] Working on USB 2.0\n");
811 pWbUsb->IsUsb20 = 1;
812 }
813 787
814 err = wb35_hw_init(dev); 788 err = wb35_hw_init(dev);
815 if (err) 789 if (err)
@@ -860,13 +834,9 @@ static void hal_halt(struct hw_data *pHwData)
860 834
861static void wb35_hw_halt(struct wbsoft_priv *adapter) 835static void wb35_hw_halt(struct wbsoft_priv *adapter)
862{ 836{
863 Mds_Destroy(adapter);
864
865 /* Turn off Rx and Tx hardware ability */ 837 /* Turn off Rx and Tx hardware ability */
866 hal_stop(&adapter->sHwData); 838 hal_stop(&adapter->sHwData);
867#ifdef _PE_USB_INI_DUMP_ 839 pr_debug("[w35und] Hal_stop O.K.\n");
868 printk("[w35und] Hal_stop O.K.\n");
869#endif
870 /* Waiting Irp completed */ 840 /* Waiting Irp completed */
871 msleep(100); 841 msleep(100);
872 842