BEginnings of 2.6.16+ support for prism2_cs.

It complies now, at least.. although it doesn't actually do anything.

That comes next.
This commit is contained in:
pizza 2006-07-22 15:28:54 +00:00
parent 41c5ea642f
commit 073ae5f238
3 changed files with 84 additions and 87 deletions

View File

@ -41,6 +41,7 @@
* Intersil Corporation as part of PRISM(R) chipset product development.
*
* --------------------------------------------------------------------
- Beginnings of prism2_cs support for 2.6.16+
- Makefile fixes for 2.6.17+
- udev support for USB targets (Richard Kennedy)
- semaphores are deprecated as of 2.6.16 (Chris Rankin)

View File

@ -21,13 +21,10 @@ static u_int prism2_ignorevcc=0; /* Boolean, if set, we
* is set to and what the CIS
* says.
*/
module_param( prism2_ignorevcc, int, 0644);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) )
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,27))
MODULE_PARM( irq_mask, "i");
MODULE_PARM( irq_list, "1-4i");
MODULE_PARM( prism2_ignorevcc, "i");
#else
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,8))
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,9))
static int numlist = 4;
module_param_array(irq_list, int, numlist, 0444);
#else
@ -35,17 +32,17 @@ module_param_array(irq_list, int, NULL, 0444);
#endif
module_param( irq_mask, int, 0644);
#endif
#endif
static dev_link_t *dev_list = NULL; /* head of instance list */
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
dev_link_t *prism2sta_attach(void);
static void prism2sta_detach(dev_link_t *link);
static void prism2sta_config(dev_link_t *link);
static void prism2sta_release(u_long arg);
static int prism2sta_event (event_t event, int priority, event_callback_args_t *args);
static dev_link_t *dev_list = NULL; /* head of instance list */
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68))
/*----------------------------------------------------------------
* cs_error
@ -140,16 +137,21 @@ static struct pcmcia_driver prism2_cs_driver = {
.drv = {
.name = "prism2_cs",
},
.owner = THIS_MODULE,
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
// XXXX probe, remove, suspend, resume
#else
.attach = prism2sta_attach,
.detach = prism2sta_detach,
.owner = THIS_MODULE,
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12)
.id_table = prism2_cs_ids,
.event = prism2sta_event,
#endif
.event = prism2sta_event,
#endif // > 2.6.12
#endif // <= 2.6.15
};
#endif /* kernel_version */
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
/*----------------------------------------------------------------
* prism2sta_attach
*
@ -203,9 +205,6 @@ dev_link_t *prism2sta_attach(void)
hfa384x_create(hw, 0, 0, NULL);
hw->wlandev = wlandev;
/* Initialize the device private data stucture. */
hw->cs_link = link;
/* Initialize the PC card device object. */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
init_timer(&link->release);
@ -361,7 +360,6 @@ void prism2sta_detach(dev_link_t *link)
return;
}
/*----------------------------------------------------------------
* prism2sta_config
*
@ -633,8 +631,6 @@ failed:
return;
}
/*----------------------------------------------------------------
* prism2sta_release
*
@ -693,8 +689,6 @@ void prism2sta_release(u_long arg)
DBFEXIT;
}
/*----------------------------------------------------------------
* prism2sta_event
*
@ -833,71 +827,6 @@ prism2sta_event (
return 0; /* noone else does anthing with the return value */
}
#ifdef MODULE
static int __init prism2cs_init(void)
{
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68))
servinfo_t serv;
#endif
DBFENTER;
WLAN_LOG_NOTICE("%s Loaded\n", version);
WLAN_LOG_NOTICE("dev_info is: %s\n", dev_info);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68))
pcmcia_get_card_services_info(&serv);
if ( serv.Revision != CS_RELEASE_CODE )
{
printk(KERN_NOTICE"%s: CardServices release does not match!\n", dev_info);
return -1;
}
/* This call will result in a call to prism2sta_attach */
/* and eventually prism2sta_detach */
register_pccard_driver( &dev_info, &prism2sta_attach, &prism2sta_detach);
#else
pcmcia_register_driver(&prism2_cs_driver);
#endif
DBFEXIT;
return 0;
}
static void __exit prism2cs_cleanup(void)
{
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68))
dev_link_t *link = dev_list;
dev_link_t *nlink;
DBFENTER;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) )
for (link=dev_list; link != NULL; link = nlink) {
nlink = link->next;
if ( link->state & DEV_CONFIG ) {
prism2sta_release((u_long)link);
}
prism2sta_detach(link); /* remember detach() frees link */
}
#endif
unregister_pccard_driver( &dev_info);
#else
pcmcia_unregister_driver(&prism2_cs_driver);
#endif
printk(KERN_NOTICE "%s Unloaded\n", version);
DBFEXIT;
return;
}
module_init(prism2cs_init);
module_exit(prism2cs_cleanup);
#endif // MODULE
int hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis)
{
@ -995,3 +924,71 @@ done:
DBFEXIT;
return result;
}
#endif // <= 2.6.15
#ifdef MODULE
static int __init prism2cs_init(void)
{
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68))
servinfo_t serv;
#endif
DBFENTER;
WLAN_LOG_NOTICE("%s Loaded\n", version);
WLAN_LOG_NOTICE("dev_info is: %s\n", dev_info);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68))
pcmcia_get_card_services_info(&serv);
if ( serv.Revision != CS_RELEASE_CODE )
{
printk(KERN_NOTICE"%s: CardServices release does not match!\n", dev_info);
return -1;
}
/* This call will result in a call to prism2sta_attach */
/* and eventually prism2sta_detach */
register_pccard_driver( &dev_info, &prism2sta_attach, &prism2sta_detach);
#else
pcmcia_register_driver(&prism2_cs_driver);
#endif
DBFEXIT;
return 0;
}
static void __exit prism2cs_cleanup(void)
{
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68))
dev_link_t *link = dev_list;
dev_link_t *nlink;
DBFENTER;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) )
for (link=dev_list; link != NULL; link = nlink) {
nlink = link->next;
if ( link->state & DEV_CONFIG ) {
prism2sta_release((u_long)link);
}
prism2sta_detach(link); /* remember detach() frees link */
}
#endif
unregister_pccard_driver( &dev_info);
#else
pcmcia_unregister_driver(&prism2_cs_driver);
#endif
printk(KERN_NOTICE "%s Unloaded\n", version);
DBFEXIT;
return;
}
module_init(prism2cs_init);
module_exit(prism2cs_cleanup);
#endif // MODULE

View File

@ -2564,7 +2564,6 @@ typedef struct hfa384x
#if (WLAN_HOSTIF == WLAN_PCMCIA)
dev_node_t node;
dev_link_t *cs_link;
#endif
int sniff_fcs;