162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
262306a36Sopenharmony_ci/* Copyright(c) 2018-2019  Realtek Corporation
362306a36Sopenharmony_ci */
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#include <linux/module.h>
662306a36Sopenharmony_ci#include <linux/usb.h>
762306a36Sopenharmony_ci#include "main.h"
862306a36Sopenharmony_ci#include "rtw8822b.h"
962306a36Sopenharmony_ci#include "usb.h"
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_cistatic const struct usb_device_id rtw_8822bu_id_table[] = {
1262306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0xb812, 0xff, 0xff, 0xff),
1362306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) },
1462306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0xb82c, 0xff, 0xff, 0xff),
1562306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) },
1662306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0x2102, 0xff, 0xff, 0xff),
1762306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* CCNC */
1862306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xb822, 0xff, 0xff, 0xff),
1962306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Edimax EW-7822ULC */
2062306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xc822, 0xff, 0xff, 0xff),
2162306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Edimax EW-7822UTC */
2262306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xd822, 0xff, 0xff, 0xff),
2362306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Edimax */
2462306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xe822, 0xff, 0xff, 0xff),
2562306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Edimax */
2662306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xf822, 0xff, 0xff, 0xff),
2762306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Edimax EW-7822UAD */
2862306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0xb81a, 0xff, 0xff, 0xff),
2962306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Default ID */
3062306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x0b05, 0x1841, 0xff, 0xff, 0xff),
3162306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* ASUS AC1300 USB-AC55 B1 */
3262306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x0b05, 0x184c, 0xff, 0xff, 0xff),
3362306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* ASUS U2 */
3462306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x0B05, 0x19aa, 0xff, 0xff, 0xff),
3562306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* ASUS - USB-AC58 rev A1 */
3662306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x0B05, 0x1870, 0xff, 0xff, 0xff),
3762306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* ASUS */
3862306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x0B05, 0x1874, 0xff, 0xff, 0xff),
3962306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* ASUS */
4062306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x331e, 0xff, 0xff, 0xff),
4162306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Dlink - DWA-181 */
4262306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x331c, 0xff, 0xff, 0xff),
4362306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Dlink - DWA-182 - D1 */
4462306a36Sopenharmony_ci	{USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x331f, 0xff, 0xff, 0xff),
4562306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec)}, /* Dlink - DWA-183 D Ver */
4662306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x13b1, 0x0043, 0xff, 0xff, 0xff),
4762306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Linksys WUSB6400M */
4862306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x13b1, 0x0045, 0xff, 0xff, 0xff),
4962306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Linksys WUSB3600 v2 */
5062306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x012d, 0xff, 0xff, 0xff),
5162306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* TP-Link Archer T3U v1 */
5262306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0138, 0xff, 0xff, 0xff),
5362306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* TP-Link Archer T3U Plus v1 */
5462306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0115, 0xff, 0xff, 0xff),
5562306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* TP-Link Archer T4U V3 */
5662306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x012e, 0xff, 0xff, 0xff),
5762306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* TP-LINK */
5862306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0116, 0xff, 0xff, 0xff),
5962306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* TP-LINK */
6062306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0117, 0xff, 0xff, 0xff),
6162306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* TP-LINK */
6262306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x0846, 0x9055, 0xff, 0xff, 0xff),
6362306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Netgear A6150 */
6462306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x0e66, 0x0025, 0xff, 0xff, 0xff),
6562306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Hawking HW12ACU */
6662306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x04ca, 0x8602, 0xff, 0xff, 0xff),
6762306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* LiteOn */
6862306a36Sopenharmony_ci	{ USB_DEVICE_AND_INTERFACE_INFO(0x20f4, 0x808a, 0xff, 0xff, 0xff),
6962306a36Sopenharmony_ci	  .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* TRENDnet TEW-808UBM */
7062306a36Sopenharmony_ci	{},
7162306a36Sopenharmony_ci};
7262306a36Sopenharmony_ciMODULE_DEVICE_TABLE(usb, rtw_8822bu_id_table);
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_cistatic int rtw8822bu_probe(struct usb_interface *intf,
7562306a36Sopenharmony_ci			   const struct usb_device_id *id)
7662306a36Sopenharmony_ci{
7762306a36Sopenharmony_ci	return rtw_usb_probe(intf, id);
7862306a36Sopenharmony_ci}
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_cistatic struct usb_driver rtw_8822bu_driver = {
8162306a36Sopenharmony_ci	.name = "rtw_8822bu",
8262306a36Sopenharmony_ci	.id_table = rtw_8822bu_id_table,
8362306a36Sopenharmony_ci	.probe = rtw8822bu_probe,
8462306a36Sopenharmony_ci	.disconnect = rtw_usb_disconnect,
8562306a36Sopenharmony_ci};
8662306a36Sopenharmony_cimodule_usb_driver(rtw_8822bu_driver);
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ciMODULE_AUTHOR("Realtek Corporation");
8962306a36Sopenharmony_ciMODULE_DESCRIPTION("Realtek 802.11ac wireless 8822bu driver");
9062306a36Sopenharmony_ciMODULE_LICENSE("Dual BSD/GPL");
91