2 * Copyright (c) 2014 Redpine Signals Inc.
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #include <linux/module.h>
19 #include <net/rsi_91x.h>
24 /* Default operating mode is wlan STA + BT */
25 static u16 dev_oper_mode
= DEV_OPMODE_STA_BT_DUAL
;
26 module_param(dev_oper_mode
, ushort
, 0444);
27 MODULE_PARM_DESC(dev_oper_mode
,
28 "1[Wi-Fi], 4[BT], 8[BT LE], 5[Wi-Fi STA + BT classic]\n"
29 "9[Wi-Fi STA + BT LE], 13[Wi-Fi STA + BT classic + BT LE]\n"
30 "6[AP + BT classic], 14[AP + BT classic + BT LE]");
32 static int rsi_rx_urb_submit(struct rsi_hw
*adapter
, u8 ep_num
);
35 * rsi_usb_card_write() - This function writes to the USB Card.
36 * @adapter: Pointer to the adapter structure.
37 * @buf: Pointer to the buffer from where the data has to be taken.
38 * @len: Length to be written.
39 * @endpoint: Type of endpoint.
41 * Return: status: 0 on success, a negative error code on failure.
43 static int rsi_usb_card_write(struct rsi_hw
*adapter
,
48 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
50 u8
*seg
= dev
->tx_buffer
;
52 int ep
= dev
->bulkout_endpoint_addr
[endpoint
- 1];
54 memset(seg
, 0, len
+ RSI_USB_TX_HEAD_ROOM
);
55 memcpy(seg
+ RSI_USB_TX_HEAD_ROOM
, buf
, len
);
56 len
+= RSI_USB_TX_HEAD_ROOM
;
58 status
= usb_bulk_msg(dev
->usbdev
,
59 usb_sndbulkpipe(dev
->usbdev
, ep
),
67 "Card write failed with error code :%10d\n", status
);
74 * rsi_write_multiple() - This function writes multiple bytes of information
76 * @adapter: Pointer to the adapter structure.
77 * @addr: Address of the register.
78 * @data: Pointer to the data that has to be written.
79 * @count: Number of multiple bytes to be written.
81 * Return: 0 on success, a negative error code on failure.
83 static int rsi_write_multiple(struct rsi_hw
*adapter
,
88 struct rsi_91x_usbdev
*dev
;
96 dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
100 return rsi_usb_card_write(adapter
, data
, count
, endpoint
);
104 * rsi_find_bulk_in_and_out_endpoints() - This function initializes the bulk
105 * endpoints to the device.
106 * @interface: Pointer to the USB interface structure.
107 * @adapter: Pointer to the adapter structure.
109 * Return: ret_val: 0 on success, -ENOMEM on failure.
111 static int rsi_find_bulk_in_and_out_endpoints(struct usb_interface
*interface
,
112 struct rsi_hw
*adapter
)
114 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
115 struct usb_host_interface
*iface_desc
;
116 struct usb_endpoint_descriptor
*endpoint
;
118 int ii
, bin_found
= 0, bout_found
= 0;
120 iface_desc
= &(interface
->altsetting
[0]);
122 for (ii
= 0; ii
< iface_desc
->desc
.bNumEndpoints
; ++ii
) {
123 endpoint
= &(iface_desc
->endpoint
[ii
].desc
);
125 if (!dev
->bulkin_endpoint_addr
[bin_found
] &&
126 (endpoint
->bEndpointAddress
& USB_DIR_IN
) &&
127 ((endpoint
->bmAttributes
& USB_ENDPOINT_XFERTYPE_MASK
) ==
128 USB_ENDPOINT_XFER_BULK
)) {
129 buffer_size
= endpoint
->wMaxPacketSize
;
130 dev
->bulkin_size
[bin_found
] = buffer_size
;
131 dev
->bulkin_endpoint_addr
[bin_found
] =
132 endpoint
->bEndpointAddress
;
136 if (!dev
->bulkout_endpoint_addr
[bout_found
] &&
137 !(endpoint
->bEndpointAddress
& USB_DIR_IN
) &&
138 ((endpoint
->bmAttributes
& USB_ENDPOINT_XFERTYPE_MASK
) ==
139 USB_ENDPOINT_XFER_BULK
)) {
140 buffer_size
= endpoint
->wMaxPacketSize
;
141 dev
->bulkout_endpoint_addr
[bout_found
] =
142 endpoint
->bEndpointAddress
;
143 dev
->bulkout_size
[bout_found
] = buffer_size
;
147 if (bin_found
>= MAX_BULK_EP
|| bout_found
>= MAX_BULK_EP
)
151 if (!(dev
->bulkin_endpoint_addr
[0]) &&
152 dev
->bulkout_endpoint_addr
[0])
158 #define RSI_USB_REQ_OUT (USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE)
159 #define RSI_USB_REQ_IN (USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_DEVICE)
161 /* rsi_usb_reg_read() - This function reads data from given register address.
162 * @usbdev: Pointer to the usb_device structure.
163 * @reg: Address of the register to be read.
164 * @value: Value to be read.
165 * @len: length of data to be read.
167 * Return: status: 0 on success, a negative error code on failure.
169 static int rsi_usb_reg_read(struct usb_device
*usbdev
,
175 int status
= -ENOMEM
;
177 if (len
> RSI_USB_CTRL_BUF_SIZE
)
180 buf
= kmalloc(RSI_USB_CTRL_BUF_SIZE
, GFP_KERNEL
);
184 status
= usb_control_msg(usbdev
,
185 usb_rcvctrlpipe(usbdev
, 0),
186 USB_VENDOR_REGISTER_READ
,
188 ((reg
& 0xffff0000) >> 16), (reg
& 0xffff),
191 USB_CTRL_GET_TIMEOUT
);
193 *value
= (buf
[0] | (buf
[1] << 8));
196 "%s: Reg read failed with error code :%d\n",
205 * rsi_usb_reg_write() - This function writes the given data into the given
207 * @usbdev: Pointer to the usb_device structure.
208 * @reg: Address of the register.
209 * @value: Value to write.
210 * @len: Length of data to be written.
212 * Return: status: 0 on success, a negative error code on failure.
214 static int rsi_usb_reg_write(struct usb_device
*usbdev
,
220 int status
= -ENOMEM
;
222 if (len
> RSI_USB_CTRL_BUF_SIZE
)
225 usb_reg_buf
= kmalloc(RSI_USB_CTRL_BUF_SIZE
, GFP_KERNEL
);
229 usb_reg_buf
[0] = (value
& 0x00ff);
230 usb_reg_buf
[1] = (value
& 0xff00) >> 8;
231 usb_reg_buf
[2] = 0x0;
232 usb_reg_buf
[3] = 0x0;
234 status
= usb_control_msg(usbdev
,
235 usb_sndctrlpipe(usbdev
, 0),
236 USB_VENDOR_REGISTER_WRITE
,
238 ((reg
& 0xffff0000) >> 16),
242 USB_CTRL_SET_TIMEOUT
);
245 "%s: Reg write failed with error code :%d\n",
254 * rsi_rx_done_handler() - This function is called when a packet is received
255 * from USB stack. This is callback to recieve done.
256 * @urb: Received URB.
260 static void rsi_rx_done_handler(struct urb
*urb
)
262 struct rx_usb_ctrl_block
*rx_cb
= urb
->context
;
263 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)rx_cb
->data
;
264 int status
= -EINVAL
;
269 if (urb
->actual_length
<= 0) {
270 rsi_dbg(INFO_ZONE
, "%s: Zero length packet\n", __func__
);
273 if (skb_queue_len(&dev
->rx_q
) >= RSI_MAX_RX_PKTS
) {
274 rsi_dbg(INFO_ZONE
, "Max RX packets reached\n");
277 skb_put(rx_cb
->rx_skb
, urb
->actual_length
);
278 skb_queue_tail(&dev
->rx_q
, rx_cb
->rx_skb
);
280 rsi_set_event(&dev
->rx_thread
.event
);
284 if (rsi_rx_urb_submit(dev
->priv
, rx_cb
->ep_num
))
285 rsi_dbg(ERR_ZONE
, "%s: Failed in urb submission", __func__
);
288 dev_kfree_skb(rx_cb
->rx_skb
);
292 * rsi_rx_urb_submit() - This function submits the given URB to the USB stack.
293 * @adapter: Pointer to the adapter structure.
295 * Return: 0 on success, a negative error code on failure.
297 static int rsi_rx_urb_submit(struct rsi_hw
*adapter
, u8 ep_num
)
299 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
300 struct rx_usb_ctrl_block
*rx_cb
= &dev
->rx_cb
[ep_num
- 1];
301 struct urb
*urb
= rx_cb
->rx_urb
;
304 u8 dword_align_bytes
= 0;
306 #define RSI_MAX_RX_USB_PKT_SIZE 3000
307 skb
= dev_alloc_skb(RSI_MAX_RX_USB_PKT_SIZE
);
310 skb_reserve(skb
, MAX_DWORD_ALIGN_BYTES
);
311 dword_align_bytes
= (unsigned long)skb
->data
& 0x3f;
312 if (dword_align_bytes
> 0)
313 skb_push(skb
, dword_align_bytes
);
314 urb
->transfer_buffer
= skb
->data
;
317 usb_fill_bulk_urb(urb
,
319 usb_rcvbulkpipe(dev
->usbdev
,
320 dev
->bulkin_endpoint_addr
[ep_num
- 1]),
321 urb
->transfer_buffer
,
322 RSI_MAX_RX_USB_PKT_SIZE
,
326 status
= usb_submit_urb(urb
, GFP_KERNEL
);
328 rsi_dbg(ERR_ZONE
, "%s: Failed in urb submission\n", __func__
);
333 static int rsi_usb_read_register_multiple(struct rsi_hw
*adapter
, u32 addr
,
336 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
344 buf
= kzalloc(RSI_USB_BUF_SIZE
, GFP_KERNEL
);
349 transfer
= min_t(u16
, count
, RSI_USB_BUF_SIZE
);
350 status
= usb_control_msg(dev
->usbdev
,
351 usb_rcvctrlpipe(dev
->usbdev
, 0),
352 USB_VENDOR_REGISTER_READ
,
354 ((addr
& 0xffff0000) >> 16),
355 (addr
& 0xffff), (void *)buf
,
356 transfer
, USB_CTRL_GET_TIMEOUT
);
359 "Reg read failed with error code :%d\n",
364 memcpy(data
, buf
, transfer
);
374 * rsi_usb_write_register_multiple() - This function writes multiple bytes of
375 * information to multiple registers.
376 * @adapter: Pointer to the adapter structure.
377 * @addr: Address of the register.
378 * @data: Pointer to the data that has to be written.
379 * @count: Number of multiple bytes to be written on to the registers.
381 * Return: status: 0 on success, a negative error code on failure.
383 static int rsi_usb_write_register_multiple(struct rsi_hw
*adapter
, u32 addr
,
386 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
391 buf
= kzalloc(RSI_USB_BUF_SIZE
, GFP_KERNEL
);
396 transfer
= min_t(u16
, count
, RSI_USB_BUF_SIZE
);
397 memcpy(buf
, data
, transfer
);
398 status
= usb_control_msg(dev
->usbdev
,
399 usb_sndctrlpipe(dev
->usbdev
, 0),
400 USB_VENDOR_REGISTER_WRITE
,
402 ((addr
& 0xffff0000) >> 16),
406 USB_CTRL_SET_TIMEOUT
);
409 "Reg write failed with error code :%d\n",
424 *rsi_usb_host_intf_write_pkt() - This function writes the packet to the
426 * @adapter: Pointer to the adapter structure.
427 * @pkt: Pointer to the data to be written on to the card.
428 * @len: Length of the data to be written on to the card.
430 * Return: 0 on success, a negative error code on failure.
432 static int rsi_usb_host_intf_write_pkt(struct rsi_hw
*adapter
,
436 u32 queueno
= ((pkt
[1] >> 4) & 0x7);
439 endpoint
= ((queueno
== RSI_WIFI_MGMT_Q
|| queueno
== RSI_WIFI_DATA_Q
||
440 queueno
== RSI_COEX_Q
) ? WLAN_EP
: BT_EP
);
442 return rsi_write_multiple(adapter
,
448 static int rsi_usb_master_reg_read(struct rsi_hw
*adapter
, u32 reg
,
451 struct usb_device
*usbdev
=
452 ((struct rsi_91x_usbdev
*)adapter
->rsi_dev
)->usbdev
;
456 ret
= rsi_usb_reg_read(usbdev
, reg
, &temp
, len
);
464 static int rsi_usb_master_reg_write(struct rsi_hw
*adapter
,
466 unsigned long value
, u16 len
)
468 struct usb_device
*usbdev
=
469 ((struct rsi_91x_usbdev
*)adapter
->rsi_dev
)->usbdev
;
471 return rsi_usb_reg_write(usbdev
, reg
, value
, len
);
474 static int rsi_usb_load_data_master_write(struct rsi_hw
*adapter
,
476 u32 instructions_sz
, u16 block_size
,
484 num_blocks
= instructions_sz
/ block_size
;
485 rsi_dbg(INFO_ZONE
, "num_blocks: %d\n", num_blocks
);
487 for (cur_indx
= 0, i
= 0; i
< num_blocks
; i
++, cur_indx
+= block_size
) {
488 memcpy(temp_buf
, ta_firmware
+ cur_indx
, block_size
);
489 status
= rsi_usb_write_register_multiple(adapter
, base_address
,
495 rsi_dbg(INFO_ZONE
, "%s: loading block: %d\n", __func__
, i
);
496 base_address
+= block_size
;
499 if (instructions_sz
% block_size
) {
500 memset(temp_buf
, 0, block_size
);
501 memcpy(temp_buf
, ta_firmware
+ cur_indx
,
502 instructions_sz
% block_size
);
503 status
= rsi_usb_write_register_multiple
504 (adapter
, base_address
,
506 instructions_sz
% block_size
);
510 "Written Last Block in Address 0x%x Successfully\n",
516 static struct rsi_host_intf_ops usb_host_intf_ops
= {
517 .write_pkt
= rsi_usb_host_intf_write_pkt
,
518 .read_reg_multiple
= rsi_usb_read_register_multiple
,
519 .write_reg_multiple
= rsi_usb_write_register_multiple
,
520 .master_reg_read
= rsi_usb_master_reg_read
,
521 .master_reg_write
= rsi_usb_master_reg_write
,
522 .load_data_master_write
= rsi_usb_load_data_master_write
,
526 * rsi_deinit_usb_interface() - This function deinitializes the usb interface.
527 * @adapter: Pointer to the adapter structure.
531 static void rsi_deinit_usb_interface(struct rsi_hw
*adapter
)
533 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
535 rsi_kill_thread(&dev
->rx_thread
);
537 usb_free_urb(dev
->rx_cb
[0].rx_urb
);
538 if (adapter
->priv
->coex_mode
> 1)
539 usb_free_urb(dev
->rx_cb
[1].rx_urb
);
541 kfree(dev
->tx_buffer
);
544 static int rsi_usb_init_rx(struct rsi_hw
*adapter
)
546 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
547 struct rx_usb_ctrl_block
*rx_cb
;
550 num_rx_cb
= (adapter
->priv
->coex_mode
> 1 ? 2 : 1);
552 for (idx
= 0; idx
< num_rx_cb
; idx
++) {
553 rx_cb
= &dev
->rx_cb
[idx
];
555 rx_cb
->rx_urb
= usb_alloc_urb(0, GFP_KERNEL
);
556 if (!rx_cb
->rx_urb
) {
557 rsi_dbg(ERR_ZONE
, "Failed alloc rx urb[%d]\n", idx
);
560 rx_cb
->ep_num
= idx
+ 1;
561 rx_cb
->data
= (void *)dev
;
563 skb_queue_head_init(&dev
->rx_q
);
564 rsi_init_event(&dev
->rx_thread
.event
);
565 if (rsi_create_kthread(adapter
->priv
, &dev
->rx_thread
,
566 rsi_usb_rx_thread
, "RX-Thread")) {
567 rsi_dbg(ERR_ZONE
, "%s: Unable to init rx thrd\n", __func__
);
574 usb_free_urb(dev
->rx_cb
[0].rx_urb
);
575 if (adapter
->priv
->coex_mode
> 1)
576 usb_free_urb(dev
->rx_cb
[1].rx_urb
);
582 * rsi_init_usb_interface() - This function initializes the usb interface.
583 * @adapter: Pointer to the adapter structure.
584 * @pfunction: Pointer to USB interface structure.
586 * Return: 0 on success, a negative error code on failure.
588 static int rsi_init_usb_interface(struct rsi_hw
*adapter
,
589 struct usb_interface
*pfunction
)
591 struct rsi_91x_usbdev
*rsi_dev
;
594 rsi_dev
= kzalloc(sizeof(*rsi_dev
), GFP_KERNEL
);
598 adapter
->rsi_dev
= rsi_dev
;
599 rsi_dev
->usbdev
= interface_to_usbdev(pfunction
);
600 rsi_dev
->priv
= (void *)adapter
;
602 if (rsi_find_bulk_in_and_out_endpoints(pfunction
, adapter
)) {
607 adapter
->device
= &pfunction
->dev
;
608 usb_set_intfdata(pfunction
, adapter
);
610 rsi_dev
->tx_buffer
= kmalloc(2048, GFP_KERNEL
);
611 if (!rsi_dev
->tx_buffer
) {
616 if (rsi_usb_init_rx(adapter
)) {
617 rsi_dbg(ERR_ZONE
, "Failed to init RX handle\n");
622 rsi_dev
->tx_blk_size
= 252;
623 adapter
->block_size
= rsi_dev
->tx_blk_size
;
625 /* Initializing function callbacks */
626 adapter
->check_hw_queue_status
= rsi_usb_check_queue_status
;
627 adapter
->determine_event_timeout
= rsi_usb_event_timeout
;
628 adapter
->rsi_host_intf
= RSI_HOST_INTF_USB
;
629 adapter
->host_intf_ops
= &usb_host_intf_ops
;
631 #ifdef CONFIG_RSI_DEBUGFS
632 /* In USB, one less than the MAX_DEBUGFS_ENTRIES entries is required */
633 adapter
->num_debugfs_entries
= (MAX_DEBUGFS_ENTRIES
- 1);
636 rsi_dbg(INIT_ZONE
, "%s: Enabled the interface\n", __func__
);
640 kfree(rsi_dev
->tx_buffer
);
648 static int usb_ulp_read_write(struct rsi_hw
*adapter
, u16 addr
, u32 data
,
653 ret
= rsi_usb_master_reg_write
654 (adapter
, RSI_GSPI_DATA_REG1
,
655 ((addr
<< 6) | ((data
>> 16) & 0xffff)), 2);
659 ret
= rsi_usb_master_reg_write(adapter
, RSI_GSPI_DATA_REG0
,
664 /* Initializing GSPI for ULP read/writes */
665 rsi_usb_master_reg_write(adapter
, RSI_GSPI_CTRL_REG0
,
666 RSI_GSPI_CTRL_REG0_VALUE
, 2);
668 ret
= rsi_usb_master_reg_write(adapter
, RSI_GSPI_CTRL_REG1
,
669 ((len_in_bits
- 1) | RSI_GSPI_TRIG
), 2);
678 static int rsi_reset_card(struct rsi_hw
*adapter
)
682 rsi_dbg(INFO_ZONE
, "Resetting Card...\n");
683 rsi_usb_master_reg_write(adapter
, RSI_TA_HOLD_REG
, 0xE, 4);
685 /* This msleep will ensure Thread-Arch processor to go to hold
686 * and any pending dma transfers to rf in device to finish.
690 ret
= rsi_usb_master_reg_write(adapter
, SWBL_REGOUT
,
691 RSI_FW_WDT_DISABLE_REQ
,
692 RSI_COMMON_REG_SIZE
);
694 rsi_dbg(ERR_ZONE
, "Disabling firmware watchdog timer failed\n");
698 ret
= usb_ulp_read_write(adapter
, RSI_WATCH_DOG_TIMER_1
,
699 RSI_ULP_WRITE_2
, 32);
702 ret
= usb_ulp_read_write(adapter
, RSI_WATCH_DOG_TIMER_2
,
703 RSI_ULP_WRITE_0
, 32);
706 ret
= usb_ulp_read_write(adapter
, RSI_WATCH_DOG_DELAY_TIMER_1
,
707 RSI_ULP_WRITE_50
, 32);
710 ret
= usb_ulp_read_write(adapter
, RSI_WATCH_DOG_DELAY_TIMER_2
,
711 RSI_ULP_WRITE_0
, 32);
714 ret
= usb_ulp_read_write(adapter
, RSI_WATCH_DOG_TIMER_ENABLE
,
715 RSI_ULP_TIMER_ENABLE
, 32);
719 rsi_dbg(INFO_ZONE
, "Reset card done\n");
723 rsi_dbg(ERR_ZONE
, "Reset card failed\n");
728 * rsi_probe() - This function is called by kernel when the driver provided
729 * Vendor and device IDs are matched. All the initialization
731 * @pfunction: Pointer to the USB interface structure.
732 * @id: Pointer to the usb_device_id structure.
734 * Return: 0 on success, a negative error code on failure.
736 static int rsi_probe(struct usb_interface
*pfunction
,
737 const struct usb_device_id
*id
)
739 struct rsi_hw
*adapter
;
740 struct rsi_91x_usbdev
*dev
;
744 rsi_dbg(INIT_ZONE
, "%s: Init function called\n", __func__
);
746 adapter
= rsi_91x_init(dev_oper_mode
);
748 rsi_dbg(ERR_ZONE
, "%s: Failed to init os intf ops\n",
752 adapter
->rsi_host_intf
= RSI_HOST_INTF_USB
;
754 status
= rsi_init_usb_interface(adapter
, pfunction
);
756 rsi_dbg(ERR_ZONE
, "%s: Failed to init usb interface\n",
761 rsi_dbg(ERR_ZONE
, "%s: Initialized os intf ops\n", __func__
);
763 dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
765 status
= rsi_usb_reg_read(dev
->usbdev
, FW_STATUS_REG
, &fw_status
, 2);
772 rsi_dbg(INIT_ZONE
, "Loading firmware...\n");
773 status
= rsi_hal_device_init(adapter
);
775 rsi_dbg(ERR_ZONE
, "%s: Failed in device init\n",
779 rsi_dbg(INIT_ZONE
, "%s: Device Init Done\n", __func__
);
782 status
= rsi_rx_urb_submit(adapter
, WLAN_EP
);
786 if (adapter
->priv
->coex_mode
> 1) {
787 status
= rsi_rx_urb_submit(adapter
, BT_EP
);
794 rsi_deinit_usb_interface(adapter
);
796 rsi_91x_deinit(adapter
);
797 rsi_dbg(ERR_ZONE
, "%s: Failed in probe...Exiting\n", __func__
);
802 * rsi_disconnect() - This function performs the reverse of the probe function,
803 * it deinitialize the driver structure.
804 * @pfunction: Pointer to the USB interface structure.
808 static void rsi_disconnect(struct usb_interface
*pfunction
)
810 struct rsi_hw
*adapter
= usb_get_intfdata(pfunction
);
815 rsi_mac80211_detach(adapter
);
816 rsi_reset_card(adapter
);
817 rsi_deinit_usb_interface(adapter
);
818 rsi_91x_deinit(adapter
);
820 rsi_dbg(INFO_ZONE
, "%s: Deinitialization completed\n", __func__
);
824 static int rsi_suspend(struct usb_interface
*intf
, pm_message_t message
)
826 /* Not yet implemented */
830 static int rsi_resume(struct usb_interface
*intf
)
832 /* Not yet implemented */
837 static const struct usb_device_id rsi_dev_table
[] = {
838 { USB_DEVICE(0x0303, 0x0100) },
839 { USB_DEVICE(0x041B, 0x0301) },
840 { USB_DEVICE(0x041B, 0x0201) },
841 { USB_DEVICE(0x041B, 0x9330) },
842 { USB_DEVICE(0x1618, 0x9113) },
846 static struct usb_driver rsi_driver
= {
847 .name
= "RSI-USB WLAN",
849 .disconnect
= rsi_disconnect
,
850 .id_table
= rsi_dev_table
,
852 .suspend
= rsi_suspend
,
853 .resume
= rsi_resume
,
857 module_usb_driver(rsi_driver
);
859 MODULE_AUTHOR("Redpine Signals Inc");
860 MODULE_DESCRIPTION("Common USB layer for RSI drivers");
861 MODULE_SUPPORTED_DEVICE("RSI-91x");
862 MODULE_DEVICE_TABLE(usb
, rsi_dev_table
);
863 MODULE_FIRMWARE(FIRMWARE_RSI9113
);
864 MODULE_VERSION("0.1");
865 MODULE_LICENSE("Dual BSD/GPL");