diff options
-rw-r--r-- | drivers/staging/wlags49_h2/dhf.c | 14 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_cs.c | 30 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_cs.h | 4 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_internal.h | 8 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_netdev.c | 27 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_wext.c | 7 |
6 files changed, 14 insertions, 76 deletions
diff --git a/drivers/staging/wlags49_h2/dhf.c b/drivers/staging/wlags49_h2/dhf.c index 80a4707885d..bb80b547cc1 100644 --- a/drivers/staging/wlags49_h2/dhf.c +++ b/drivers/staging/wlags49_h2/dhf.c | |||
@@ -109,20 +109,6 @@ | |||
109 | /* 12345678901234 */ | 109 | /* 12345678901234 */ |
110 | char signature[14] = "FUPU7D37dhfwci"; | 110 | char signature[14] = "FUPU7D37dhfwci"; |
111 | 111 | ||
112 | /* The binary download function "relocates" the image using constructions like: | ||
113 | fw->identity = (CFG_IDENTITY_STRCT FAR *)((char FAR *)fw->identity + (hcf_32)fw ); | ||
114 | under some of the memory models under MSVC 1.52 these constructions degrade to 16-bits pointer arithmetic. | ||
115 | fw->identity is limited, such that adding it to fw, does not need to carry over from offset to segment. | ||
116 | However the segment is not set at all. | ||
117 | As a workaround the PSEUDO_CHARP macro is introduced which is a char pointer except for MSVC 1.52, in | ||
118 | which case we know that a 32-bit quantity is adequate as a pointer. | ||
119 | Note that other platforms may experience comparable problems when using the binary download feature. */ | ||
120 | #if defined(_MSC_VER) && _MSC_VER == 800 /* Visual C++ 1.5 */ | ||
121 | #define PSEUDO_CHARP hcf_32 | ||
122 | #else | ||
123 | #define PSEUDO_CHARP (hcf_8 *) | ||
124 | #endif | ||
125 | |||
126 | /*----------------------------------------------------------------------------- | 112 | /*----------------------------------------------------------------------------- |
127 | * | 113 | * |
128 | * LTV-records retrieved from the NIC to: | 114 | * LTV-records retrieved from the NIC to: |
diff --git a/drivers/staging/wlags49_h2/wl_cs.c b/drivers/staging/wlags49_h2/wl_cs.c index 7c33eade6b8..568993f3ffe 100644 --- a/drivers/staging/wlags49_h2/wl_cs.c +++ b/drivers/staging/wlags49_h2/wl_cs.c | |||
@@ -105,13 +105,6 @@ | |||
105 | 105 | ||
106 | 106 | ||
107 | /******************************************************************************* | 107 | /******************************************************************************* |
108 | * macro definitions | ||
109 | ******************************************************************************/ | ||
110 | #define CS_CHECK(fn, ret) do { \ | ||
111 | last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \ | ||
112 | } while (0) | ||
113 | |||
114 | /******************************************************************************* | ||
115 | * global definitions | 108 | * global definitions |
116 | ******************************************************************************/ | 109 | ******************************************************************************/ |
117 | #if DBG | 110 | #if DBG |
@@ -305,7 +298,7 @@ void wl_adapter_insert( struct pcmcia_device *link ) | |||
305 | { | 298 | { |
306 | struct net_device *dev; | 299 | struct net_device *dev; |
307 | int i; | 300 | int i; |
308 | int last_fn, last_ret; | 301 | int ret; |
309 | /*------------------------------------------------------------------------*/ | 302 | /*------------------------------------------------------------------------*/ |
310 | 303 | ||
311 | DBG_FUNC( "wl_adapter_insert" ); | 304 | DBG_FUNC( "wl_adapter_insert" ); |
@@ -317,10 +310,17 @@ void wl_adapter_insert( struct pcmcia_device *link ) | |||
317 | /* Do we need to allocate an interrupt? */ | 310 | /* Do we need to allocate an interrupt? */ |
318 | link->conf.Attributes |= CONF_ENABLE_IRQ; | 311 | link->conf.Attributes |= CONF_ENABLE_IRQ; |
319 | 312 | ||
320 | // CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); | 313 | ret = pcmcia_request_io(link, &link->io); |
321 | // CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); | 314 | if (ret != 0) |
322 | // CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); | 315 | goto failed; |
316 | |||
317 | ret = pcmcia_request_irq(link, (void *) wl_isr); | ||
318 | if (ret != 0) | ||
319 | goto failed; | ||
323 | 320 | ||
321 | ret = pcmcia_request_configuration(link, &link->conf); | ||
322 | if (ret != 0) | ||
323 | goto failed; | ||
324 | 324 | ||
325 | dev->irq = link->irq.AssignedIRQ; | 325 | dev->irq = link->irq.AssignedIRQ; |
326 | dev->base_addr = link->io.BasePort1; | 326 | dev->base_addr = link->io.BasePort1; |
@@ -330,8 +330,7 @@ void wl_adapter_insert( struct pcmcia_device *link ) | |||
330 | printk("%s: register_netdev() failed\n", MODULE_NAME); | 330 | printk("%s: register_netdev() failed\n", MODULE_NAME); |
331 | goto failed; | 331 | goto failed; |
332 | } | 332 | } |
333 | link->dev_node = &( wl_priv(dev) )->node; | 333 | |
334 | strcpy(( wl_priv(dev) )->node.dev_name, dev->name); | ||
335 | register_wlags_sysfs(dev); | 334 | register_wlags_sysfs(dev); |
336 | 335 | ||
337 | printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ", | 336 | printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ", |
@@ -343,11 +342,6 @@ void wl_adapter_insert( struct pcmcia_device *link ) | |||
343 | DBG_LEAVE( DbgInfo ); | 342 | DBG_LEAVE( DbgInfo ); |
344 | return; | 343 | return; |
345 | 344 | ||
346 | |||
347 | cs_failed: | ||
348 | // cs_error( link, last_fn, last_ret ); | ||
349 | |||
350 | |||
351 | failed: | 345 | failed: |
352 | wl_adapter_release( link ); | 346 | wl_adapter_release( link ); |
353 | 347 | ||
diff --git a/drivers/staging/wlags49_h2/wl_cs.h b/drivers/staging/wlags49_h2/wl_cs.h index 2a0e67450fb..a9b8828a1a2 100644 --- a/drivers/staging/wlags49_h2/wl_cs.h +++ b/drivers/staging/wlags49_h2/wl_cs.h | |||
@@ -84,10 +84,6 @@ int wl_adapter_close(struct net_device *dev); | |||
84 | 84 | ||
85 | int wl_adapter_is_open(struct net_device *dev); | 85 | int wl_adapter_is_open(struct net_device *dev); |
86 | 86 | ||
87 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) | ||
88 | void cs_error(client_handle_t handle, int func, int ret); | ||
89 | #endif | ||
90 | |||
91 | const char *DbgEvent( int mask ); | 87 | const char *DbgEvent( int mask ); |
92 | 88 | ||
93 | 89 | ||
diff --git a/drivers/staging/wlags49_h2/wl_internal.h b/drivers/staging/wlags49_h2/wl_internal.h index 466fb6215ac..d9a0ad039c1 100644 --- a/drivers/staging/wlags49_h2/wl_internal.h +++ b/drivers/staging/wlags49_h2/wl_internal.h | |||
@@ -69,9 +69,6 @@ | |||
69 | ******************************************************************************/ | 69 | ******************************************************************************/ |
70 | #include <linux/version.h> | 70 | #include <linux/version.h> |
71 | #ifdef BUS_PCMCIA | 71 | #ifdef BUS_PCMCIA |
72 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) | ||
73 | #include <pcmcia/version.h> | ||
74 | #endif | ||
75 | #include <pcmcia/cs_types.h> | 72 | #include <pcmcia/cs_types.h> |
76 | #include <pcmcia/cs.h> | 73 | #include <pcmcia/cs.h> |
77 | #include <pcmcia/cistpl.h> | 74 | #include <pcmcia/cistpl.h> |
@@ -866,7 +863,6 @@ struct wl_private | |||
866 | { | 863 | { |
867 | 864 | ||
868 | #ifdef BUS_PCMCIA | 865 | #ifdef BUS_PCMCIA |
869 | dev_node_t node; | ||
870 | struct pcmcia_device *link; | 866 | struct pcmcia_device *link; |
871 | #endif // BUS_PCMCIA | 867 | #endif // BUS_PCMCIA |
872 | 868 | ||
@@ -1013,13 +1009,13 @@ extern inline struct wl_private *wl_priv(struct net_device *dev) | |||
1013 | * SPARC, due to its weird semantics for save/restore flags. extern | 1009 | * SPARC, due to its weird semantics for save/restore flags. extern |
1014 | * inline should prevent the kernel from linking or module from | 1010 | * inline should prevent the kernel from linking or module from |
1015 | * loading if they are not inlined. */ | 1011 | * loading if they are not inlined. */ |
1016 | extern inline void wl_lock(struct wl_private *lp, | 1012 | static inline void wl_lock(struct wl_private *lp, |
1017 | unsigned long *flags) | 1013 | unsigned long *flags) |
1018 | { | 1014 | { |
1019 | spin_lock_irqsave(&lp->slock, *flags); | 1015 | spin_lock_irqsave(&lp->slock, *flags); |
1020 | } | 1016 | } |
1021 | 1017 | ||
1022 | extern inline void wl_unlock(struct wl_private *lp, | 1018 | static inline void wl_unlock(struct wl_private *lp, |
1023 | unsigned long *flags) | 1019 | unsigned long *flags) |
1024 | { | 1020 | { |
1025 | spin_unlock_irqrestore(&lp->slock, *flags); | 1021 | spin_unlock_irqrestore(&lp->slock, *flags); |
diff --git a/drivers/staging/wlags49_h2/wl_netdev.c b/drivers/staging/wlags49_h2/wl_netdev.c index 1cfaee3a235..91fd3092b47 100644 --- a/drivers/staging/wlags49_h2/wl_netdev.c +++ b/drivers/staging/wlags49_h2/wl_netdev.c | |||
@@ -463,15 +463,10 @@ static void wl_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | |||
463 | // strncpy(info.fw_version, priv->fw_name, | 463 | // strncpy(info.fw_version, priv->fw_name, |
464 | // sizeof(info.fw_version) - 1); | 464 | // sizeof(info.fw_version) - 1); |
465 | 465 | ||
466 | #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)) | ||
467 | if (dev->dev.parent) { | 466 | if (dev->dev.parent) { |
468 | dev_set_name(dev->dev.parent, "%s", info->bus_info); | 467 | dev_set_name(dev->dev.parent, "%s", info->bus_info); |
469 | //strncpy(info->bus_info, dev->dev.parent->bus_id, | 468 | //strncpy(info->bus_info, dev->dev.parent->bus_id, |
470 | // sizeof(info->bus_info) - 1); | 469 | // sizeof(info->bus_info) - 1); |
471 | #else | ||
472 | if (dev->class_dev.parent) { | ||
473 | sizeof(info->bus_info) - 1); | ||
474 | #endif | ||
475 | } else { | 470 | } else { |
476 | snprintf(info->bus_info, sizeof(info->bus_info) - 1, | 471 | snprintf(info->bus_info, sizeof(info->bus_info) - 1, |
477 | "PCMCIA FIXME"); | 472 | "PCMCIA FIXME"); |
@@ -1179,7 +1174,6 @@ void wl_multicast( struct net_device *dev, int num_addrs, void *addrs ) | |||
1179 | 1174 | ||
1180 | #endif /* NEW_MULTICAST */ | 1175 | #endif /* NEW_MULTICAST */ |
1181 | 1176 | ||
1182 | #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)) | ||
1183 | static const struct net_device_ops wl_netdev_ops = | 1177 | static const struct net_device_ops wl_netdev_ops = |
1184 | { | 1178 | { |
1185 | .ndo_start_xmit = &wl_tx_port0, | 1179 | .ndo_start_xmit = &wl_tx_port0, |
@@ -1199,7 +1193,6 @@ static const struct net_device_ops wl_netdev_ops = | |||
1199 | .ndo_poll_controller = wl_poll, | 1193 | .ndo_poll_controller = wl_poll, |
1200 | #endif | 1194 | #endif |
1201 | }; | 1195 | }; |
1202 | #endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)) | ||
1203 | 1196 | ||
1204 | /******************************************************************************* | 1197 | /******************************************************************************* |
1205 | * wl_device_alloc() | 1198 | * wl_device_alloc() |
@@ -1253,27 +1246,7 @@ struct net_device * wl_device_alloc( void ) | |||
1253 | lp->wireless_data.spy_data = &lp->spy_data; | 1246 | lp->wireless_data.spy_data = &lp->spy_data; |
1254 | dev->wireless_data = &lp->wireless_data; | 1247 | dev->wireless_data = &lp->wireless_data; |
1255 | 1248 | ||
1256 | #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)) | ||
1257 | dev->netdev_ops = &wl_netdev_ops; | 1249 | dev->netdev_ops = &wl_netdev_ops; |
1258 | #else | ||
1259 | dev->hard_start_xmit = &wl_tx_port0; | ||
1260 | |||
1261 | dev->set_config = &wl_config; | ||
1262 | dev->get_stats = &wl_stats; | ||
1263 | dev->set_multicast_list = &wl_multicast; | ||
1264 | |||
1265 | dev->init = &wl_insert; | ||
1266 | dev->open = &wl_adapter_open; | ||
1267 | dev->stop = &wl_adapter_close; | ||
1268 | dev->do_ioctl = &wl_ioctl; | ||
1269 | |||
1270 | dev->tx_timeout = &wl_tx_timeout; | ||
1271 | |||
1272 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1273 | dev->poll_controller = wl_poll; | ||
1274 | #endif | ||
1275 | |||
1276 | #endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)) | ||
1277 | 1250 | ||
1278 | dev->watchdog_timeo = TX_TIMEOUT; | 1251 | dev->watchdog_timeo = TX_TIMEOUT; |
1279 | 1252 | ||
diff --git a/drivers/staging/wlags49_h2/wl_wext.c b/drivers/staging/wlags49_h2/wl_wext.c index 311d3c5a2ef..06467f1bf90 100644 --- a/drivers/staging/wlags49_h2/wl_wext.c +++ b/drivers/staging/wlags49_h2/wl_wext.c | |||
@@ -82,17 +82,10 @@ | |||
82 | in the build. */ | 82 | in the build. */ |
83 | #ifdef WIRELESS_EXT | 83 | #ifdef WIRELESS_EXT |
84 | 84 | ||
85 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) | ||
86 | #define IWE_STREAM_ADD_EVENT(info, buf, end, iwe, len) \ | ||
87 | iwe_stream_add_event(buf, end, iwe, len) | ||
88 | #define IWE_STREAM_ADD_POINT(info, buf, end, iwe, msg) \ | ||
89 | iwe_stream_add_point(buf, end, iwe, msg) | ||
90 | #else | ||
91 | #define IWE_STREAM_ADD_EVENT(info, buf, end, iwe, len) \ | 85 | #define IWE_STREAM_ADD_EVENT(info, buf, end, iwe, len) \ |
92 | iwe_stream_add_event(info, buf, end, iwe, len) | 86 | iwe_stream_add_event(info, buf, end, iwe, len) |
93 | #define IWE_STREAM_ADD_POINT(info, buf, end, iwe, msg) \ | 87 | #define IWE_STREAM_ADD_POINT(info, buf, end, iwe, msg) \ |
94 | iwe_stream_add_point(info, buf, end, iwe, msg) | 88 | iwe_stream_add_point(info, buf, end, iwe, msg) |
95 | #endif | ||
96 | 89 | ||
97 | 90 | ||
98 | 91 | ||