Commit 93822ad1 authored by Henk de Groot's avatar Henk de Groot Committed by Greg Kroah-Hartman

Staging: wlags49_hs2: Fix wlags49_hs2 driver after build fixes broke it

Fixes the driver after merge into the 2.6.34 kernel. Driver should
be functional again (a fix to make it compile broke the driver).

Patch against 2.6.34 RC7 with patch-v2.6.34-rc7-next-20100513
already applied.

Removed conditional code based on kernel version, this is pointless
now the driver is part of the kernel. Also removed obsolte code
left over from previous patches. Includes also small fixes to compile
clean again.
Signed-off-by: default avatarHenk de Groot <pe1dnn@amsat.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 97a06382
...@@ -109,20 +109,6 @@ ...@@ -109,20 +109,6 @@
/* 12345678901234 */ /* 12345678901234 */
char signature[14] = "FUPU7D37dhfwci"; char signature[14] = "FUPU7D37dhfwci";
/* The binary download function "relocates" the image using constructions like:
fw->identity = (CFG_IDENTITY_STRCT FAR *)((char FAR *)fw->identity + (hcf_32)fw );
under some of the memory models under MSVC 1.52 these constructions degrade to 16-bits pointer arithmetic.
fw->identity is limited, such that adding it to fw, does not need to carry over from offset to segment.
However the segment is not set at all.
As a workaround the PSEUDO_CHARP macro is introduced which is a char pointer except for MSVC 1.52, in
which case we know that a 32-bit quantity is adequate as a pointer.
Note that other platforms may experience comparable problems when using the binary download feature. */
#if defined(_MSC_VER) && _MSC_VER == 800 /* Visual C++ 1.5 */
#define PSEUDO_CHARP hcf_32
#else
#define PSEUDO_CHARP (hcf_8 *)
#endif
/*----------------------------------------------------------------------------- /*-----------------------------------------------------------------------------
* *
* LTV-records retrieved from the NIC to: * LTV-records retrieved from the NIC to:
......
...@@ -104,13 +104,6 @@ ...@@ -104,13 +104,6 @@
#include <wl_sysfs.h> #include <wl_sysfs.h>
/*******************************************************************************
* macro definitions
******************************************************************************/
#define CS_CHECK(fn, ret) do { \
last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \
} while (0)
/******************************************************************************* /*******************************************************************************
* global definitions * global definitions
******************************************************************************/ ******************************************************************************/
...@@ -305,7 +298,7 @@ void wl_adapter_insert( struct pcmcia_device *link ) ...@@ -305,7 +298,7 @@ void wl_adapter_insert( struct pcmcia_device *link )
{ {
struct net_device *dev; struct net_device *dev;
int i; int i;
int last_fn, last_ret; int ret;
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
DBG_FUNC( "wl_adapter_insert" ); DBG_FUNC( "wl_adapter_insert" );
...@@ -317,10 +310,17 @@ void wl_adapter_insert( struct pcmcia_device *link ) ...@@ -317,10 +310,17 @@ void wl_adapter_insert( struct pcmcia_device *link )
/* Do we need to allocate an interrupt? */ /* Do we need to allocate an interrupt? */
link->conf.Attributes |= CONF_ENABLE_IRQ; link->conf.Attributes |= CONF_ENABLE_IRQ;
// CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); ret = pcmcia_request_io(link, &link->io);
// CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); if (ret != 0)
// CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); goto failed;
ret = pcmcia_request_irq(link, (void *) wl_isr);
if (ret != 0)
goto failed;
ret = pcmcia_request_configuration(link, &link->conf);
if (ret != 0)
goto failed;
dev->irq = link->irq.AssignedIRQ; dev->irq = link->irq.AssignedIRQ;
dev->base_addr = link->io.BasePort1; dev->base_addr = link->io.BasePort1;
...@@ -330,8 +330,7 @@ void wl_adapter_insert( struct pcmcia_device *link ) ...@@ -330,8 +330,7 @@ void wl_adapter_insert( struct pcmcia_device *link )
printk("%s: register_netdev() failed\n", MODULE_NAME); printk("%s: register_netdev() failed\n", MODULE_NAME);
goto failed; goto failed;
} }
link->dev_node = &( wl_priv(dev) )->node;
strcpy(( wl_priv(dev) )->node.dev_name, dev->name);
register_wlags_sysfs(dev); register_wlags_sysfs(dev);
printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ", 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,11 +342,6 @@ void wl_adapter_insert( struct pcmcia_device *link )
DBG_LEAVE( DbgInfo ); DBG_LEAVE( DbgInfo );
return; return;
cs_failed:
// cs_error( link, last_fn, last_ret );
failed: failed:
wl_adapter_release( link ); wl_adapter_release( link );
......
...@@ -84,10 +84,6 @@ int wl_adapter_close(struct net_device *dev); ...@@ -84,10 +84,6 @@ int wl_adapter_close(struct net_device *dev);
int wl_adapter_is_open(struct net_device *dev); int wl_adapter_is_open(struct net_device *dev);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
void cs_error(client_handle_t handle, int func, int ret);
#endif
const char *DbgEvent( int mask ); const char *DbgEvent( int mask );
......
...@@ -69,9 +69,6 @@ ...@@ -69,9 +69,6 @@
******************************************************************************/ ******************************************************************************/
#include <linux/version.h> #include <linux/version.h>
#ifdef BUS_PCMCIA #ifdef BUS_PCMCIA
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
#include <pcmcia/version.h>
#endif
#include <pcmcia/cs_types.h> #include <pcmcia/cs_types.h>
#include <pcmcia/cs.h> #include <pcmcia/cs.h>
#include <pcmcia/cistpl.h> #include <pcmcia/cistpl.h>
...@@ -866,7 +863,6 @@ struct wl_private ...@@ -866,7 +863,6 @@ struct wl_private
{ {
#ifdef BUS_PCMCIA #ifdef BUS_PCMCIA
dev_node_t node;
struct pcmcia_device *link; struct pcmcia_device *link;
#endif // BUS_PCMCIA #endif // BUS_PCMCIA
...@@ -1013,13 +1009,13 @@ extern inline struct wl_private *wl_priv(struct net_device *dev) ...@@ -1013,13 +1009,13 @@ extern inline struct wl_private *wl_priv(struct net_device *dev)
* SPARC, due to its weird semantics for save/restore flags. extern * SPARC, due to its weird semantics for save/restore flags. extern
* inline should prevent the kernel from linking or module from * inline should prevent the kernel from linking or module from
* loading if they are not inlined. */ * loading if they are not inlined. */
extern inline void wl_lock(struct wl_private *lp, static inline void wl_lock(struct wl_private *lp,
unsigned long *flags) unsigned long *flags)
{ {
spin_lock_irqsave(&lp->slock, *flags); spin_lock_irqsave(&lp->slock, *flags);
} }
extern inline void wl_unlock(struct wl_private *lp, static inline void wl_unlock(struct wl_private *lp,
unsigned long *flags) unsigned long *flags)
{ {
spin_unlock_irqrestore(&lp->slock, *flags); spin_unlock_irqrestore(&lp->slock, *flags);
......
...@@ -463,15 +463,10 @@ static void wl_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) ...@@ -463,15 +463,10 @@ static void wl_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
// strncpy(info.fw_version, priv->fw_name, // strncpy(info.fw_version, priv->fw_name,
// sizeof(info.fw_version) - 1); // sizeof(info.fw_version) - 1);
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20))
if (dev->dev.parent) { if (dev->dev.parent) {
dev_set_name(dev->dev.parent, "%s", info->bus_info); dev_set_name(dev->dev.parent, "%s", info->bus_info);
//strncpy(info->bus_info, dev->dev.parent->bus_id, //strncpy(info->bus_info, dev->dev.parent->bus_id,
// sizeof(info->bus_info) - 1); // sizeof(info->bus_info) - 1);
#else
if (dev->class_dev.parent) {
sizeof(info->bus_info) - 1);
#endif
} else { } else {
snprintf(info->bus_info, sizeof(info->bus_info) - 1, snprintf(info->bus_info, sizeof(info->bus_info) - 1,
"PCMCIA FIXME"); "PCMCIA FIXME");
...@@ -1179,7 +1174,6 @@ void wl_multicast( struct net_device *dev, int num_addrs, void *addrs ) ...@@ -1179,7 +1174,6 @@ void wl_multicast( struct net_device *dev, int num_addrs, void *addrs )
#endif /* NEW_MULTICAST */ #endif /* NEW_MULTICAST */
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
static const struct net_device_ops wl_netdev_ops = static const struct net_device_ops wl_netdev_ops =
{ {
.ndo_start_xmit = &wl_tx_port0, .ndo_start_xmit = &wl_tx_port0,
...@@ -1199,7 +1193,6 @@ static const struct net_device_ops wl_netdev_ops = ...@@ -1199,7 +1193,6 @@ static const struct net_device_ops wl_netdev_ops =
.ndo_poll_controller = wl_poll, .ndo_poll_controller = wl_poll,
#endif #endif
}; };
#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
/******************************************************************************* /*******************************************************************************
* wl_device_alloc() * wl_device_alloc()
...@@ -1253,27 +1246,7 @@ struct net_device * wl_device_alloc( void ) ...@@ -1253,27 +1246,7 @@ struct net_device * wl_device_alloc( void )
lp->wireless_data.spy_data = &lp->spy_data; lp->wireless_data.spy_data = &lp->spy_data;
dev->wireless_data = &lp->wireless_data; dev->wireless_data = &lp->wireless_data;
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
dev->netdev_ops = &wl_netdev_ops; dev->netdev_ops = &wl_netdev_ops;
#else
dev->hard_start_xmit = &wl_tx_port0;
dev->set_config = &wl_config;
dev->get_stats = &wl_stats;
dev->set_multicast_list = &wl_multicast;
dev->init = &wl_insert;
dev->open = &wl_adapter_open;
dev->stop = &wl_adapter_close;
dev->do_ioctl = &wl_ioctl;
dev->tx_timeout = &wl_tx_timeout;
#ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = wl_poll;
#endif
#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
dev->watchdog_timeo = TX_TIMEOUT; dev->watchdog_timeo = TX_TIMEOUT;
......
...@@ -82,17 +82,10 @@ ...@@ -82,17 +82,10 @@
in the build. */ in the build. */
#ifdef WIRELESS_EXT #ifdef WIRELESS_EXT
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
#define IWE_STREAM_ADD_EVENT(info, buf, end, iwe, len) \
iwe_stream_add_event(buf, end, iwe, len)
#define IWE_STREAM_ADD_POINT(info, buf, end, iwe, msg) \
iwe_stream_add_point(buf, end, iwe, msg)
#else
#define IWE_STREAM_ADD_EVENT(info, buf, end, iwe, len) \ #define IWE_STREAM_ADD_EVENT(info, buf, end, iwe, len) \
iwe_stream_add_event(info, buf, end, iwe, len) iwe_stream_add_event(info, buf, end, iwe, len)
#define IWE_STREAM_ADD_POINT(info, buf, end, iwe, msg) \ #define IWE_STREAM_ADD_POINT(info, buf, end, iwe, msg) \
iwe_stream_add_point(info, buf, end, iwe, msg) iwe_stream_add_point(info, buf, end, iwe, msg)
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment