Code:
#define RT2870_USB_DEVICES \
{ \
{USB_DEVICE(0x148F,0x2770)}, /* Ralink */ \
{USB_DEVICE(0x148F,0x2870)}, /* Ralink */ \
{USB_DEVICE(0x0B05,0x1731)}, /* Asus */ \
{USB_DEVICE(0x0B05,0x1732)}, /* Asus */ \
{USB_DEVICE(0x0B05,0x1742)}, /* Asus */ \
{USB_DEVICE(0x0DF6,0x0017)}, /* Sitecom */ \
{USB_DEVICE(0x0DF6,0x002B)}, /* Sitecom */ \
{USB_DEVICE(0x0DF6,0x002C)}, /* Sitecom */ \
{USB_DEVICE(0x0DF6,0x002D)}, /* Sitecom */ \
{USB_DEVICE(0x14B2,0x3C06)}, /* Conceptronic */ \
{USB_DEVICE(0x14B2,0x3C28)}, /* Conceptronic */ \
{USB_DEVICE(0x2019,0xED06)}, /* Planex Communications, Inc. */ \
{USB_DEVICE(0x07D1,0x3C09)}, /* D-Link */ \
{USB_DEVICE(0x14B2,0x3C07)}, /* AL */ \
{USB_DEVICE(0x050D,0x8053)}, /* Belkin */ \
{USB_DEVICE(0x14B2,0x3C23)}, /* Airlink */ \
{USB_DEVICE(0x14B2,0x3C27)}, /* Airlink */ \
{USB_DEVICE(0x07AA,0x002F)}, /* Corega */ \
{USB_DEVICE(0x07AA,0x003C)}, /* Corega */ \
{USB_DEVICE(0x07AA,0x003F)}, /* Corega */ \
{USB_DEVICE(0x1044,0x800B)}, /* Gigabyte */ \
{USB_DEVICE(0x15A9,0x0006)}, /* Sparklan */ \
{USB_DEVICE(0x083A,0xB522)}, /* SMC */ \
{USB_DEVICE(0x083A,0xA618)}, /* SMC */ \
{USB_DEVICE(0x083A,0x7522)}, /* Arcadyan */ \
{USB_DEVICE(0x0CDE,0x0022)}, /* ZCOM */ \
{USB_DEVICE(0x0586,0x3416)}, /* Zyxel */ \
{USB_DEVICE(0x0CDE,0x0025)}, /* Zyxel */ \
{USB_DEVICE(0x1740,0x9701)}, /* EnGenius */ \
{USB_DEVICE(0x1740,0x9702)}, /* EnGenius */ \
{USB_DEVICE(0x0471,0x200f)}, /* Philips */ \
{USB_DEVICE(0x14B2,0x3C25)}, /* Draytek */ \
{USB_DEVICE(0x13D3,0x3247)}, /* AzureWave */ \
{USB_DEVICE(0x083A,0x6618)}, /* Accton */ \
{USB_DEVICE(0x15c5,0x0008)}, /* Amit */ \
{USB_DEVICE(0x0E66,0x0001)}, /* Hawking */ \
{USB_DEVICE(0x0E66,0x0003)}, /* Hawking */ \
{USB_DEVICE(0x129B,0x1828)}, /* Siemens */ \
{NULL} \
}
STEP 2:
Code:
static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER pAd)
{
NDIS_STATUS Status;
INT i=0;
CHAR slot_name[IFNAMSIZ];
struct net_device *device;
//ether_setup(dev);
dev->hard_start_xmit = rt28xx_send_packets;
// dev->set_multicast_list = ieee80211_set_multicast_list;
// dev->change_mtu = ieee80211_change_mtu;
#ifdef CONFIG_STA_SUPPORT
#if WIRELESS_EXT >= 12
dev->wireless_handlers = &rt28xx_iw_handler_def;
#if WIRELESS_EXT < 21
dev->get_wireless_stats = rt28xx_get_wireless_stats;
#else
dev->get_stats = rt28xx_get_wireless_stats;
#endif
#endif //WIRELESS_EXT >= 12
#endif // CONFIG_STA_SUPPORT //
dev->open = rt28xx_open;
dev->stop = rt28xx_close;
// dev->uninit = ieee80211_if_reinit;
// dev->destructor = ieee80211_if_free;
dev->priv_flags = INT_MAIN;
dev->do_ioctl = rt28xx_ioctl;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
dev->validate_addr = NULL;
#endif
// find available device name
for (i = 0; i < 8; i++)
{
#ifdef MULTIPLE_CARD_SUPPORT
if (pAd->MC_RowID >= 0)
sprintf(slot_name, "ra%02d-%d", pAd->MC_RowID, i);
else
#endif // MULTIPLE_CARD_SUPPORT //
sprintf(slot_name, "ra%d", i);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
device = dev_get_by_name(dev->nd_net, slot_name);
#else
device = dev_get_by_name(slot_name);
#endif
if (device != NULL) dev_put(device);
#else
for (device = dev_base; device != NULL; device = device->next)
{
if (strncmp(device->name, slot_name, 4) == 0)
break;
}
#endif
if(device == NULL)
break;
}
if(i == 8)
{
DBGPRINT(RT_DEBUG_ERROR, ("No available slot name\n"));
Status = NDIS_STATUS_FAILURE;
}
else
{
#ifdef MULTIPLE_CARD_SUPPORT
if (pAd->MC_RowID >= 0)
sprintf(dev->name, "ra%02d-%d", pAd->MC_RowID, i);
else
#endif // MULTIPLE_CARD_SUPPORT //
sprintf(dev->name, "ra%d", i);
DBGPRINT(RT_DEBUG_INFO, ("Assign the net device name as %s\n", dev->name));
Status = NDIS_STATUS_SUCCESS;
}
return Status;
}
STEP 3:
Bookmarks