diff options
author | Forest Bond <forest@alittletooquiet.net> | 2009-06-01 20:00:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-19 14:00:51 -0400 |
commit | 7bb8dc2d7eb5594ec890e822bb0517446d369698 (patch) | |
tree | 7667ffc2ce9e7df1baf6276b3d4f710de7df59d9 /drivers | |
parent | c9d0352914e8fdaece56c8c3ea489d7214b0353e (diff) |
Staging: vt6655: Remove LINUX_VERSION_CODE preprocessor conditionals.
vt6655: Remove LINUX_VERSION_CODE preprocessor conditionals.
Signed-off-by: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/vt6655/bssdb.c | 5 | ||||
-rw-r--r-- | drivers/staging/vt6655/device_main.c | 84 | ||||
-rw-r--r-- | drivers/staging/vt6655/dpc.c | 24 | ||||
-rw-r--r-- | drivers/staging/vt6655/iwctl.c | 78 | ||||
-rw-r--r-- | drivers/staging/vt6655/kcompat.h | 218 | ||||
-rw-r--r-- | drivers/staging/vt6655/wmgr.c | 16 |
6 files changed, 16 insertions, 409 deletions
diff --git a/drivers/staging/vt6655/bssdb.c b/drivers/staging/vt6655/bssdb.c index 4bac7b694452..746fadcffe8a 100644 --- a/drivers/staging/vt6655/bssdb.c +++ b/drivers/staging/vt6655/bssdb.c | |||
@@ -1335,12 +1335,7 @@ start: | |||
1335 | wpahdr->req_ie_len = 0; | 1335 | wpahdr->req_ie_len = 0; |
1336 | skb_put(pDevice->skb, sizeof(viawget_wpa_header)); | 1336 | skb_put(pDevice->skb, sizeof(viawget_wpa_header)); |
1337 | pDevice->skb->dev = pDevice->wpadev; | 1337 | pDevice->skb->dev = pDevice->wpadev; |
1338 | //2008-4-3 modify by Chester for wpa | ||
1339 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) | ||
1340 | pDevice->skb->mac_header = pDevice->skb->data; | 1338 | pDevice->skb->mac_header = pDevice->skb->data; |
1341 | #else | ||
1342 | pDevice->skb->mac.raw = pDevice->skb->data; | ||
1343 | #endif | ||
1344 | pDevice->skb->pkt_type = PACKET_HOST; | 1339 | pDevice->skb->pkt_type = PACKET_HOST; |
1345 | pDevice->skb->protocol = htons(ETH_P_802_2); | 1340 | pDevice->skb->protocol = htons(ETH_P_802_2); |
1346 | memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); | 1341 | memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); |
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 93c626b8a0bd..f0e2c7351552 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c | |||
@@ -367,7 +367,6 @@ static void device_set_multi(struct net_device *dev); | |||
367 | static int device_close(struct net_device *dev); | 367 | static int device_close(struct net_device *dev); |
368 | static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 368 | static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
369 | 369 | ||
370 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9) | ||
371 | #ifdef CONFIG_PM | 370 | #ifdef CONFIG_PM |
372 | static int device_notify_reboot(struct notifier_block *, unsigned long event, void *ptr); | 371 | static int device_notify_reboot(struct notifier_block *, unsigned long event, void *ptr); |
373 | static int viawget_suspend(struct pci_dev *pcid, u32 state); | 372 | static int viawget_suspend(struct pci_dev *pcid, u32 state); |
@@ -378,7 +377,6 @@ struct notifier_block device_notifier = { | |||
378 | priority: 0 | 377 | priority: 0 |
379 | }; | 378 | }; |
380 | #endif | 379 | #endif |
381 | #endif | ||
382 | 380 | ||
383 | #endif // #ifndef PRIVATE_OBJ | 381 | #endif // #ifndef PRIVATE_OBJ |
384 | 382 | ||
@@ -948,12 +946,7 @@ static BOOL device_release_WPADEV(PSDevice pDevice) | |||
948 | wpahdr->req_ie_len = 0; | 946 | wpahdr->req_ie_len = 0; |
949 | skb_put(pDevice->skb, sizeof(viawget_wpa_header)); | 947 | skb_put(pDevice->skb, sizeof(viawget_wpa_header)); |
950 | pDevice->skb->dev = pDevice->wpadev; | 948 | pDevice->skb->dev = pDevice->wpadev; |
951 | //2008-4-3 modify by Chester for wpa | ||
952 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) | ||
953 | pDevice->skb->mac_header = pDevice->skb->data; | 949 | pDevice->skb->mac_header = pDevice->skb->data; |
954 | #else | ||
955 | pDevice->skb->mac.raw = pDevice->skb->data; | ||
956 | #endif | ||
957 | pDevice->skb->pkt_type = PACKET_HOST; | 950 | pDevice->skb->pkt_type = PACKET_HOST; |
958 | pDevice->skb->protocol = htons(ETH_P_802_2); | 951 | pDevice->skb->protocol = htons(ETH_P_802_2); |
959 | memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); | 952 | memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); |
@@ -984,23 +977,14 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent) | |||
984 | struct net_device* dev = NULL; | 977 | struct net_device* dev = NULL; |
985 | PCHIP_INFO pChip_info = (PCHIP_INFO)ent->driver_data; | 978 | PCHIP_INFO pChip_info = (PCHIP_INFO)ent->driver_data; |
986 | PSDevice pDevice; | 979 | PSDevice pDevice; |
987 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) | ||
988 | int rc; | 980 | int rc; |
989 | #endif | ||
990 | //#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) | ||
991 | // BYTE fake_mac[U_ETHER_ADDR_LEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01};//fake MAC address | ||
992 | //#endif | ||
993 | if (device_nics ++>= MAX_UINTS) { | 981 | if (device_nics ++>= MAX_UINTS) { |
994 | printk(KERN_NOTICE DEVICE_NAME ": already found %d NICs\n", device_nics); | 982 | printk(KERN_NOTICE DEVICE_NAME ": already found %d NICs\n", device_nics); |
995 | return -ENODEV; | 983 | return -ENODEV; |
996 | } | 984 | } |
997 | 985 | ||
998 | 986 | ||
999 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) | ||
1000 | dev = alloc_etherdev(sizeof(DEVICE_INFO)); | 987 | dev = alloc_etherdev(sizeof(DEVICE_INFO)); |
1001 | #else | ||
1002 | dev = init_etherdev(dev, 0); | ||
1003 | #endif | ||
1004 | 988 | ||
1005 | pDevice = (PSDevice) netdev_priv(dev); | 989 | pDevice = (PSDevice) netdev_priv(dev); |
1006 | 990 | ||
@@ -1009,11 +993,9 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent) | |||
1009 | return -ENODEV; | 993 | return -ENODEV; |
1010 | } | 994 | } |
1011 | 995 | ||
1012 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) | ||
1013 | // Chain it all together | 996 | // Chain it all together |
1014 | // SET_MODULE_OWNER(dev); | 997 | // SET_MODULE_OWNER(dev); |
1015 | SET_NETDEV_DEV(dev, &pcid->dev); | 998 | SET_NETDEV_DEV(dev, &pcid->dev); |
1016 | #endif | ||
1017 | 999 | ||
1018 | if (bFirst) { | 1000 | if (bFirst) { |
1019 | printk(KERN_NOTICE "%s Ver. %s\n",DEVICE_FULL_DRV_NAM, DEVICE_VERSION); | 1001 | printk(KERN_NOTICE "%s Ver. %s\n",DEVICE_FULL_DRV_NAM, DEVICE_VERSION); |
@@ -1106,21 +1088,12 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent) | |||
1106 | 1088 | ||
1107 | 1089 | ||
1108 | 1090 | ||
1109 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) | ||
1110 | rc = pci_request_regions(pcid, DEVICE_NAME); | 1091 | rc = pci_request_regions(pcid, DEVICE_NAME); |
1111 | if (rc) { | 1092 | if (rc) { |
1112 | printk(KERN_ERR DEVICE_NAME ": Failed to find PCI device\n"); | 1093 | printk(KERN_ERR DEVICE_NAME ": Failed to find PCI device\n"); |
1113 | device_free_info(pDevice); | 1094 | device_free_info(pDevice); |
1114 | return -ENODEV; | 1095 | return -ENODEV; |
1115 | } | 1096 | } |
1116 | #else | ||
1117 | if (check_region(pDevice->ioaddr, pDevice->io_size)) { | ||
1118 | printk(KERN_ERR DEVICE_NAME ": Failed to find PCI device\n"); | ||
1119 | device_free_info(pDevice); | ||
1120 | return -ENODEV; | ||
1121 | } | ||
1122 | request_region(pDevice->ioaddr, pDevice->io_size, DEVICE_NAME); | ||
1123 | #endif | ||
1124 | 1097 | ||
1125 | dev->base_addr = pDevice->ioaddr; | 1098 | dev->base_addr = pDevice->ioaddr; |
1126 | #ifdef PLICE_DEBUG | 1099 | #ifdef PLICE_DEBUG |
@@ -1177,10 +1150,6 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent) | |||
1177 | #endif /* WIRELESS_EXT > 12 */ | 1150 | #endif /* WIRELESS_EXT > 12 */ |
1178 | #endif /* WIRELESS_EXT */ | 1151 | #endif /* WIRELESS_EXT */ |
1179 | 1152 | ||
1180 | // #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) | ||
1181 | // memcpy(pDevice->dev->dev_addr, fake_mac, U_ETHER_ADDR_LEN); //use fake mac address | ||
1182 | // #endif | ||
1183 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) | ||
1184 | rc = register_netdev(dev); | 1153 | rc = register_netdev(dev); |
1185 | if (rc) | 1154 | if (rc) |
1186 | { | 1155 | { |
@@ -1188,7 +1157,6 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent) | |||
1188 | device_free_info(pDevice); | 1157 | device_free_info(pDevice); |
1189 | return -ENODEV; | 1158 | return -ENODEV; |
1190 | } | 1159 | } |
1191 | #endif | ||
1192 | //2008-07-21-01<Add>by MikeLiu | 1160 | //2008-07-21-01<Add>by MikeLiu |
1193 | //register wpadev | 1161 | //register wpadev |
1194 | if(wpa_set_wpadev(pDevice, 1)!=0) { | 1162 | if(wpa_set_wpadev(pDevice, 1)!=0) { |
@@ -1354,17 +1322,10 @@ device_release_WPADEV(pDevice); | |||
1354 | if (pDevice->PortOffset) | 1322 | if (pDevice->PortOffset) |
1355 | iounmap((PVOID)pDevice->PortOffset); | 1323 | iounmap((PVOID)pDevice->PortOffset); |
1356 | 1324 | ||
1357 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) | ||
1358 | if (pDevice->pcid) | 1325 | if (pDevice->pcid) |
1359 | pci_release_regions(pDevice->pcid); | 1326 | pci_release_regions(pDevice->pcid); |
1360 | if (dev) | 1327 | if (dev) |
1361 | free_netdev(dev); | 1328 | free_netdev(dev); |
1362 | #else | ||
1363 | if (pDevice->ioaddr) | ||
1364 | release_region(pDevice->ioaddr,pDevice->io_size); | ||
1365 | if (dev) | ||
1366 | kfree(dev); | ||
1367 | #endif | ||
1368 | 1329 | ||
1369 | if (pDevice->pcid) { | 1330 | if (pDevice->pcid) { |
1370 | pci_set_drvdata(pDevice->pcid,NULL); | 1331 | pci_set_drvdata(pDevice->pcid,NULL); |
@@ -1877,11 +1838,7 @@ static int device_tx_srv(PSDevice pDevice, UINT uIdx) { | |||
1877 | #else | 1838 | #else |
1878 | skb = pTD->pTDInfo->skb; | 1839 | skb = pTD->pTDInfo->skb; |
1879 | skb->dev = pDevice->apdev; | 1840 | skb->dev = pDevice->apdev; |
1880 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) | 1841 | skb->mac_header = skb->data; |
1881 | skb->mac_header = skb->data; | ||
1882 | #else | ||
1883 | skb->mac.raw = skb->data; | ||
1884 | #endif | ||
1885 | skb->pkt_type = PACKET_OTHERHOST; | 1842 | skb->pkt_type = PACKET_OTHERHOST; |
1886 | //skb->protocol = htons(ETH_P_802_2); | 1843 | //skb->protocol = htons(ETH_P_802_2); |
1887 | memset(skb->cb, 0, sizeof(skb->cb)); | 1844 | memset(skb->cb, 0, sizeof(skb->cb)); |
@@ -2061,11 +2018,7 @@ static int device_open(struct net_device *dev) { | |||
2061 | } | 2018 | } |
2062 | //2008-5-13 <add> by chester | 2019 | //2008-5-13 <add> by chester |
2063 | #ifndef PRIVATE_OBJ | 2020 | #ifndef PRIVATE_OBJ |
2064 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) | ||
2065 | i=request_irq(pDevice->pcid->irq, &device_intr, IRQF_SHARED, dev->name, dev); | 2021 | i=request_irq(pDevice->pcid->irq, &device_intr, IRQF_SHARED, dev->name, dev); |
2066 | #else | ||
2067 | i=request_irq(pDevice->pcid->irq, &device_intr, (unsigned long)SA_SHIRQ, dev->name, dev); | ||
2068 | #endif | ||
2069 | if (i) | 2022 | if (i) |
2070 | return i; | 2023 | return i; |
2071 | #endif | 2024 | #endif |
@@ -2185,12 +2138,6 @@ DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call MACvIntEnable\n"); | |||
2185 | } | 2138 | } |
2186 | pDevice->flags |=DEVICE_FLAGS_OPENED; | 2139 | pDevice->flags |=DEVICE_FLAGS_OPENED; |
2187 | 2140 | ||
2188 | #ifndef PRIVATE_OBJ | ||
2189 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) | ||
2190 | MOD_INC_USE_COUNT; | ||
2191 | #endif | ||
2192 | #endif | ||
2193 | |||
2194 | DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_open success.. \n"); | 2141 | DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_open success.. \n"); |
2195 | return 0; | 2142 | return 0; |
2196 | } | 2143 | } |
@@ -2255,11 +2202,6 @@ device_release_WPADEV(pDevice); | |||
2255 | //PLICE_DEBUG-> | 2202 | //PLICE_DEBUG-> |
2256 | //tasklet_kill(&pDevice->RxMngWorkItem); | 2203 | //tasklet_kill(&pDevice->RxMngWorkItem); |
2257 | //PLICE_DEBUG<- | 2204 | //PLICE_DEBUG<- |
2258 | #ifndef PRIVATE_OBJ | ||
2259 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) | ||
2260 | MOD_DEC_USE_COUNT; | ||
2261 | #endif | ||
2262 | #endif | ||
2263 | DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_close.. \n"); | 2205 | DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_close.. \n"); |
2264 | return 0; | 2206 | return 0; |
2265 | } | 2207 | } |
@@ -3945,12 +3887,10 @@ static struct pci_driver device_driver = { | |||
3945 | id_table: device_id_table, | 3887 | id_table: device_id_table, |
3946 | probe: device_found1, | 3888 | probe: device_found1, |
3947 | remove: device_remove1, | 3889 | remove: device_remove1, |
3948 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9) | ||
3949 | #ifdef CONFIG_PM | 3890 | #ifdef CONFIG_PM |
3950 | suspend: viawget_suspend, | 3891 | suspend: viawget_suspend, |
3951 | resume: viawget_resume, | 3892 | resume: viawget_resume, |
3952 | #endif | 3893 | #endif |
3953 | #endif | ||
3954 | }; | 3894 | }; |
3955 | 3895 | ||
3956 | static int __init device_init_module(void) | 3896 | static int __init device_init_module(void) |
@@ -3960,17 +3900,11 @@ static int __init device_init_module(void) | |||
3960 | 3900 | ||
3961 | // ret=pci_module_init(&device_driver); | 3901 | // ret=pci_module_init(&device_driver); |
3962 | //ret = pcie_port_service_register(&device_driver); | 3902 | //ret = pcie_port_service_register(&device_driver); |
3963 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) | ||
3964 | ret = pci_register_driver(&device_driver); | 3903 | ret = pci_register_driver(&device_driver); |
3965 | #else | ||
3966 | ret = pci_module_init(&device_driver); | ||
3967 | #endif | ||
3968 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9) | ||
3969 | #ifdef CONFIG_PM | 3904 | #ifdef CONFIG_PM |
3970 | if(ret >= 0) | 3905 | if(ret >= 0) |
3971 | register_reboot_notifier(&device_notifier); | 3906 | register_reboot_notifier(&device_notifier); |
3972 | #endif | 3907 | #endif |
3973 | #endif | ||
3974 | 3908 | ||
3975 | return ret; | 3909 | return ret; |
3976 | } | 3910 | } |
@@ -3979,11 +3913,9 @@ static void __exit device_cleanup_module(void) | |||
3979 | { | 3913 | { |
3980 | 3914 | ||
3981 | 3915 | ||
3982 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9) | ||
3983 | #ifdef CONFIG_PM | 3916 | #ifdef CONFIG_PM |
3984 | unregister_reboot_notifier(&device_notifier); | 3917 | unregister_reboot_notifier(&device_notifier); |
3985 | #endif | 3918 | #endif |
3986 | #endif | ||
3987 | pci_unregister_driver(&device_driver); | 3919 | pci_unregister_driver(&device_driver); |
3988 | 3920 | ||
3989 | } | 3921 | } |
@@ -3992,7 +3924,6 @@ module_init(device_init_module); | |||
3992 | module_exit(device_cleanup_module); | 3924 | module_exit(device_cleanup_module); |
3993 | 3925 | ||
3994 | 3926 | ||
3995 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9) | ||
3996 | #ifdef CONFIG_PM | 3927 | #ifdef CONFIG_PM |
3997 | static int | 3928 | static int |
3998 | device_notify_reboot(struct notifier_block *nb, unsigned long event, void *p) | 3929 | device_notify_reboot(struct notifier_block *nb, unsigned long event, void *p) |
@@ -4002,11 +3933,7 @@ device_notify_reboot(struct notifier_block *nb, unsigned long event, void *p) | |||
4002 | case SYS_DOWN: | 3933 | case SYS_DOWN: |
4003 | case SYS_HALT: | 3934 | case SYS_HALT: |
4004 | case SYS_POWER_OFF: | 3935 | case SYS_POWER_OFF: |
4005 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) | ||
4006 | while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { | 3936 | while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { |
4007 | #else | ||
4008 | pci_for_each_dev(pdev) { | ||
4009 | #endif | ||
4010 | if(pci_dev_driver(pdev) == &device_driver) { | 3937 | if(pci_dev_driver(pdev) == &device_driver) { |
4011 | if (pci_get_drvdata(pdev)) | 3938 | if (pci_get_drvdata(pdev)) |
4012 | viawget_suspend(pdev, 3); | 3939 | viawget_suspend(pdev, 3); |
@@ -4026,11 +3953,7 @@ viawget_suspend(struct pci_dev *pcid, u32 state) | |||
4026 | 3953 | ||
4027 | netif_stop_queue(pDevice->dev); | 3954 | netif_stop_queue(pDevice->dev); |
4028 | spin_lock_irq(&pDevice->lock); | 3955 | spin_lock_irq(&pDevice->lock); |
4029 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10) | ||
4030 | pci_save_state(pcid); | 3956 | pci_save_state(pcid); |
4031 | #else | ||
4032 | pci_save_state(pcid, pDevice->pci_state); | ||
4033 | #endif | ||
4034 | del_timer(&pDevice->sTimerCommand); | 3957 | del_timer(&pDevice->sTimerCommand); |
4035 | del_timer(&pMgmt->sTimerSecondCallback); | 3958 | del_timer(&pMgmt->sTimerSecondCallback); |
4036 | pDevice->cbFreeCmdQueue = CMD_Q_SIZE; | 3959 | pDevice->cbFreeCmdQueue = CMD_Q_SIZE; |
@@ -4058,11 +3981,7 @@ viawget_resume(struct pci_dev *pcid) | |||
4058 | 3981 | ||
4059 | power_status = pci_set_power_state(pcid, 0); | 3982 | power_status = pci_set_power_state(pcid, 0); |
4060 | power_status = pci_enable_wake(pcid, 0, 0); | 3983 | power_status = pci_enable_wake(pcid, 0, 0); |
4061 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10) | ||
4062 | pci_restore_state(pcid); | 3984 | pci_restore_state(pcid); |
4063 | #else | ||
4064 | pci_restore_state(pcid, pDevice->pci_state); | ||
4065 | #endif | ||
4066 | if (netif_running(pDevice->dev)) { | 3985 | if (netif_running(pDevice->dev)) { |
4067 | spin_lock_irq(&pDevice->lock); | 3986 | spin_lock_irq(&pDevice->lock); |
4068 | MACvRestoreContext(pDevice->PortOffset, pDevice->abyMacContext); | 3987 | MACvRestoreContext(pDevice->PortOffset, pDevice->abyMacContext); |
@@ -4091,7 +4010,6 @@ viawget_resume(struct pci_dev *pcid) | |||
4091 | } | 4010 | } |
4092 | 4011 | ||
4093 | #endif | 4012 | #endif |
4094 | #endif | ||
4095 | 4013 | ||
4096 | #endif //#ifndef PRIVATE_OBJ | 4014 | #endif //#ifndef PRIVATE_OBJ |
4097 | 4015 | ||
diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c index 05366b9754f0..acc6d82a9544 100644 --- a/drivers/staging/vt6655/dpc.c +++ b/drivers/staging/vt6655/dpc.c | |||
@@ -709,11 +709,7 @@ device_receive_frame ( | |||
709 | ref_skb_add_offset(skb->skb, 4); | 709 | ref_skb_add_offset(skb->skb, 4); |
710 | ref_skb_set_dev(pDevice->apdev, skb->skb); | 710 | ref_skb_set_dev(pDevice->apdev, skb->skb); |
711 | skb_put(skb->skb, FrameSize); | 711 | skb_put(skb->skb, FrameSize); |
712 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,21) | ||
713 | skb->mac_header = skb->data; | 712 | skb->mac_header = skb->data; |
714 | #else | ||
715 | skb->mac.raw = skb->data; | ||
716 | #endif | ||
717 | *(skb->pkt_type) = PACKET_OTHERHOST; | 713 | *(skb->pkt_type) = PACKET_OTHERHOST; |
718 | *(skb->protocol) = htons(ETH_P_802_2); | 714 | *(skb->protocol) = htons(ETH_P_802_2); |
719 | memset(skb->cb, 0, sizeof(skb->cb)); | 715 | memset(skb->cb, 0, sizeof(skb->cb)); |
@@ -722,11 +718,7 @@ device_receive_frame ( | |||
722 | skb->data += 4; | 718 | skb->data += 4; |
723 | skb->tail += 4; | 719 | skb->tail += 4; |
724 | skb_put(skb, FrameSize); | 720 | skb_put(skb, FrameSize); |
725 | #if LINUX_VERSION_CODE > KERNEL_VERSION (2,6,21) | ||
726 | skb->mac_header = skb->data; | 721 | skb->mac_header = skb->data; |
727 | #else | ||
728 | skb->mac.raw = skb->data; | ||
729 | #endif | ||
730 | skb->pkt_type = PACKET_OTHERHOST; | 722 | skb->pkt_type = PACKET_OTHERHOST; |
731 | skb->protocol = htons(ETH_P_802_2); | 723 | skb->protocol = htons(ETH_P_802_2); |
732 | memset(skb->cb, 0, sizeof(skb->cb)); | 724 | memset(skb->cb, 0, sizeof(skb->cb)); |
@@ -858,11 +850,7 @@ device_receive_frame ( | |||
858 | ref_skb_add_offset(skb->skb, (cbIVOffset + 4)); | 850 | ref_skb_add_offset(skb->skb, (cbIVOffset + 4)); |
859 | ref_skb_set_dev(pDevice->apdev, skb->skb); | 851 | ref_skb_set_dev(pDevice->apdev, skb->skb); |
860 | skb_put(skb->skb, FrameSize); | 852 | skb_put(skb->skb, FrameSize); |
861 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,21) | ||
862 | skb->mac_header = skb->data; | 853 | skb->mac_header = skb->data; |
863 | #else | ||
864 | skb->mac.raw = skb->data; | ||
865 | #endif | ||
866 | *(skb->pkt_type) = PACKET_OTHERHOST; | 854 | *(skb->pkt_type) = PACKET_OTHERHOST; |
867 | *(skb->protocol) = htons(ETH_P_802_2); | 855 | *(skb->protocol) = htons(ETH_P_802_2); |
868 | memset(skb->cb, 0, sizeof(skb->cb)); | 856 | memset(skb->cb, 0, sizeof(skb->cb)); |
@@ -871,11 +859,7 @@ device_receive_frame ( | |||
871 | skb->data += (cbIVOffset + 4); | 859 | skb->data += (cbIVOffset + 4); |
872 | skb->tail += (cbIVOffset + 4); | 860 | skb->tail += (cbIVOffset + 4); |
873 | skb_put(skb, FrameSize); | 861 | skb_put(skb, FrameSize); |
874 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,21) | ||
875 | skb->mac_header = skb->data; | 862 | skb->mac_header = skb->data; |
876 | #else | ||
877 | skb->mac.raw = skb->data; | ||
878 | #endif | ||
879 | 863 | ||
880 | skb->pkt_type = PACKET_OTHERHOST; | 864 | skb->pkt_type = PACKET_OTHERHOST; |
881 | skb->protocol = htons(ETH_P_802_2); | 865 | skb->protocol = htons(ETH_P_802_2); |
@@ -998,12 +982,8 @@ device_receive_frame ( | |||
998 | wpahdr->req_ie_len = 0; | 982 | wpahdr->req_ie_len = 0; |
999 | skb_put(pDevice->skb, sizeof(viawget_wpa_header)); | 983 | skb_put(pDevice->skb, sizeof(viawget_wpa_header)); |
1000 | pDevice->skb->dev = pDevice->wpadev; | 984 | pDevice->skb->dev = pDevice->wpadev; |
1001 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,21) | 985 | pDevice->skb->mac_header = pDevice->skb->data; |
1002 | pDevice->skb->mac_header = pDevice->skb->data; | 986 | pDevice->skb->pkt_type = PACKET_HOST; |
1003 | #else | ||
1004 | pDevice->skb->mac.raw=pDevice->skb->data; | ||
1005 | #endif | ||
1006 | pDevice->skb->pkt_type = PACKET_HOST; | ||
1007 | pDevice->skb->protocol = htons(ETH_P_802_2); | 987 | pDevice->skb->protocol = htons(ETH_P_802_2); |
1008 | memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); | 988 | memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); |
1009 | netif_rx(pDevice->skb); | 989 | netif_rx(pDevice->skb); |
diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c index 60ea9b4d44ba..4d5a1da8edfc 100644 --- a/drivers/staging/vt6655/iwctl.c +++ b/drivers/staging/vt6655/iwctl.c | |||
@@ -307,22 +307,14 @@ int iwctl_giwscan(struct net_device *dev, | |||
307 | iwe.cmd = SIOCGIWAP; | 307 | iwe.cmd = SIOCGIWAP; |
308 | iwe.u.ap_addr.sa_family = ARPHRD_ETHER; | 308 | iwe.u.ap_addr.sa_family = ARPHRD_ETHER; |
309 | memcpy(iwe.u.ap_addr.sa_data, pBSS->abyBSSID, WLAN_BSSID_LEN); | 309 | memcpy(iwe.u.ap_addr.sa_data, pBSS->abyBSSID, WLAN_BSSID_LEN); |
310 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add | 310 | current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_ADDR_LEN); |
311 | current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_ADDR_LEN); | ||
312 | #else | ||
313 | current_ev = iwe_stream_add_event(current_ev,end_buf, &iwe, IW_EV_ADDR_LEN); | ||
314 | #endif | ||
315 | //ADD ssid | 311 | //ADD ssid |
316 | memset(&iwe, 0, sizeof(iwe)); | 312 | memset(&iwe, 0, sizeof(iwe)); |
317 | iwe.cmd = SIOCGIWESSID; | 313 | iwe.cmd = SIOCGIWESSID; |
318 | pItemSSID = (PWLAN_IE_SSID)pBSS->abySSID; | 314 | pItemSSID = (PWLAN_IE_SSID)pBSS->abySSID; |
319 | iwe.u.data.length = pItemSSID->len; | 315 | iwe.u.data.length = pItemSSID->len; |
320 | iwe.u.data.flags = 1; | 316 | iwe.u.data.flags = 1; |
321 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add | 317 | current_ev = iwe_stream_add_point(info,current_ev,end_buf, &iwe, pItemSSID->abySSID); |
322 | current_ev = iwe_stream_add_point(info,current_ev,end_buf, &iwe, pItemSSID->abySSID); | ||
323 | #else | ||
324 | current_ev = iwe_stream_add_point(current_ev,end_buf, &iwe, pItemSSID->abySSID); | ||
325 | #endif | ||
326 | //ADD mode | 318 | //ADD mode |
327 | memset(&iwe, 0, sizeof(iwe)); | 319 | memset(&iwe, 0, sizeof(iwe)); |
328 | iwe.cmd = SIOCGIWMODE; | 320 | iwe.cmd = SIOCGIWMODE; |
@@ -333,11 +325,7 @@ int iwctl_giwscan(struct net_device *dev, | |||
333 | iwe.u.mode = IW_MODE_ADHOC; | 325 | iwe.u.mode = IW_MODE_ADHOC; |
334 | } | 326 | } |
335 | iwe.len = IW_EV_UINT_LEN; | 327 | iwe.len = IW_EV_UINT_LEN; |
336 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add | 328 | current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe, IW_EV_UINT_LEN); |
337 | current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe, IW_EV_UINT_LEN); | ||
338 | #else | ||
339 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_UINT_LEN); | ||
340 | #endif | ||
341 | //ADD frequency | 329 | //ADD frequency |
342 | pSuppRates = (PWLAN_IE_SUPP_RATES)pBSS->abySuppRates; | 330 | pSuppRates = (PWLAN_IE_SUPP_RATES)pBSS->abySuppRates; |
343 | pExtSuppRates = (PWLAN_IE_SUPP_RATES)pBSS->abyExtSuppRates; | 331 | pExtSuppRates = (PWLAN_IE_SUPP_RATES)pBSS->abyExtSuppRates; |
@@ -346,11 +334,7 @@ int iwctl_giwscan(struct net_device *dev, | |||
346 | iwe.u.freq.m = pBSS->uChannel; | 334 | iwe.u.freq.m = pBSS->uChannel; |
347 | iwe.u.freq.e = 0; | 335 | iwe.u.freq.e = 0; |
348 | iwe.u.freq.i = 0; | 336 | iwe.u.freq.i = 0; |
349 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add | 337 | current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN); |
350 | current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN); | ||
351 | #else | ||
352 | current_ev = iwe_stream_add_event(current_ev,end_buf, &iwe, IW_EV_FREQ_LEN); | ||
353 | #endif | ||
354 | 338 | ||
355 | 339 | ||
356 | //2008-0409-04, <Add> by Einsn Liu | 340 | //2008-0409-04, <Add> by Einsn Liu |
@@ -360,11 +344,7 @@ int iwctl_giwscan(struct net_device *dev, | |||
360 | iwe.u.freq.m = frequency_list[f] * 100000; | 344 | iwe.u.freq.m = frequency_list[f] * 100000; |
361 | iwe.u.freq.e = 1; | 345 | iwe.u.freq.e = 1; |
362 | } | 346 | } |
363 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add | 347 | current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN); |
364 | current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN); | ||
365 | #else | ||
366 | current_ev = iwe_stream_add_event(current_ev,end_buf, &iwe, IW_EV_FREQ_LEN); | ||
367 | #endif | ||
368 | //ADD quality | 348 | //ADD quality |
369 | memset(&iwe, 0, sizeof(iwe)); | 349 | memset(&iwe, 0, sizeof(iwe)); |
370 | iwe.cmd = IWEVQUAL; | 350 | iwe.cmd = IWEVQUAL; |
@@ -382,11 +362,7 @@ int iwctl_giwscan(struct net_device *dev, | |||
382 | iwe.u.qual.updated=7; | 362 | iwe.u.qual.updated=7; |
383 | 363 | ||
384 | // iwe.u.qual.qual = 0; | 364 | // iwe.u.qual.qual = 0; |
385 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add | 365 | current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe, IW_EV_QUAL_LEN); |
386 | current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe, IW_EV_QUAL_LEN); | ||
387 | #else | ||
388 | current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_QUAL_LEN); | ||
389 | #endif | ||
390 | 366 | ||
391 | memset(&iwe, 0, sizeof(iwe)); | 367 | memset(&iwe, 0, sizeof(iwe)); |
392 | iwe.cmd = SIOCGIWENCODE; | 368 | iwe.cmd = SIOCGIWENCODE; |
@@ -396,11 +372,7 @@ int iwctl_giwscan(struct net_device *dev, | |||
396 | }else { | 372 | }else { |
397 | iwe.u.data.flags = IW_ENCODE_DISABLED; | 373 | iwe.u.data.flags = IW_ENCODE_DISABLED; |
398 | } | 374 | } |
399 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add | ||
400 | current_ev = iwe_stream_add_point(info,current_ev,end_buf, &iwe, pItemSSID->abySSID); | 375 | current_ev = iwe_stream_add_point(info,current_ev,end_buf, &iwe, pItemSSID->abySSID); |
401 | #else | ||
402 | current_ev = iwe_stream_add_point(current_ev,end_buf, &iwe, pItemSSID->abySSID); | ||
403 | #endif | ||
404 | 376 | ||
405 | memset(&iwe, 0, sizeof(iwe)); | 377 | memset(&iwe, 0, sizeof(iwe)); |
406 | iwe.cmd = SIOCGIWRATE; | 378 | iwe.cmd = SIOCGIWRATE; |
@@ -412,22 +384,14 @@ int iwctl_giwscan(struct net_device *dev, | |||
412 | break; | 384 | break; |
413 | // Bit rate given in 500 kb/s units (+ 0x80) | 385 | // Bit rate given in 500 kb/s units (+ 0x80) |
414 | iwe.u.bitrate.value = ((pSuppRates->abyRates[kk] & 0x7f) * 500000); | 386 | iwe.u.bitrate.value = ((pSuppRates->abyRates[kk] & 0x7f) * 500000); |
415 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add | 387 | current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN); |
416 | current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN); | ||
417 | #else | ||
418 | current_val = iwe_stream_add_value(current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN); | ||
419 | #endif | ||
420 | } | 388 | } |
421 | for (kk = 0 ; kk < 8 ; kk++) { | 389 | for (kk = 0 ; kk < 8 ; kk++) { |
422 | if (pExtSuppRates->abyRates[kk] == 0) | 390 | if (pExtSuppRates->abyRates[kk] == 0) |
423 | break; | 391 | break; |
424 | // Bit rate given in 500 kb/s units (+ 0x80) | 392 | // Bit rate given in 500 kb/s units (+ 0x80) |
425 | iwe.u.bitrate.value = ((pExtSuppRates->abyRates[kk] & 0x7f) * 500000); | 393 | iwe.u.bitrate.value = ((pExtSuppRates->abyRates[kk] & 0x7f) * 500000); |
426 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add | 394 | current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN); |
427 | current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN); | ||
428 | #else | ||
429 | current_val = iwe_stream_add_value(current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN); | ||
430 | #endif | ||
431 | } | 395 | } |
432 | 396 | ||
433 | if((current_val - current_ev) > IW_EV_LCP_LEN) | 397 | if((current_val - current_ev) > IW_EV_LCP_LEN) |
@@ -438,33 +402,21 @@ int iwctl_giwscan(struct net_device *dev, | |||
438 | iwe.cmd = IWEVCUSTOM; | 402 | iwe.cmd = IWEVCUSTOM; |
439 | sprintf(buf, "bcn_int=%d", pBSS->wBeaconInterval); | 403 | sprintf(buf, "bcn_int=%d", pBSS->wBeaconInterval); |
440 | iwe.u.data.length = strlen(buf); | 404 | iwe.u.data.length = strlen(buf); |
441 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add | 405 | current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf); |
442 | current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf); | ||
443 | #else | ||
444 | current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, buf); | ||
445 | #endif | ||
446 | 406 | ||
447 | #if WIRELESS_EXT > 17 | 407 | #if WIRELESS_EXT > 17 |
448 | if ((pBSS->wWPALen > 0) && (pBSS->wWPALen <= MAX_WPA_IE_LEN)) { | 408 | if ((pBSS->wWPALen > 0) && (pBSS->wWPALen <= MAX_WPA_IE_LEN)) { |
449 | memset(&iwe, 0, sizeof(iwe)); | 409 | memset(&iwe, 0, sizeof(iwe)); |
450 | iwe.cmd = IWEVGENIE; | 410 | iwe.cmd = IWEVGENIE; |
451 | iwe.u.data.length = pBSS->wWPALen; | 411 | iwe.u.data.length = pBSS->wWPALen; |
452 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add | ||
453 | current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, pBSS->byWPAIE); | 412 | current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, pBSS->byWPAIE); |
454 | #else | ||
455 | current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, pBSS->byWPAIE); | ||
456 | #endif | ||
457 | } | 413 | } |
458 | 414 | ||
459 | if ((pBSS->wRSNLen > 0) && (pBSS->wRSNLen <= MAX_WPA_IE_LEN)) { | 415 | if ((pBSS->wRSNLen > 0) && (pBSS->wRSNLen <= MAX_WPA_IE_LEN)) { |
460 | memset(&iwe, 0, sizeof(iwe)); | 416 | memset(&iwe, 0, sizeof(iwe)); |
461 | iwe.cmd = IWEVGENIE; | 417 | iwe.cmd = IWEVGENIE; |
462 | iwe.u.data.length = pBSS->wRSNLen; | 418 | iwe.u.data.length = pBSS->wRSNLen; |
463 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add | ||
464 | current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, pBSS->byRSNIE); | 419 | current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, pBSS->byRSNIE); |
465 | #else | ||
466 | current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, pBSS->byRSNIE); | ||
467 | #endif | ||
468 | } | 420 | } |
469 | 421 | ||
470 | #else // WIRELESS_EXT > 17 | 422 | #else // WIRELESS_EXT > 17 |
@@ -477,11 +429,7 @@ int iwctl_giwscan(struct net_device *dev, | |||
477 | p += sprintf(p, "%02x", pBSS->byWPAIE[ii]); | 429 | p += sprintf(p, "%02x", pBSS->byWPAIE[ii]); |
478 | } | 430 | } |
479 | iwe.u.data.length = strlen(buf); | 431 | iwe.u.data.length = strlen(buf); |
480 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add | 432 | current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf); |
481 | current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf); | ||
482 | #else | ||
483 | current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, buf); | ||
484 | #endif | ||
485 | } | 433 | } |
486 | 434 | ||
487 | 435 | ||
@@ -494,11 +442,7 @@ int iwctl_giwscan(struct net_device *dev, | |||
494 | p += sprintf(p, "%02x", pBSS->byRSNIE[ii]); | 442 | p += sprintf(p, "%02x", pBSS->byRSNIE[ii]); |
495 | } | 443 | } |
496 | iwe.u.data.length = strlen(buf); | 444 | iwe.u.data.length = strlen(buf); |
497 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add | 445 | current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf); |
498 | current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf); | ||
499 | #else | ||
500 | current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, buf); | ||
501 | #endif | ||
502 | } | 446 | } |
503 | #endif | 447 | #endif |
504 | #endif | 448 | #endif |
diff --git a/drivers/staging/vt6655/kcompat.h b/drivers/staging/vt6655/kcompat.h index 693939df6675..652c2c78b0f5 100644 --- a/drivers/staging/vt6655/kcompat.h +++ b/drivers/staging/vt6655/kcompat.h | |||
@@ -74,229 +74,11 @@ typedef void irqreturn_t; | |||
74 | 74 | ||
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18) | ||
78 | |||
79 | typedef unsigned long dma_addr_t; | ||
80 | typedef struct wait_queue *wait_queue_head_t; | ||
81 | #define init_waitqueue_head(x) *(x)=NULL | ||
82 | #define set_current_state(status) { current->state = (status); mb(); } | ||
83 | |||
84 | #ifdef MODULE | ||
85 | |||
86 | #define module_init(fn) int init_module (void) { return fn(); } | ||
87 | #define module_exit(fn) void cleanup_module(void) { return fn(); } | ||
88 | |||
89 | #else /* MODULE */ | ||
90 | |||
91 | #define module_init(fn) int e100_probe (void) { return fn(); } | ||
92 | #define module_exit(fn) /* NOTHING */ | ||
93 | |||
94 | #endif /* MODULE */ | ||
95 | |||
96 | #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18) */ | ||
97 | |||
98 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) | ||
99 | |||
100 | #ifdef MODVERSIONS | ||
101 | #include <linux/modversions.h> | ||
102 | #endif | ||
103 | |||
104 | #include <linux/types.h> | ||
105 | #include <linux/pci.h> | ||
106 | #include <linux/slab.h> | ||
107 | #include <asm/io.h> | ||
108 | |||
109 | #define pci_resource_start(dev, bar) \ | ||
110 | (((dev)->base_address[(bar)] & PCI_BASE_ADDRESS_SPACE_IO) ? \ | ||
111 | ((dev)->base_address[(bar)] & PCI_BASE_ADDRESS_IO_MASK) : \ | ||
112 | ((dev)->base_address[(bar)] & PCI_BASE_ADDRESS_MEM_MASK)) | ||
113 | |||
114 | static inline int pci_enable_device(struct pci_dev *dev) | ||
115 | { | ||
116 | 1112 | ||
117 | return 0; | ||
118 | } | ||
119 | #define __constant_cpu_to_le32 cpu_to_le32 | ||
120 | #define __constant_cpu_to_le16 cpu_to_le16 | ||
121 | |||
122 | #define PCI_DMA_TODEVICE 1 | ||
123 | #define PCI_DMA_FROMDEVICE 2 | ||
124 | |||
125 | extern inline void *pci_alloc_consistent (struct pci_dev *dev, | ||
126 | size_t size, | ||
127 | dma_addr_t *dma_handle) { | ||
128 | void *vaddr = kmalloc(size, GFP_ATOMIC); | ||
129 | if(vaddr != NULL) { | ||
130 | *dma_handle = virt_to_bus(vaddr); | ||
131 | } | ||
132 | return vaddr; | ||
133 | } | ||
134 | |||
135 | #define pci_dma_sync_single(dev,dma_handle,size,direction) do{} while(0) | ||
136 | #define pci_dma_supported(dev, addr_mask) (1) | ||
137 | #define pci_free_consistent(dev, size, cpu_addr, dma_handle) kfree(cpu_addr) | ||
138 | #define pci_map_single(dev, addr, size, direction) virt_to_bus(addr) | ||
139 | #define pci_unmap_single(dev, dma_handle, size, direction) do{} while(0) | ||
140 | |||
141 | |||
142 | #define spin_lock_bh spin_lock_irq | ||
143 | #define spin_unlock_bh spin_unlock_irq | ||
144 | #define del_timer_sync(timer) del_timer(timer) | ||
145 | #define net_device device | ||
146 | |||
147 | #define netif_start_queue(dev) ( clear_bit(0, &(dev)->tbusy)) | ||
148 | #define netif_stop_queue(dev) ( set_bit(0, &(dev)->tbusy)) | ||
149 | #define netif_wake_queue(dev) { clear_bit(0, &(dev)->tbusy); \ | ||
150 | mark_bh(NET_BH); } | ||
151 | #define netif_running(dev) ( test_bit(0, &(dev)->start)) | ||
152 | #define netif_queue_stopped(dev) ( test_bit(0, &(dev)->tbusy)) | ||
153 | |||
154 | #define netif_device_attach(dev) \ | ||
155 | do{ (dev)->start = 1; netif_start_queue(dev); } while (0) | ||
156 | #define netif_device_detach(dev) \ | ||
157 | do{ (dev)->start = 0; netif_stop_queue(dev); } while (0) | ||
158 | |||
159 | #define dev_kfree_skb_irq(skb) dev_kfree_skb(skb) | ||
160 | |||
161 | #define netif_carrier_on(dev) do {} while (0) | ||
162 | #define netif_carrier_off(dev) do {} while (0) | ||
163 | |||
164 | |||
165 | #define PCI_ANY_ID (~0U) | ||
166 | |||
167 | struct pci_device_id { | ||
168 | unsigned int vendor, device; | ||
169 | unsigned int subvendor, subdevice; | ||
170 | unsigned int class, classmask; | ||
171 | unsigned long driver_data; | ||
172 | }; | ||
173 | |||
174 | #define MODULE_DEVICE_TABLE(bus, dev_table) | ||
175 | #define PCI_MAX_NUM_NICS 256 | ||
176 | |||
177 | struct pci_driver { | ||
178 | char *name; | ||
179 | struct pci_device_id *id_table; | ||
180 | int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); | ||
181 | void (*remove)(struct pci_dev *dev); | ||
182 | void (*suspend)(struct pci_dev *dev); | ||
183 | void (*resume)(struct pci_dev *dev); | ||
184 | struct pci_dev *pcimap[PCI_MAX_NUM_NICS]; | ||
185 | }; | ||
186 | |||
187 | static inline int pci_module_init(struct pci_driver *drv) | ||
188 | { | ||
189 | struct pci_dev *pdev; | ||
190 | struct pci_device_id *pcid; | ||
191 | uint16_t subvendor, subdevice; | ||
192 | int board_count = 0; | ||
193 | |||
194 | /* walk the global pci device list looking for matches */ | ||
195 | for (pdev = pci_devices; pdev && (board_count < PCI_MAX_NUM_NICS); pdev = pdev->next) { | ||
196 | |||
197 | pcid = &drv->id_table[0]; | ||
198 | pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &subvendor); | ||
199 | pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &subdevice); | ||
200 | |||
201 | while (pcid->vendor != 0) { | ||
202 | if (((pcid->vendor == pdev->vendor) || (pcid->vendor == PCI_ANY_ID)) && | ||
203 | ((pcid->device == pdev->device) || (pcid->device == PCI_ANY_ID)) && | ||
204 | ((pcid->subvendor == subvendor) || (pcid->subvendor == PCI_ANY_ID)) && | ||
205 | ((pcid->subdevice == subdevice) || (pcid->subdevice == PCI_ANY_ID))) { | ||
206 | |||
207 | if (drv->probe(pdev, pcid) == 0) { | ||
208 | drv->pcimap[board_count] = pdev; | ||
209 | board_count++; | ||
210 | } | ||
211 | break; | ||
212 | } | ||
213 | pcid++; | ||
214 | } | ||
215 | } | ||
216 | |||
217 | if (board_count < PCI_MAX_NUM_NICS) { | ||
218 | drv->pcimap[board_count] = NULL; | ||
219 | } | ||
220 | |||
221 | return (board_count > 0) ? 0 : -ENODEV; | ||
222 | } | ||
223 | |||
224 | static inline void pci_unregister_driver(struct pci_driver *drv) | ||
225 | { | ||
226 | int i; | ||
227 | |||
228 | for (i = 0; i < PCI_MAX_NUM_NICS; i++) { | ||
229 | if (!drv->pcimap[i]) | ||
230 | break; | ||
231 | |||
232 | drv->remove(drv->pcimap[i]); | ||
233 | } | ||
234 | } | ||
235 | |||
236 | |||
237 | #define pci_set_drvdata(pcid, data) | ||
238 | |||
239 | #define pci_get_drvdata(pcid) ({ \ | ||
240 | PSDevice pInfo; \ | ||
241 | for (pInfo = pDevice_Infos; \ | ||
242 | pInfo; pInfo = pInfo->next) { \ | ||
243 | if (pInfo->pcid == pcid) \ | ||
244 | break; \ | ||
245 | } \ | ||
246 | pInfo; }) | ||
247 | |||
248 | #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) */ | ||
249 | |||
250 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,5) | ||
251 | |||
252 | #define skb_linearize(skb, gfp_mask) ({ \ | ||
253 | struct sk_buff *tmp_skb; \ | ||
254 | tmp_skb = skb; \ | ||
255 | skb = skb_copy(tmp_skb, gfp_mask); \ | ||
256 | dev_kfree_skb_irq(tmp_skb); }) | ||
257 | |||
258 | #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,4,5) */ | ||
259 | 77 | ||
260 | #ifndef MODULE_LICESEN | 78 | #ifndef MODULE_LICESEN |
261 | #define MODULE_LICESEN(x) | 79 | #define MODULE_LICESEN(x) |
262 | #endif | 80 | #endif |
263 | 81 | ||
264 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,6) | ||
265 | |||
266 | #include <linux/types.h> | ||
267 | #include <linux/pci.h> | ||
268 | |||
269 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,2) | ||
270 | static inline int pci_set_power_state(struct pci_dev* pcid, int state) { return 0; } | ||
271 | #endif | ||
272 | |||
273 | #define PMCSR 0xe0 | ||
274 | #define PM_ENABLE_BIT 0x0100 | ||
275 | #define PM_CLEAR_BIT 0x8000 | ||
276 | #define PM_STATE_MASK 0xFFFC | ||
277 | #define PM_STATE_D1 0x0001 | ||
278 | |||
279 | static inline int | ||
280 | pci_enable_wake(struct pci_dev *dev, u32 state, int enable) | ||
281 | { | ||
282 | u16 p_state; | ||
283 | |||
284 | pci_read_config_word(dev, PMCSR, &p_state); | ||
285 | pci_write_config_word(dev, PMCSR, p_state | PM_CLEAR_BIT); | ||
286 | |||
287 | if (enable == 0) { | ||
288 | p_state &= ~PM_ENABLE_BIT; | ||
289 | } else { | ||
290 | p_state |= PM_ENABLE_BIT; | ||
291 | } | ||
292 | p_state &= PM_STATE_MASK; | ||
293 | p_state |= state; | ||
294 | |||
295 | pci_write_config_word(dev, PMCSR, p_state); | ||
296 | |||
297 | return 0; | ||
298 | } | ||
299 | #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,4,6) */ | ||
300 | 82 | ||
301 | #endif | 83 | #endif |
302 | 84 | ||
diff --git a/drivers/staging/vt6655/wmgr.c b/drivers/staging/vt6655/wmgr.c index c5f52e990bd6..c0886edac789 100644 --- a/drivers/staging/vt6655/wmgr.c +++ b/drivers/staging/vt6655/wmgr.c | |||
@@ -1125,11 +1125,7 @@ s_vMgrRxAssocResponse( | |||
1125 | ); | 1125 | ); |
1126 | skb_put(pDevice->skb, sizeof(viawget_wpa_header) + wpahdr->resp_ie_len + wpahdr->req_ie_len); | 1126 | skb_put(pDevice->skb, sizeof(viawget_wpa_header) + wpahdr->resp_ie_len + wpahdr->req_ie_len); |
1127 | pDevice->skb->dev = pDevice->wpadev; | 1127 | pDevice->skb->dev = pDevice->wpadev; |
1128 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,21) | 1128 | pDevice->skb->mac_header = pDevice->skb->data; |
1129 | pDevice->skb->mac_header = pDevice->skb->data; | ||
1130 | #else | ||
1131 | pDevice->skb->mac.raw = pDevice->skb->data; | ||
1132 | #endif | ||
1133 | pDevice->skb->pkt_type = PACKET_HOST; | 1129 | pDevice->skb->pkt_type = PACKET_HOST; |
1134 | pDevice->skb->protocol = htons(ETH_P_802_2); | 1130 | pDevice->skb->protocol = htons(ETH_P_802_2); |
1135 | memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); | 1131 | memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); |
@@ -1765,11 +1761,7 @@ s_vMgrRxDisassociation( | |||
1765 | wpahdr->req_ie_len = 0; | 1761 | wpahdr->req_ie_len = 0; |
1766 | skb_put(pDevice->skb, sizeof(viawget_wpa_header)); | 1762 | skb_put(pDevice->skb, sizeof(viawget_wpa_header)); |
1767 | pDevice->skb->dev = pDevice->wpadev; | 1763 | pDevice->skb->dev = pDevice->wpadev; |
1768 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,21) | ||
1769 | pDevice->skb->mac_header = pDevice->skb->data; | 1764 | pDevice->skb->mac_header = pDevice->skb->data; |
1770 | #else | ||
1771 | pDevice->skb->mac.raw = pDevice->skb->data; | ||
1772 | #endif | ||
1773 | 1765 | ||
1774 | pDevice->skb->pkt_type = PACKET_HOST; | 1766 | pDevice->skb->pkt_type = PACKET_HOST; |
1775 | pDevice->skb->protocol = htons(ETH_P_802_2); | 1767 | pDevice->skb->protocol = htons(ETH_P_802_2); |
@@ -1857,11 +1849,7 @@ s_vMgrRxDeauthentication( | |||
1857 | wpahdr->req_ie_len = 0; | 1849 | wpahdr->req_ie_len = 0; |
1858 | skb_put(pDevice->skb, sizeof(viawget_wpa_header)); | 1850 | skb_put(pDevice->skb, sizeof(viawget_wpa_header)); |
1859 | pDevice->skb->dev = pDevice->wpadev; | 1851 | pDevice->skb->dev = pDevice->wpadev; |
1860 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,21) | 1852 | pDevice->skb->mac_header = pDevice->skb->data; |
1861 | pDevice->skb->mac_header = pDevice->skb->data; | ||
1862 | #else | ||
1863 | pDevice->skb->mac.raw = pDevice->skb->data; | ||
1864 | #endif | ||
1865 | pDevice->skb->pkt_type = PACKET_HOST; | 1853 | pDevice->skb->pkt_type = PACKET_HOST; |
1866 | pDevice->skb->protocol = htons(ETH_P_802_2); | 1854 | pDevice->skb->protocol = htons(ETH_P_802_2); |
1867 | memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); | 1855 | memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb)); |