//
static int device_nics = 0;
-static struct vnt_private *pDevice_Infos = NULL;
static struct net_device *root_device_dev = NULL;
static CHIP_INFO chip_info_table[] = {
struct vnt_private **ppDevice,
PCHIP_INFO pChip_info)
{
- struct vnt_private *p;
-
memset(*ppDevice, 0, sizeof(**ppDevice));
- if (pDevice_Infos == NULL) {
- pDevice_Infos = *ppDevice;
- } else {
- for (p = pDevice_Infos; p->next != NULL; p = p->next)
- do {} while (0);
- p->next = *ppDevice;
- (*ppDevice)->prev = p;
- }
-
(*ppDevice)->pcid = pcid;
(*ppDevice)->chip_id = pChip_info->chip_id;
(*ppDevice)->io_size = pChip_info->io_size;
static void device_free_info(struct vnt_private *pDevice)
{
- struct vnt_private *ptr;
struct net_device *dev = pDevice->dev;
+ if (!pDevice)
+ return;
+
ASSERT(pDevice);
//2008-0714-01<Add>by chester
device_release_WPADEV(pDevice);
if (wpa_set_wpadev(pDevice, 0) != 0)
pr_err("unregister wpadev fail?\n");
- if (pDevice_Infos == NULL)
- return;
-
- for (ptr = pDevice_Infos; ptr && (ptr != pDevice); ptr = ptr->next)
- do {} while (0);
-
- if (ptr == pDevice) {
- if (ptr == pDevice_Infos)
- pDevice_Infos = ptr->next;
- else
- ptr->prev->next = ptr->next;
- } else {
- pr_err("info struct not found\n");
- return;
- }
#ifdef HOSTAP
if (dev)
vt6655_hostap_set_hostapd(pDevice, 0, 0);