Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2008 Pavel Machek <pavel@suse.cz> |
| 3 | * |
| 4 | * Distribute under GPLv2. |
| 5 | */ |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 6 | #include <net/mac80211.h> |
Pekka Enberg | 80aba53 | 2008-10-30 13:04:29 +0200 | [diff] [blame] | 7 | #include <linux/usb.h> |
| 8 | |
Pekka Enberg | cc18071 | 2008-10-30 16:14:35 +0200 | [diff] [blame] | 9 | #include "core.h" |
Pekka Enberg | 9ce922f | 2008-10-30 13:05:42 +0200 | [diff] [blame] | 10 | #include "mlmetxrx_f.h" |
| 11 | #include "wbhal_f.h" |
| 12 | #include "wblinux_f.h" |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 13 | |
Pekka Enberg | 7b9a79b | 2008-10-30 18:12:01 +0200 | [diff] [blame^] | 14 | MODULE_AUTHOR("Original by: Jeff Lee<YY_Lee@issc.com.tw> Adapted to 2.6.x by Costantino Leandro (Rxart Desktop) <le_costantino@pixartargentina.com.ar>"); |
| 15 | MODULE_DESCRIPTION("IS89C35 802.11bg WLAN USB Driver"); |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 16 | MODULE_LICENSE("GPL"); |
| 17 | MODULE_VERSION("0.1"); |
| 18 | |
Pekka Enberg | dd38da4 | 2008-10-21 13:01:42 +0300 | [diff] [blame] | 19 | static struct usb_device_id wb35_table[] __devinitdata = { |
| 20 | {USB_DEVICE(0x0416, 0x0035)}, |
| 21 | {USB_DEVICE(0x18E8, 0x6201)}, |
| 22 | {USB_DEVICE(0x18E8, 0x6206)}, |
| 23 | {USB_DEVICE(0x18E8, 0x6217)}, |
| 24 | {USB_DEVICE(0x18E8, 0x6230)}, |
| 25 | {USB_DEVICE(0x18E8, 0x6233)}, |
| 26 | {USB_DEVICE(0x1131, 0x2035)}, |
Greg Kroah-Hartman | 68ab0c9 | 2008-10-21 10:41:45 -0700 | [diff] [blame] | 27 | { 0, } |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 28 | }; |
| 29 | |
Pekka Enberg | dd38da4 | 2008-10-21 13:01:42 +0300 | [diff] [blame] | 30 | MODULE_DEVICE_TABLE(usb, wb35_table); |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 31 | |
Greg Kroah-Hartman | 68ab0c9 | 2008-10-21 10:41:45 -0700 | [diff] [blame] | 32 | static struct ieee80211_rate wbsoft_rates[] = { |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 33 | { .bitrate = 10, .flags = IEEE80211_RATE_SHORT_PREAMBLE }, |
| 34 | }; |
| 35 | |
Greg Kroah-Hartman | 68ab0c9 | 2008-10-21 10:41:45 -0700 | [diff] [blame] | 36 | static struct ieee80211_channel wbsoft_channels[] = { |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 37 | { .center_freq = 2412}, |
| 38 | }; |
| 39 | |
Pekka Enberg | a36e089 | 2008-10-28 00:20:03 +0200 | [diff] [blame] | 40 | static struct ieee80211_supported_band wbsoft_band_2GHz = { |
| 41 | .channels = wbsoft_channels, |
| 42 | .n_channels = ARRAY_SIZE(wbsoft_channels), |
| 43 | .bitrates = wbsoft_rates, |
| 44 | .n_bitrates = ARRAY_SIZE(wbsoft_rates), |
| 45 | }; |
| 46 | |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 47 | int wbsoft_enabled; |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 48 | |
| 49 | static int wbsoft_add_interface(struct ieee80211_hw *dev, |
| 50 | struct ieee80211_if_init_conf *conf) |
| 51 | { |
| 52 | printk("wbsoft_add interface called\n"); |
| 53 | return 0; |
| 54 | } |
| 55 | |
| 56 | static void wbsoft_remove_interface(struct ieee80211_hw *dev, |
| 57 | struct ieee80211_if_init_conf *conf) |
| 58 | { |
| 59 | printk("wbsoft_remove interface called\n"); |
| 60 | } |
| 61 | |
Greg Kroah-Hartman | 68ab0c9 | 2008-10-21 10:41:45 -0700 | [diff] [blame] | 62 | static void wbsoft_stop(struct ieee80211_hw *hw) |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 63 | { |
Greg Kroah-Hartman | 68ab0c9 | 2008-10-21 10:41:45 -0700 | [diff] [blame] | 64 | printk(KERN_INFO "%s called\n", __func__); |
| 65 | } |
| 66 | |
| 67 | static int wbsoft_get_stats(struct ieee80211_hw *hw, |
| 68 | struct ieee80211_low_level_stats *stats) |
| 69 | { |
| 70 | printk(KERN_INFO "%s called\n", __func__); |
| 71 | return 0; |
| 72 | } |
| 73 | |
| 74 | static int wbsoft_get_tx_stats(struct ieee80211_hw *hw, |
| 75 | struct ieee80211_tx_queue_stats *stats) |
| 76 | { |
| 77 | printk(KERN_INFO "%s called\n", __func__); |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 78 | return 0; |
| 79 | } |
| 80 | |
| 81 | static void wbsoft_configure_filter(struct ieee80211_hw *dev, |
| 82 | unsigned int changed_flags, |
| 83 | unsigned int *total_flags, |
| 84 | int mc_count, struct dev_mc_list *mclist) |
| 85 | { |
| 86 | unsigned int bit_nr, new_flags; |
| 87 | u32 mc_filter[2]; |
| 88 | int i; |
| 89 | |
| 90 | new_flags = 0; |
| 91 | |
| 92 | if (*total_flags & FIF_PROMISC_IN_BSS) { |
| 93 | new_flags |= FIF_PROMISC_IN_BSS; |
| 94 | mc_filter[1] = mc_filter[0] = ~0; |
| 95 | } else if ((*total_flags & FIF_ALLMULTI) || (mc_count > 32)) { |
| 96 | new_flags |= FIF_ALLMULTI; |
| 97 | mc_filter[1] = mc_filter[0] = ~0; |
| 98 | } else { |
| 99 | mc_filter[1] = mc_filter[0] = 0; |
| 100 | for (i = 0; i < mc_count; i++) { |
| 101 | if (!mclist) |
| 102 | break; |
| 103 | printk("Should call ether_crc here\n"); |
| 104 | //bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; |
| 105 | bit_nr = 0; |
| 106 | |
| 107 | bit_nr &= 0x3F; |
| 108 | mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31); |
| 109 | mclist = mclist->next; |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | dev->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS; |
| 114 | |
| 115 | *total_flags = new_flags; |
| 116 | } |
| 117 | |
Greg Kroah-Hartman | 68ab0c9 | 2008-10-21 10:41:45 -0700 | [diff] [blame] | 118 | static int wbsoft_tx(struct ieee80211_hw *dev, struct sk_buff *skb) |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 119 | { |
Pekka Enberg | cc18071 | 2008-10-30 16:14:35 +0200 | [diff] [blame] | 120 | struct wbsoft_priv *priv = dev->priv; |
| 121 | |
Pekka Enberg | 1e8a2b6 | 2008-10-30 16:14:38 +0200 | [diff] [blame] | 122 | MLMESendFrame(priv, skb->data, skb->len, FRAME_TYPE_802_11_MANAGEMENT); |
Pekka Enberg | 16d3659 | 2008-10-28 00:14:38 +0200 | [diff] [blame] | 123 | |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 124 | return NETDEV_TX_OK; |
| 125 | } |
| 126 | |
| 127 | |
| 128 | static int wbsoft_start(struct ieee80211_hw *dev) |
| 129 | { |
| 130 | wbsoft_enabled = 1; |
| 131 | printk("wbsoft_start called\n"); |
| 132 | return 0; |
| 133 | } |
| 134 | |
| 135 | static int wbsoft_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf) |
| 136 | { |
Pekka Enberg | cc18071 | 2008-10-30 16:14:35 +0200 | [diff] [blame] | 137 | struct wbsoft_priv *priv = dev->priv; |
| 138 | |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 139 | ChanInfo ch; |
| 140 | printk("wbsoft_config called\n"); |
| 141 | |
| 142 | ch.band = 1; |
| 143 | ch.ChanNo = 1; /* Should use channel_num, or something, as that is already pre-translated */ |
| 144 | |
| 145 | |
Pekka Enberg | 1e8a2b6 | 2008-10-30 16:14:38 +0200 | [diff] [blame] | 146 | hal_set_current_channel(&priv->sHwData, ch); |
| 147 | hal_set_beacon_period(&priv->sHwData, conf->beacon_int); |
| 148 | // hal_set_cap_info(&priv->sHwData, ?? ); |
Pekka Enberg | 8b384e0 | 2008-10-21 00:03:41 +0300 | [diff] [blame] | 149 | // hal_set_ssid(phw_data_t pHwData, u8 * pssid, u8 ssid_len); ?? |
Pekka Enberg | 1e8a2b6 | 2008-10-30 16:14:38 +0200 | [diff] [blame] | 150 | hal_set_accept_broadcast(&priv->sHwData, 1); |
| 151 | hal_set_accept_promiscuous(&priv->sHwData, 1); |
| 152 | hal_set_accept_multicast(&priv->sHwData, 1); |
| 153 | hal_set_accept_beacon(&priv->sHwData, 1); |
| 154 | hal_set_radio_mode(&priv->sHwData, 0); |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 155 | //hal_set_antenna_number( phw_data_t pHwData, u8 number ) |
| 156 | //hal_set_rf_power(phw_data_t pHwData, u8 PowerIndex) |
| 157 | |
| 158 | |
Pekka Enberg | 1e8a2b6 | 2008-10-30 16:14:38 +0200 | [diff] [blame] | 159 | // hal_start_bss(&priv->sHwData, WLAN_BSSTYPE_INFRASTRUCTURE); ?? |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 160 | |
Pekka Enberg | 8b384e0 | 2008-10-21 00:03:41 +0300 | [diff] [blame] | 161 | //void hal_set_rates(phw_data_t pHwData, u8 * pbss_rates, |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 162 | // u8 length, unsigned char basic_rate_set) |
| 163 | |
| 164 | return 0; |
| 165 | } |
| 166 | |
| 167 | static int wbsoft_config_interface(struct ieee80211_hw *dev, |
| 168 | struct ieee80211_vif *vif, |
| 169 | struct ieee80211_if_conf *conf) |
| 170 | { |
| 171 | printk("wbsoft_config_interface called\n"); |
| 172 | return 0; |
| 173 | } |
| 174 | |
| 175 | static u64 wbsoft_get_tsf(struct ieee80211_hw *dev) |
| 176 | { |
| 177 | printk("wbsoft_get_tsf called\n"); |
| 178 | return 0; |
| 179 | } |
| 180 | |
| 181 | static const struct ieee80211_ops wbsoft_ops = { |
| 182 | .tx = wbsoft_tx, |
| 183 | .start = wbsoft_start, /* Start can be pretty much empty as we do WbWLanInitialize() during probe? */ |
Greg Kroah-Hartman | 68ab0c9 | 2008-10-21 10:41:45 -0700 | [diff] [blame] | 184 | .stop = wbsoft_stop, |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 185 | .add_interface = wbsoft_add_interface, |
| 186 | .remove_interface = wbsoft_remove_interface, |
| 187 | .config = wbsoft_config, |
| 188 | .config_interface = wbsoft_config_interface, |
| 189 | .configure_filter = wbsoft_configure_filter, |
Greg Kroah-Hartman | 68ab0c9 | 2008-10-21 10:41:45 -0700 | [diff] [blame] | 190 | .get_stats = wbsoft_get_stats, |
| 191 | .get_tx_stats = wbsoft_get_tx_stats, |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 192 | .get_tsf = wbsoft_get_tsf, |
| 193 | // conf_tx: hal_set_cwmin()/hal_set_cwmax; |
| 194 | }; |
| 195 | |
Pekka Enberg | 302bae8 | 2008-10-22 19:05:54 +0300 | [diff] [blame] | 196 | static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id_table) |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 197 | { |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 198 | PWBUSB pWbUsb; |
| 199 | struct usb_host_interface *interface; |
| 200 | struct usb_endpoint_descriptor *endpoint; |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 201 | u32 ltmp; |
| 202 | struct usb_device *udev = interface_to_usbdev(intf); |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 203 | struct wbsoft_priv *priv; |
| 204 | struct ieee80211_hw *dev; |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 205 | int err; |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 206 | |
| 207 | usb_get_dev(udev); |
| 208 | |
Pekka Enberg | dc7e04f | 2008-10-21 12:14:58 +0300 | [diff] [blame] | 209 | // 20060630.2 Check the device if it already be opened |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 210 | err = usb_control_msg(udev, usb_rcvctrlpipe( udev, 0 ), |
Pekka Enberg | dc7e04f | 2008-10-21 12:14:58 +0300 | [diff] [blame] | 211 | 0x01, USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN, |
| 212 | 0x0, 0x400, <mp, 4, HZ*100 ); |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 213 | if (err) |
Pekka Enberg | dc7e04f | 2008-10-21 12:14:58 +0300 | [diff] [blame] | 214 | goto error; |
| 215 | |
| 216 | ltmp = cpu_to_le32(ltmp); |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 217 | if (ltmp) { // Is already initialized? |
| 218 | err = -EBUSY; |
Pekka Enberg | dc7e04f | 2008-10-21 12:14:58 +0300 | [diff] [blame] | 219 | goto error; |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 220 | } |
Pekka Enberg | dc7e04f | 2008-10-21 12:14:58 +0300 | [diff] [blame] | 221 | |
Pekka Enberg | 1e8a2b6 | 2008-10-30 16:14:38 +0200 | [diff] [blame] | 222 | dev = ieee80211_alloc_hw(sizeof(*priv), &wbsoft_ops); |
| 223 | if (!dev) |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 224 | goto error; |
Pekka Enberg | dc7e04f | 2008-10-21 12:14:58 +0300 | [diff] [blame] | 225 | |
Pekka Enberg | 1e8a2b6 | 2008-10-30 16:14:38 +0200 | [diff] [blame] | 226 | priv = dev->priv; |
Pekka Enberg | 1e8a2b6 | 2008-10-30 16:14:38 +0200 | [diff] [blame] | 227 | |
| 228 | pWbUsb = &priv->sHwData.WbUsb; |
Pekka Enberg | dc7e04f | 2008-10-21 12:14:58 +0300 | [diff] [blame] | 229 | pWbUsb->udev = udev; |
| 230 | |
| 231 | interface = intf->cur_altsetting; |
| 232 | endpoint = &interface->endpoint[0].desc; |
| 233 | |
| 234 | if (endpoint[2].wMaxPacketSize == 512) { |
| 235 | printk("[w35und] Working on USB 2.0\n"); |
| 236 | pWbUsb->IsUsb20 = 1; |
| 237 | } |
| 238 | |
Pekka Enberg | 7fff131 | 2008-10-30 16:14:39 +0200 | [diff] [blame] | 239 | if (!WbWLanInitialize(dev)) { |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 240 | err = -EINVAL; |
Pekka Enberg | 1e8a2b6 | 2008-10-30 16:14:38 +0200 | [diff] [blame] | 241 | goto error_free_hw; |
Pekka Enberg | dc7e04f | 2008-10-21 12:14:58 +0300 | [diff] [blame] | 242 | } |
| 243 | |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 244 | SET_IEEE80211_DEV(dev, &udev->dev); |
Pekka Enberg | dc7e04f | 2008-10-21 12:14:58 +0300 | [diff] [blame] | 245 | { |
Pekka Enberg | 1e8a2b6 | 2008-10-30 16:14:38 +0200 | [diff] [blame] | 246 | phw_data_t pHwData = &priv->sHwData; |
Pekka Enberg | 9ce922f | 2008-10-30 13:05:42 +0200 | [diff] [blame] | 247 | unsigned char dev_addr[MAX_ADDR_LEN]; |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 248 | hal_get_permanent_address(pHwData, dev_addr); |
| 249 | SET_IEEE80211_PERM_ADDR(dev, dev_addr); |
Pekka Enberg | dc7e04f | 2008-10-21 12:14:58 +0300 | [diff] [blame] | 250 | } |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 251 | |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 252 | dev->extra_tx_headroom = 12; /* FIXME */ |
| 253 | dev->flags = 0; |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 254 | |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 255 | dev->channel_change_time = 1000; |
| 256 | dev->queues = 1; |
| 257 | |
Pekka Enberg | a36e089 | 2008-10-28 00:20:03 +0200 | [diff] [blame] | 258 | dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &wbsoft_band_2GHz; |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 259 | |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 260 | err = ieee80211_register_hw(dev); |
| 261 | if (err) |
| 262 | goto error_free_hw; |
| 263 | |
Pekka Enberg | 1e8a2b6 | 2008-10-30 16:14:38 +0200 | [diff] [blame] | 264 | usb_set_intfdata(intf, priv); |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 265 | |
Pekka Enberg | dc7e04f | 2008-10-21 12:14:58 +0300 | [diff] [blame] | 266 | return 0; |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 267 | |
| 268 | error_free_hw: |
| 269 | ieee80211_free_hw(dev); |
Pekka Enberg | dc7e04f | 2008-10-21 12:14:58 +0300 | [diff] [blame] | 270 | error: |
Pekka Enberg | 4af12e5 | 2008-10-27 23:29:31 +0200 | [diff] [blame] | 271 | usb_put_dev(udev); |
Pekka Enberg | 1523ddc | 2008-10-22 11:04:23 +0300 | [diff] [blame] | 272 | return err; |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 273 | } |
| 274 | |
Pekka Enberg | 7fff131 | 2008-10-30 16:14:39 +0200 | [diff] [blame] | 275 | void packet_came(struct ieee80211_hw *hw, char *pRxBufferAddress, int PacketSize) |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 276 | { |
| 277 | struct sk_buff *skb; |
| 278 | struct ieee80211_rx_status rx_status = {0}; |
| 279 | |
| 280 | if (!wbsoft_enabled) |
| 281 | return; |
| 282 | |
| 283 | skb = dev_alloc_skb(PacketSize); |
| 284 | if (!skb) { |
| 285 | printk("Not enough memory for packet, FIXME\n"); |
| 286 | return; |
| 287 | } |
| 288 | |
| 289 | memcpy(skb_put(skb, PacketSize), |
| 290 | pRxBufferAddress, |
| 291 | PacketSize); |
| 292 | |
| 293 | /* |
| 294 | rx_status.rate = 10; |
| 295 | rx_status.channel = 1; |
| 296 | rx_status.freq = 12345; |
| 297 | rx_status.phymode = MODE_IEEE80211B; |
| 298 | */ |
| 299 | |
Pekka Enberg | 7fff131 | 2008-10-30 16:14:39 +0200 | [diff] [blame] | 300 | ieee80211_rx_irqsafe(hw, skb, &rx_status); |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 301 | } |
| 302 | |
Pekka Enberg | 302bae8 | 2008-10-22 19:05:54 +0300 | [diff] [blame] | 303 | static void wb35_disconnect(struct usb_interface *intf) |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 304 | { |
Pekka Enberg | 1e8a2b6 | 2008-10-30 16:14:38 +0200 | [diff] [blame] | 305 | struct wbsoft_priv *priv = usb_get_intfdata(intf); |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 306 | |
Pekka Enberg | 1e8a2b6 | 2008-10-30 16:14:38 +0200 | [diff] [blame] | 307 | WbWlanHalt(priv); |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 308 | |
Pekka Enberg | 4af12e5 | 2008-10-27 23:29:31 +0200 | [diff] [blame] | 309 | usb_set_intfdata(intf, NULL); |
| 310 | usb_put_dev(interface_to_usbdev(intf)); |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 311 | } |
| 312 | |
Pekka Enberg | dd38da4 | 2008-10-21 13:01:42 +0300 | [diff] [blame] | 313 | static struct usb_driver wb35_driver = { |
| 314 | .name = "w35und", |
| 315 | .id_table = wb35_table, |
| 316 | .probe = wb35_probe, |
| 317 | .disconnect = wb35_disconnect, |
| 318 | }; |
Pavel Machek | 66101de | 2008-10-01 14:36:56 +0200 | [diff] [blame] | 319 | |
Pekka Enberg | dd38da4 | 2008-10-21 13:01:42 +0300 | [diff] [blame] | 320 | static int __init wb35_init(void) |
| 321 | { |
| 322 | return usb_register(&wb35_driver); |
| 323 | } |
| 324 | |
| 325 | static void __exit wb35_exit(void) |
| 326 | { |
| 327 | usb_deregister(&wb35_driver); |
| 328 | } |
| 329 | |
| 330 | module_init(wb35_init); |
| 331 | module_exit(wb35_exit); |