mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
[PATCH] pcmcia: unify attach, EVENT_CARD_INSERTION handlers into one probe callback
Unify the EVENT_CARD_INSERTION and "attach" callbacks to one unified probe() callback. As all in-kernel drivers are changed to this new callback, there will be no temporary backwards-compatibility. Inside a probe() function, each driver _must_ set struct pcmcia_device *p_dev->instance and instance->handle correctly. With these patches, the basic driver interface for 16-bit PCMCIA drivers now has the classic four callbacks known also from other buses: int (*probe) (struct pcmcia_device *dev); void (*remove) (struct pcmcia_device *dev); int (*suspend) (struct pcmcia_device *dev); int (*resume) (struct pcmcia_device *dev); Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
parent
b463581154
commit
f8cfa618dc
@ -1,7 +1,9 @@
|
|||||||
This file details changes in 2.6 which affect PCMCIA card driver authors:
|
This file details changes in 2.6 which affect PCMCIA card driver authors:
|
||||||
|
|
||||||
* Unify detach and REMOVAL event code (as of 2.6.16)
|
* Unify detach and REMOVAL event code, as well as attach and INSERTION
|
||||||
|
code (as of 2.6.16)
|
||||||
void (*remove) (struct pcmcia_device *dev);
|
void (*remove) (struct pcmcia_device *dev);
|
||||||
|
int (*probe) (struct pcmcia_device *dev);
|
||||||
|
|
||||||
* Move suspend, resume and reset out of event handler (as of 2.6.16)
|
* Move suspend, resume and reset out of event handler (as of 2.6.16)
|
||||||
int (*suspend) (struct pcmcia_device *dev);
|
int (*suspend) (struct pcmcia_device *dev);
|
||||||
|
@ -87,11 +87,7 @@ typedef struct bluecard_info_t {
|
|||||||
|
|
||||||
static void bluecard_config(dev_link_t *link);
|
static void bluecard_config(dev_link_t *link);
|
||||||
static void bluecard_release(dev_link_t *link);
|
static void bluecard_release(dev_link_t *link);
|
||||||
static int bluecard_event(event_t event, int priority, event_callback_args_t *args);
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "bluecard_cs";
|
|
||||||
|
|
||||||
static dev_link_t *bluecard_attach(void);
|
|
||||||
static void bluecard_detach(struct pcmcia_device *p_dev);
|
static void bluecard_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
|
|
||||||
@ -860,17 +856,15 @@ static int bluecard_close(bluecard_info_t *info)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static dev_link_t *bluecard_attach(void)
|
static int bluecard_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
bluecard_info_t *info;
|
bluecard_info_t *info;
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Create new info device */
|
/* Create new info device */
|
||||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||||
if (!info)
|
if (!info)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
|
|
||||||
link = &info->link;
|
link = &info->link;
|
||||||
link->priv = info;
|
link->priv = info;
|
||||||
@ -887,20 +881,13 @@ static dev_link_t *bluecard_attach(void)
|
|||||||
link->conf.Vcc = 50;
|
link->conf.Vcc = 50;
|
||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
if (ret != CS_SUCCESS) {
|
bluecard_config(link);
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
bluecard_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1046,20 +1033,6 @@ static int bluecard_resume(struct pcmcia_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bluecard_event(event_t event, int priority, event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
bluecard_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct pcmcia_device_id bluecard_ids[] = {
|
static struct pcmcia_device_id bluecard_ids[] = {
|
||||||
PCMCIA_DEVICE_PROD_ID12("BlueCard", "LSE041", 0xbaf16fbf, 0x657cc15e),
|
PCMCIA_DEVICE_PROD_ID12("BlueCard", "LSE041", 0xbaf16fbf, 0x657cc15e),
|
||||||
PCMCIA_DEVICE_PROD_ID12("BTCFCARD", "LSE139", 0xe3987764, 0x2524b59c),
|
PCMCIA_DEVICE_PROD_ID12("BTCFCARD", "LSE139", 0xe3987764, 0x2524b59c),
|
||||||
@ -1073,8 +1046,7 @@ static struct pcmcia_driver bluecard_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "bluecard_cs",
|
.name = "bluecard_cs",
|
||||||
},
|
},
|
||||||
.attach = bluecard_attach,
|
.probe = bluecard_attach,
|
||||||
.event = bluecard_event,
|
|
||||||
.remove = bluecard_detach,
|
.remove = bluecard_detach,
|
||||||
.id_table = bluecard_ids,
|
.id_table = bluecard_ids,
|
||||||
.suspend = bluecard_suspend,
|
.suspend = bluecard_suspend,
|
||||||
|
@ -90,11 +90,7 @@ typedef struct bt3c_info_t {
|
|||||||
|
|
||||||
static void bt3c_config(dev_link_t *link);
|
static void bt3c_config(dev_link_t *link);
|
||||||
static void bt3c_release(dev_link_t *link);
|
static void bt3c_release(dev_link_t *link);
|
||||||
static int bt3c_event(event_t event, int priority, event_callback_args_t *args);
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "bt3c_cs";
|
|
||||||
|
|
||||||
static dev_link_t *bt3c_attach(void);
|
|
||||||
static void bt3c_detach(struct pcmcia_device *p_dev);
|
static void bt3c_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
|
|
||||||
@ -661,17 +657,15 @@ static int bt3c_close(bt3c_info_t *info)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static dev_link_t *bt3c_attach(void)
|
static int bt3c_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
bt3c_info_t *info;
|
bt3c_info_t *info;
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Create new info device */
|
/* Create new info device */
|
||||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||||
if (!info)
|
if (!info)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
|
|
||||||
link = &info->link;
|
link = &info->link;
|
||||||
link->priv = info;
|
link->priv = info;
|
||||||
@ -688,20 +682,13 @@ static dev_link_t *bt3c_attach(void)
|
|||||||
link->conf.Vcc = 50;
|
link->conf.Vcc = 50;
|
||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
if (ret != CS_SUCCESS) {
|
bt3c_config(link);
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
bt3c_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -892,19 +879,6 @@ static int bt3c_resume(struct pcmcia_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bt3c_event(event_t event, int priority, event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
bt3c_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct pcmcia_device_id bt3c_ids[] = {
|
static struct pcmcia_device_id bt3c_ids[] = {
|
||||||
PCMCIA_DEVICE_PROD_ID13("3COM", "Bluetooth PC Card", 0xefce0a31, 0xd4ce9b02),
|
PCMCIA_DEVICE_PROD_ID13("3COM", "Bluetooth PC Card", 0xefce0a31, 0xd4ce9b02),
|
||||||
@ -917,8 +891,7 @@ static struct pcmcia_driver bt3c_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "bt3c_cs",
|
.name = "bt3c_cs",
|
||||||
},
|
},
|
||||||
.attach = bt3c_attach,
|
.probe = bt3c_attach,
|
||||||
.event = bt3c_event,
|
|
||||||
.remove = bt3c_detach,
|
.remove = bt3c_detach,
|
||||||
.id_table = bt3c_ids,
|
.id_table = bt3c_ids,
|
||||||
.suspend = bt3c_suspend,
|
.suspend = bt3c_suspend,
|
||||||
|
@ -86,11 +86,7 @@ typedef struct btuart_info_t {
|
|||||||
|
|
||||||
static void btuart_config(dev_link_t *link);
|
static void btuart_config(dev_link_t *link);
|
||||||
static void btuart_release(dev_link_t *link);
|
static void btuart_release(dev_link_t *link);
|
||||||
static int btuart_event(event_t event, int priority, event_callback_args_t *args);
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "btuart_cs";
|
|
||||||
|
|
||||||
static dev_link_t *btuart_attach(void);
|
|
||||||
static void btuart_detach(struct pcmcia_device *p_dev);
|
static void btuart_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
|
|
||||||
@ -580,17 +576,15 @@ static int btuart_close(btuart_info_t *info)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static dev_link_t *btuart_attach(void)
|
static int btuart_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
btuart_info_t *info;
|
btuart_info_t *info;
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Create new info device */
|
/* Create new info device */
|
||||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||||
if (!info)
|
if (!info)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
|
|
||||||
link = &info->link;
|
link = &info->link;
|
||||||
link->priv = info;
|
link->priv = info;
|
||||||
@ -607,20 +601,13 @@ static dev_link_t *btuart_attach(void)
|
|||||||
link->conf.Vcc = 50;
|
link->conf.Vcc = 50;
|
||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
if (ret != CS_SUCCESS) {
|
btuart_config(link);
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
btuart_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -813,20 +800,6 @@ static int btuart_resume(struct pcmcia_device *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int btuart_event(event_t event, int priority, event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
btuart_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct pcmcia_device_id btuart_ids[] = {
|
static struct pcmcia_device_id btuart_ids[] = {
|
||||||
/* don't use this driver. Use serial_cs + hci_uart instead */
|
/* don't use this driver. Use serial_cs + hci_uart instead */
|
||||||
PCMCIA_DEVICE_NULL
|
PCMCIA_DEVICE_NULL
|
||||||
@ -838,8 +811,7 @@ static struct pcmcia_driver btuart_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "btuart_cs",
|
.name = "btuart_cs",
|
||||||
},
|
},
|
||||||
.attach = btuart_attach,
|
.probe = btuart_attach,
|
||||||
.event = btuart_event,
|
|
||||||
.remove = btuart_detach,
|
.remove = btuart_detach,
|
||||||
.id_table = btuart_ids,
|
.id_table = btuart_ids,
|
||||||
.suspend = btuart_suspend,
|
.suspend = btuart_suspend,
|
||||||
|
@ -89,11 +89,7 @@ typedef struct dtl1_info_t {
|
|||||||
|
|
||||||
static void dtl1_config(dev_link_t *link);
|
static void dtl1_config(dev_link_t *link);
|
||||||
static void dtl1_release(dev_link_t *link);
|
static void dtl1_release(dev_link_t *link);
|
||||||
static int dtl1_event(event_t event, int priority, event_callback_args_t *args);
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "dtl1_cs";
|
|
||||||
|
|
||||||
static dev_link_t *dtl1_attach(void);
|
|
||||||
static void dtl1_detach(struct pcmcia_device *p_dev);
|
static void dtl1_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
|
|
||||||
@ -559,17 +555,15 @@ static int dtl1_close(dtl1_info_t *info)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static dev_link_t *dtl1_attach(void)
|
static int dtl1_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
dtl1_info_t *info;
|
dtl1_info_t *info;
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Create new info device */
|
/* Create new info device */
|
||||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||||
if (!info)
|
if (!info)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
|
|
||||||
link = &info->link;
|
link = &info->link;
|
||||||
link->priv = info;
|
link->priv = info;
|
||||||
@ -586,20 +580,13 @@ static dev_link_t *dtl1_attach(void)
|
|||||||
link->conf.Vcc = 50;
|
link->conf.Vcc = 50;
|
||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
if (ret != CS_SUCCESS) {
|
dtl1_config(link);
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
dtl1_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -764,19 +751,6 @@ static int dtl1_resume(struct pcmcia_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dtl1_event(event_t event, int priority, event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
dtl1_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct pcmcia_device_id dtl1_ids[] = {
|
static struct pcmcia_device_id dtl1_ids[] = {
|
||||||
PCMCIA_DEVICE_PROD_ID12("Nokia Mobile Phones", "DTL-1", 0xe1bfdd64, 0xe168480d),
|
PCMCIA_DEVICE_PROD_ID12("Nokia Mobile Phones", "DTL-1", 0xe1bfdd64, 0xe168480d),
|
||||||
@ -790,8 +764,7 @@ static struct pcmcia_driver dtl1_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "dtl1_cs",
|
.name = "dtl1_cs",
|
||||||
},
|
},
|
||||||
.attach = dtl1_attach,
|
.probe = dtl1_attach,
|
||||||
.event = dtl1_event,
|
|
||||||
.remove = dtl1_detach,
|
.remove = dtl1_detach,
|
||||||
.id_table = dtl1_ids,
|
.id_table = dtl1_ids,
|
||||||
.suspend = dtl1_suspend,
|
.suspend = dtl1_suspend,
|
||||||
|
@ -66,7 +66,6 @@ static char *version = "cm4000_cs.c v2.4.0gm5 - All bugs added by Harald Welte";
|
|||||||
#define T_100MSEC msecs_to_jiffies(100)
|
#define T_100MSEC msecs_to_jiffies(100)
|
||||||
#define T_500MSEC msecs_to_jiffies(500)
|
#define T_500MSEC msecs_to_jiffies(500)
|
||||||
|
|
||||||
static void cm4000_detach(struct pcmcia_device *p_dev);
|
|
||||||
static void cm4000_release(dev_link_t *link);
|
static void cm4000_release(dev_link_t *link);
|
||||||
|
|
||||||
static int major; /* major number we get from the kernel */
|
static int major; /* major number we get from the kernel */
|
||||||
@ -156,7 +155,6 @@ struct cm4000_dev {
|
|||||||
/*sbuf*/ 512*sizeof(char) - \
|
/*sbuf*/ 512*sizeof(char) - \
|
||||||
/*queue*/ 4*sizeof(wait_queue_head_t))
|
/*queue*/ 4*sizeof(wait_queue_head_t))
|
||||||
|
|
||||||
static dev_info_t dev_info = MODULE_NAME;
|
|
||||||
static dev_link_t *dev_table[CM4000_MAX_DEV];
|
static dev_link_t *dev_table[CM4000_MAX_DEV];
|
||||||
|
|
||||||
/* This table doesn't use spaces after the comma between fields and thus
|
/* This table doesn't use spaces after the comma between fields and thus
|
||||||
@ -1864,38 +1862,6 @@ cs_release:
|
|||||||
link->state &= ~DEV_CONFIG_PENDING;
|
link->state &= ~DEV_CONFIG_PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cm4000_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link;
|
|
||||||
struct cm4000_dev *dev;
|
|
||||||
int devno;
|
|
||||||
|
|
||||||
link = args->client_data;
|
|
||||||
dev = link->priv;
|
|
||||||
|
|
||||||
DEBUGP(3, dev, "-> cm4000_event\n");
|
|
||||||
for (devno = 0; devno < CM4000_MAX_DEV; devno++)
|
|
||||||
if (dev_table[devno] == link)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (devno == CM4000_MAX_DEV)
|
|
||||||
return CS_BAD_ADAPTER;
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
DEBUGP(5, dev, "CS_EVENT_CARD_INSERTION\n");
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
cm4000_config(link, devno);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
DEBUGP(5, dev, "unknown event %.2x\n", event);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
DEBUGP(3, dev, "<- cm4000_event\n");
|
|
||||||
return CS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int cm4000_suspend(struct pcmcia_device *p_dev)
|
static int cm4000_suspend(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
dev_link_t *link = dev_to_instance(p_dev);
|
dev_link_t *link = dev_to_instance(p_dev);
|
||||||
@ -1935,11 +1901,10 @@ static void cm4000_release(dev_link_t *link)
|
|||||||
pcmcia_release_io(link->handle, &link->io);
|
pcmcia_release_io(link->handle, &link->io);
|
||||||
}
|
}
|
||||||
|
|
||||||
static dev_link_t *cm4000_attach(void)
|
static int cm4000_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
struct cm4000_dev *dev;
|
struct cm4000_dev *dev;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
client_reg_t client_reg;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < CM4000_MAX_DEV; i++)
|
for (i = 0; i < CM4000_MAX_DEV; i++)
|
||||||
@ -1948,41 +1913,31 @@ static dev_link_t *cm4000_attach(void)
|
|||||||
|
|
||||||
if (i == CM4000_MAX_DEV) {
|
if (i == CM4000_MAX_DEV) {
|
||||||
printk(KERN_NOTICE MODULE_NAME ": all devices in use\n");
|
printk(KERN_NOTICE MODULE_NAME ": all devices in use\n");
|
||||||
return NULL;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create a new cm4000_cs device */
|
/* create a new cm4000_cs device */
|
||||||
dev = kzalloc(sizeof(struct cm4000_dev), GFP_KERNEL);
|
dev = kzalloc(sizeof(struct cm4000_dev), GFP_KERNEL);
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
|
|
||||||
link = &dev->link;
|
link = &dev->link;
|
||||||
link->priv = dev;
|
link->priv = dev;
|
||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
dev_table[i] = link;
|
dev_table[i] = link;
|
||||||
|
|
||||||
/* register with card services */
|
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.EventMask =
|
|
||||||
CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
|
|
||||||
CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
|
|
||||||
CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
|
|
||||||
i = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (i) {
|
|
||||||
cs_error(link->handle, RegisterClient, i);
|
|
||||||
cm4000_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
init_waitqueue_head(&dev->devq);
|
init_waitqueue_head(&dev->devq);
|
||||||
init_waitqueue_head(&dev->ioq);
|
init_waitqueue_head(&dev->ioq);
|
||||||
init_waitqueue_head(&dev->atrq);
|
init_waitqueue_head(&dev->atrq);
|
||||||
init_waitqueue_head(&dev->readq);
|
init_waitqueue_head(&dev->readq);
|
||||||
|
|
||||||
return link;
|
link->handle = p_dev;
|
||||||
|
p_dev->instance = link;
|
||||||
|
|
||||||
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
cm4000_config(link, i);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cm4000_detach(struct pcmcia_device *p_dev)
|
static void cm4000_detach(struct pcmcia_device *p_dev)
|
||||||
@ -2031,11 +1986,10 @@ static struct pcmcia_driver cm4000_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "cm4000_cs",
|
.name = "cm4000_cs",
|
||||||
},
|
},
|
||||||
.attach = cm4000_attach,
|
.probe = cm4000_attach,
|
||||||
.remove = cm4000_detach,
|
.remove = cm4000_detach,
|
||||||
.suspend = cm4000_suspend,
|
.suspend = cm4000_suspend,
|
||||||
.resume = cm4000_resume,
|
.resume = cm4000_resume,
|
||||||
.event = cm4000_event,
|
|
||||||
.id_table = cm4000_ids,
|
.id_table = cm4000_ids,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -65,7 +65,6 @@ static char *version =
|
|||||||
#define POLL_PERIOD msecs_to_jiffies(10)
|
#define POLL_PERIOD msecs_to_jiffies(10)
|
||||||
|
|
||||||
static void reader_release(dev_link_t *link);
|
static void reader_release(dev_link_t *link);
|
||||||
static void reader_detach(struct pcmcia_device *p_dev);
|
|
||||||
|
|
||||||
static int major;
|
static int major;
|
||||||
|
|
||||||
@ -86,7 +85,6 @@ struct reader_dev {
|
|||||||
struct timer_list poll_timer;
|
struct timer_list poll_timer;
|
||||||
};
|
};
|
||||||
|
|
||||||
static dev_info_t dev_info = MODULE_NAME;
|
|
||||||
static dev_link_t *dev_table[CM_MAX_DEV];
|
static dev_link_t *dev_table[CM_MAX_DEV];
|
||||||
|
|
||||||
#ifndef PCMCIA_DEBUG
|
#ifndef PCMCIA_DEBUG
|
||||||
@ -629,39 +627,6 @@ cs_release:
|
|||||||
link->state &= ~DEV_CONFIG_PENDING;
|
link->state &= ~DEV_CONFIG_PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int reader_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link;
|
|
||||||
struct reader_dev *dev;
|
|
||||||
int devno;
|
|
||||||
|
|
||||||
link = args->client_data;
|
|
||||||
dev = link->priv;
|
|
||||||
DEBUGP(3, dev, "-> reader_event\n");
|
|
||||||
for (devno = 0; devno < CM_MAX_DEV; devno++) {
|
|
||||||
if (dev_table[devno] == link)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (devno == CM_MAX_DEV)
|
|
||||||
return CS_BAD_ADAPTER;
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
DEBUGP(5, dev, "CS_EVENT_CARD_INSERTION\n");
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
reader_config(link, devno);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
DEBUGP(5, dev, "reader_event: unknown event %.2x\n",
|
|
||||||
event);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
DEBUGP(3, dev, "<- reader_event\n");
|
|
||||||
return CS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int reader_suspend(struct pcmcia_device *p_dev)
|
static int reader_suspend(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
dev_link_t *link = dev_to_instance(p_dev);
|
dev_link_t *link = dev_to_instance(p_dev);
|
||||||
@ -691,11 +656,10 @@ static void reader_release(dev_link_t *link)
|
|||||||
pcmcia_release_io(link->handle, &link->io);
|
pcmcia_release_io(link->handle, &link->io);
|
||||||
}
|
}
|
||||||
|
|
||||||
static dev_link_t *reader_attach(void)
|
static int reader_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
struct reader_dev *dev;
|
struct reader_dev *dev;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
client_reg_t client_reg;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < CM_MAX_DEV; i++) {
|
for (i = 0; i < CM_MAX_DEV; i++) {
|
||||||
@ -704,11 +668,11 @@ static dev_link_t *reader_attach(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (i == CM_MAX_DEV)
|
if (i == CM_MAX_DEV)
|
||||||
return NULL;
|
return -ENODEV;
|
||||||
|
|
||||||
dev = kzalloc(sizeof(struct reader_dev), GFP_KERNEL);
|
dev = kzalloc(sizeof(struct reader_dev), GFP_KERNEL);
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
|
|
||||||
dev->timeout = CCID_DRIVER_MINIMUM_TIMEOUT;
|
dev->timeout = CCID_DRIVER_MINIMUM_TIMEOUT;
|
||||||
dev->buffer_status = 0;
|
dev->buffer_status = 0;
|
||||||
@ -719,20 +683,6 @@ static dev_link_t *reader_attach(void)
|
|||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
dev_table[i] = link;
|
dev_table[i] = link;
|
||||||
|
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
|
|
||||||
client_reg.EventMask=
|
|
||||||
CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
|
|
||||||
CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
|
|
||||||
CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
i = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (i) {
|
|
||||||
cs_error(link->handle, RegisterClient, i);
|
|
||||||
reader_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
init_waitqueue_head(&dev->devq);
|
init_waitqueue_head(&dev->devq);
|
||||||
init_waitqueue_head(&dev->poll_wait);
|
init_waitqueue_head(&dev->poll_wait);
|
||||||
init_waitqueue_head(&dev->read_wait);
|
init_waitqueue_head(&dev->read_wait);
|
||||||
@ -740,7 +690,13 @@ static dev_link_t *reader_attach(void)
|
|||||||
init_timer(&dev->poll_timer);
|
init_timer(&dev->poll_timer);
|
||||||
dev->poll_timer.function = &cm4040_do_poll;
|
dev->poll_timer.function = &cm4040_do_poll;
|
||||||
|
|
||||||
return link;
|
link->handle = p_dev;
|
||||||
|
p_dev->instance = link;
|
||||||
|
|
||||||
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
reader_config(link, i);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reader_detach(struct pcmcia_device *p_dev)
|
static void reader_detach(struct pcmcia_device *p_dev)
|
||||||
@ -790,11 +746,10 @@ static struct pcmcia_driver reader_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "cm4040_cs",
|
.name = "cm4040_cs",
|
||||||
},
|
},
|
||||||
.attach = reader_attach,
|
.probe = reader_attach,
|
||||||
.remove = reader_detach,
|
.remove = reader_detach,
|
||||||
.suspend = reader_suspend,
|
.suspend = reader_suspend,
|
||||||
.resume = reader_resume,
|
.resume = reader_resume,
|
||||||
.event = reader_event,
|
|
||||||
.id_table = cm4040_ids,
|
.id_table = cm4040_ids,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -486,13 +486,8 @@ static void mgslpc_wait_until_sent(struct tty_struct *tty, int timeout);
|
|||||||
|
|
||||||
static void mgslpc_config(dev_link_t *link);
|
static void mgslpc_config(dev_link_t *link);
|
||||||
static void mgslpc_release(u_long arg);
|
static void mgslpc_release(u_long arg);
|
||||||
static int mgslpc_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
static dev_link_t *mgslpc_attach(void);
|
|
||||||
static void mgslpc_detach(struct pcmcia_device *p_dev);
|
static void mgslpc_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
static dev_info_t dev_info = "synclink_cs";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 1st function defined in .text section. Calling this function in
|
* 1st function defined in .text section. Calling this function in
|
||||||
* init_module() followed by a breakpoint allows a remote debugger
|
* init_module() followed by a breakpoint allows a remote debugger
|
||||||
@ -538,12 +533,10 @@ static void ldisc_receive_buf(struct tty_struct *tty,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static dev_link_t *mgslpc_attach(void)
|
static int mgslpc_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
MGSLPC_INFO *info;
|
MGSLPC_INFO *info;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
client_reg_t client_reg;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (debug_level >= DEBUG_LEVEL_INFO)
|
if (debug_level >= DEBUG_LEVEL_INFO)
|
||||||
printk("mgslpc_attach\n");
|
printk("mgslpc_attach\n");
|
||||||
@ -551,7 +544,7 @@ static dev_link_t *mgslpc_attach(void)
|
|||||||
info = (MGSLPC_INFO *)kmalloc(sizeof(MGSLPC_INFO), GFP_KERNEL);
|
info = (MGSLPC_INFO *)kmalloc(sizeof(MGSLPC_INFO), GFP_KERNEL);
|
||||||
if (!info) {
|
if (!info) {
|
||||||
printk("Error can't allocate device instance data\n");
|
printk("Error can't allocate device instance data\n");
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(info, 0, sizeof(MGSLPC_INFO));
|
memset(info, 0, sizeof(MGSLPC_INFO));
|
||||||
@ -586,23 +579,15 @@ static dev_link_t *mgslpc_attach(void)
|
|||||||
link->conf.Vcc = 50;
|
link->conf.Vcc = 50;
|
||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
|
|
||||||
client_reg.dev_info = &dev_info;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
client_reg.Version = 0x0210;
|
mgslpc_config(link);
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != CS_SUCCESS) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
mgslpc_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
mgslpc_add_device(info);
|
mgslpc_add_device(info);
|
||||||
|
|
||||||
return link;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Card has been inserted.
|
/* Card has been inserted.
|
||||||
@ -778,23 +763,6 @@ static int mgslpc_resume(struct pcmcia_device *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int mgslpc_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
if (debug_level >= DEBUG_LEVEL_INFO)
|
|
||||||
printk("mgslpc_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
mgslpc_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int mgslpc_paranoia_check(MGSLPC_INFO *info,
|
static inline int mgslpc_paranoia_check(MGSLPC_INFO *info,
|
||||||
char *name, const char *routine)
|
char *name, const char *routine)
|
||||||
{
|
{
|
||||||
@ -3071,8 +3039,7 @@ static struct pcmcia_driver mgslpc_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "synclink_cs",
|
.name = "synclink_cs",
|
||||||
},
|
},
|
||||||
.attach = mgslpc_attach,
|
.probe = mgslpc_attach,
|
||||||
.event = mgslpc_event,
|
|
||||||
.remove = mgslpc_detach,
|
.remove = mgslpc_detach,
|
||||||
.id_table = mgslpc_ids,
|
.id_table = mgslpc_ids,
|
||||||
.suspend = mgslpc_suspend,
|
.suspend = mgslpc_suspend,
|
||||||
|
@ -88,12 +88,8 @@ typedef struct ide_info_t {
|
|||||||
} ide_info_t;
|
} ide_info_t;
|
||||||
|
|
||||||
static void ide_release(dev_link_t *);
|
static void ide_release(dev_link_t *);
|
||||||
static int ide_event(event_t event, int priority,
|
static void ide_config(dev_link_t *);
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "ide-cs";
|
|
||||||
|
|
||||||
static dev_link_t *ide_attach(void);
|
|
||||||
static void ide_detach(struct pcmcia_device *p_dev);
|
static void ide_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
|
|
||||||
@ -107,18 +103,17 @@ static void ide_detach(struct pcmcia_device *p_dev);
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *ide_attach(void)
|
static int ide_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
ide_info_t *info;
|
ide_info_t *info;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
client_reg_t client_reg;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "ide_attach()\n");
|
DEBUG(0, "ide_attach()\n");
|
||||||
|
|
||||||
/* Create new ide device */
|
/* Create new ide device */
|
||||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||||
if (!info) return NULL;
|
if (!info)
|
||||||
|
return -ENOMEM;
|
||||||
link = &info->link; link->priv = info;
|
link = &info->link; link->priv = info;
|
||||||
|
|
||||||
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
|
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
|
||||||
@ -130,19 +125,13 @@ static dev_link_t *ide_attach(void)
|
|||||||
link->conf.Vcc = 50;
|
link->conf.Vcc = 50;
|
||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != CS_SUCCESS) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
ide_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
ide_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* ide_attach */
|
} /* ide_attach */
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -421,22 +410,6 @@ static int ide_resume(struct pcmcia_device *dev)
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
int ide_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "ide_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
ide_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* ide_event */
|
|
||||||
|
|
||||||
static struct pcmcia_device_id ide_ids[] = {
|
static struct pcmcia_device_id ide_ids[] = {
|
||||||
PCMCIA_DEVICE_FUNC_ID(4),
|
PCMCIA_DEVICE_FUNC_ID(4),
|
||||||
PCMCIA_DEVICE_MANF_CARD(0x0032, 0x0704),
|
PCMCIA_DEVICE_MANF_CARD(0x0032, 0x0704),
|
||||||
@ -481,8 +454,7 @@ static struct pcmcia_driver ide_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "ide-cs",
|
.name = "ide-cs",
|
||||||
},
|
},
|
||||||
.attach = ide_attach,
|
.probe = ide_attach,
|
||||||
.event = ide_event,
|
|
||||||
.remove = ide_detach,
|
.remove = ide_detach,
|
||||||
.id_table = ide_ids,
|
.id_table = ide_ids,
|
||||||
.suspend = ide_suspend,
|
.suspend = ide_suspend,
|
||||||
|
@ -53,8 +53,6 @@ MODULE_LICENSE("GPL");
|
|||||||
|
|
||||||
static void avmcs_config(dev_link_t *link);
|
static void avmcs_config(dev_link_t *link);
|
||||||
static void avmcs_release(dev_link_t *link);
|
static void avmcs_release(dev_link_t *link);
|
||||||
static int avmcs_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The attach() and detach() entry points are used to create and destroy
|
The attach() and detach() entry points are used to create and destroy
|
||||||
@ -62,17 +60,8 @@ static int avmcs_event(event_t event, int priority,
|
|||||||
needed to manage one actual PCMCIA card.
|
needed to manage one actual PCMCIA card.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static dev_link_t *avmcs_attach(void);
|
|
||||||
static void avmcs_detach(struct pcmcia_device *p_dev);
|
static void avmcs_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
/*
|
|
||||||
The dev_info variable is the "key" that is used to match up this
|
|
||||||
device driver with appropriate cards, through the card configuration
|
|
||||||
database.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "avm_cs";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
A linked list of "instances" of the skeleton device. Each actual
|
A linked list of "instances" of the skeleton device. Each actual
|
||||||
PCMCIA card corresponds to one device instance, and is described
|
PCMCIA card corresponds to one device instance, and is described
|
||||||
@ -110,12 +99,10 @@ typedef struct local_info_t {
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *avmcs_attach(void)
|
static int avmcs_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
local_info_t *local;
|
local_info_t *local;
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Initialize the dev_link_t structure */
|
/* Initialize the dev_link_t structure */
|
||||||
link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
||||||
@ -148,23 +135,18 @@ static dev_link_t *avmcs_attach(void)
|
|||||||
memset(local, 0, sizeof(local_info_t));
|
memset(local, 0, sizeof(local_info_t));
|
||||||
link->priv = local;
|
link->priv = local;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
client_reg.event_callback_args.client_data = link;
|
avmcs_config(link);
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
return 0;
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
avmcs_detach(link->handle);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
return link;
|
|
||||||
|
|
||||||
err_kfree:
|
err_kfree:
|
||||||
kfree(link);
|
kfree(link);
|
||||||
err:
|
err:
|
||||||
return NULL;
|
return -EINVAL;
|
||||||
} /* avmcs_attach */
|
} /* avmcs_attach */
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -433,19 +415,6 @@ static int avmcs_resume(struct pcmcia_device *dev)
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static int avmcs_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
avmcs_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* avmcs_event */
|
|
||||||
|
|
||||||
static struct pcmcia_device_id avmcs_ids[] = {
|
static struct pcmcia_device_id avmcs_ids[] = {
|
||||||
PCMCIA_DEVICE_PROD_ID12("AVM", "ISDN-Controller B1", 0x95d42008, 0x845dc335),
|
PCMCIA_DEVICE_PROD_ID12("AVM", "ISDN-Controller B1", 0x95d42008, 0x845dc335),
|
||||||
@ -460,8 +429,7 @@ static struct pcmcia_driver avmcs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "avm_cs",
|
.name = "avm_cs",
|
||||||
},
|
},
|
||||||
.attach = avmcs_attach,
|
.probe = avmcs_attach,
|
||||||
.event = avmcs_event,
|
|
||||||
.remove = avmcs_detach,
|
.remove = avmcs_detach,
|
||||||
.id_table = avmcs_ids,
|
.id_table = avmcs_ids,
|
||||||
.suspend= avmcs_suspend,
|
.suspend= avmcs_suspend,
|
||||||
|
@ -69,8 +69,6 @@ module_param(isdnprot, int, 0);
|
|||||||
|
|
||||||
static void avma1cs_config(dev_link_t *link);
|
static void avma1cs_config(dev_link_t *link);
|
||||||
static void avma1cs_release(dev_link_t *link);
|
static void avma1cs_release(dev_link_t *link);
|
||||||
static int avma1cs_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The attach() and detach() entry points are used to create and destroy
|
The attach() and detach() entry points are used to create and destroy
|
||||||
@ -78,16 +76,8 @@ static int avma1cs_event(event_t event, int priority,
|
|||||||
needed to manage one actual PCMCIA card.
|
needed to manage one actual PCMCIA card.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static dev_link_t *avma1cs_attach(void);
|
|
||||||
static void avma1cs_detach(struct pcmcia_device *p_dev);
|
static void avma1cs_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
/*
|
|
||||||
The dev_info variable is the "key" that is used to match up this
|
|
||||||
device driver with appropriate cards, through the card configuration
|
|
||||||
database.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "avma1_cs";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
A linked list of "instances" of the skeleton device. Each actual
|
A linked list of "instances" of the skeleton device. Each actual
|
||||||
@ -126,26 +116,24 @@ typedef struct local_info_t {
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *avma1cs_attach(void)
|
static int avma1cs_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
local_info_t *local;
|
local_info_t *local;
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "avma1cs_attach()\n");
|
DEBUG(0, "avma1cs_attach()\n");
|
||||||
|
|
||||||
/* Initialize the dev_link_t structure */
|
/* Initialize the dev_link_t structure */
|
||||||
link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
||||||
if (!link)
|
if (!link)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
memset(link, 0, sizeof(struct dev_link_t));
|
memset(link, 0, sizeof(struct dev_link_t));
|
||||||
|
|
||||||
/* Allocate space for private device-specific data */
|
/* Allocate space for private device-specific data */
|
||||||
local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
|
local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
|
||||||
if (!local) {
|
if (!local) {
|
||||||
kfree(link);
|
kfree(link);
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
memset(local, 0, sizeof(local_info_t));
|
memset(local, 0, sizeof(local_info_t));
|
||||||
link->priv = local;
|
link->priv = local;
|
||||||
@ -170,19 +158,13 @@ static dev_link_t *avma1cs_attach(void)
|
|||||||
link->conf.ConfigIndex = 1;
|
link->conf.ConfigIndex = 1;
|
||||||
link->conf.Present = PRESENT_OPTION;
|
link->conf.Present = PRESENT_OPTION;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
avma1cs_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
avma1cs_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* avma1cs_attach */
|
} /* avma1cs_attach */
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -430,35 +412,6 @@ static int avma1cs_resume(struct pcmcia_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================================================================
|
|
||||||
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
also sets some flags to discourage the net drivers from trying
|
|
||||||
to talk to the card any more.
|
|
||||||
|
|
||||||
When a CARD_REMOVAL event is received, we immediately set a flag
|
|
||||||
to block future accesses to this device. All the functions that
|
|
||||||
actually access the device should check this flag to make sure
|
|
||||||
the card is still present.
|
|
||||||
|
|
||||||
======================================================================*/
|
|
||||||
|
|
||||||
static int avma1cs_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "avma1cs_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
avma1cs_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* avma1cs_event */
|
|
||||||
|
|
||||||
static struct pcmcia_device_id avma1cs_ids[] = {
|
static struct pcmcia_device_id avma1cs_ids[] = {
|
||||||
PCMCIA_DEVICE_PROD_ID12("AVM", "ISDN A", 0x95d42008, 0xadc9d4bb),
|
PCMCIA_DEVICE_PROD_ID12("AVM", "ISDN A", 0x95d42008, 0xadc9d4bb),
|
||||||
@ -472,8 +425,7 @@ static struct pcmcia_driver avma1cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "avma1_cs",
|
.name = "avma1_cs",
|
||||||
},
|
},
|
||||||
.attach = avma1cs_attach,
|
.probe = avma1cs_attach,
|
||||||
.event = avma1cs_event,
|
|
||||||
.remove = avma1cs_detach,
|
.remove = avma1cs_detach,
|
||||||
.id_table = avma1cs_ids,
|
.id_table = avma1cs_ids,
|
||||||
.suspend = avma1cs_suspend,
|
.suspend = avma1cs_suspend,
|
||||||
|
@ -96,8 +96,6 @@ module_param(protocol, int, 0);
|
|||||||
|
|
||||||
static void elsa_cs_config(dev_link_t *link);
|
static void elsa_cs_config(dev_link_t *link);
|
||||||
static void elsa_cs_release(dev_link_t *link);
|
static void elsa_cs_release(dev_link_t *link);
|
||||||
static int elsa_cs_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The attach() and detach() entry points are used to create and destroy
|
The attach() and detach() entry points are used to create and destroy
|
||||||
@ -105,27 +103,8 @@ static int elsa_cs_event(event_t event, int priority,
|
|||||||
needed to manage one actual PCMCIA card.
|
needed to manage one actual PCMCIA card.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static dev_link_t *elsa_cs_attach(void);
|
|
||||||
static void elsa_cs_detach(struct pcmcia_device *p_dev);
|
static void elsa_cs_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
/*
|
|
||||||
The dev_info variable is the "key" that is used to match up this
|
|
||||||
device driver with appropriate cards, through the card configuration
|
|
||||||
database.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "elsa_cs";
|
|
||||||
|
|
||||||
/*
|
|
||||||
A linked list of "instances" of the elsa_cs device. Each actual
|
|
||||||
PCMCIA card corresponds to one device instance, and is described
|
|
||||||
by one dev_link_t structure (defined in ds.h).
|
|
||||||
|
|
||||||
You may not want to use a linked list for this -- for example, the
|
|
||||||
memory card driver uses an array of dev_link_t pointers, where minor
|
|
||||||
device numbers are used to derive the corresponding array index.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
A driver needs to provide a dev_node_t structure for each device
|
A driver needs to provide a dev_node_t structure for each device
|
||||||
on a card. In some cases, there is only one device per card (for
|
on a card. In some cases, there is only one device per card (for
|
||||||
@ -160,18 +139,16 @@ typedef struct local_info_t {
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *elsa_cs_attach(void)
|
static int elsa_cs_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
local_info_t *local;
|
local_info_t *local;
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "elsa_cs_attach()\n");
|
DEBUG(0, "elsa_cs_attach()\n");
|
||||||
|
|
||||||
/* Allocate space for private device-specific data */
|
/* Allocate space for private device-specific data */
|
||||||
local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
|
local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
|
||||||
if (!local) return NULL;
|
if (!local) return -ENOMEM;
|
||||||
memset(local, 0, sizeof(local_info_t));
|
memset(local, 0, sizeof(local_info_t));
|
||||||
local->cardnr = -1;
|
local->cardnr = -1;
|
||||||
link = &local->link; link->priv = local;
|
link = &local->link; link->priv = local;
|
||||||
@ -196,19 +173,13 @@ static dev_link_t *elsa_cs_attach(void)
|
|||||||
link->conf.Vcc = 50;
|
link->conf.Vcc = 50;
|
||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != CS_SUCCESS) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
elsa_cs_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
elsa_cs_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* elsa_cs_attach */
|
} /* elsa_cs_attach */
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -447,36 +418,6 @@ static int elsa_resume(struct pcmcia_device *p_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================================================================
|
|
||||||
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
also sets some flags to discourage the net drivers from trying
|
|
||||||
to talk to the card any more.
|
|
||||||
|
|
||||||
When a CARD_REMOVAL event is received, we immediately set a flag
|
|
||||||
to block future accesses to this device. All the functions that
|
|
||||||
actually access the device should check this flag to make sure
|
|
||||||
the card is still present.
|
|
||||||
|
|
||||||
======================================================================*/
|
|
||||||
|
|
||||||
static int elsa_cs_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "elsa_cs_event(%d)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
elsa_cs_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* elsa_cs_event */
|
|
||||||
|
|
||||||
static struct pcmcia_device_id elsa_ids[] = {
|
static struct pcmcia_device_id elsa_ids[] = {
|
||||||
PCMCIA_DEVICE_PROD_ID12("ELSA AG (Aachen, Germany)", "MicroLink ISDN/MC ", 0x983de2c4, 0x333ba257),
|
PCMCIA_DEVICE_PROD_ID12("ELSA AG (Aachen, Germany)", "MicroLink ISDN/MC ", 0x983de2c4, 0x333ba257),
|
||||||
PCMCIA_DEVICE_PROD_ID12("ELSA GmbH, Aachen", "MicroLink ISDN/MC ", 0x639e5718, 0x333ba257),
|
PCMCIA_DEVICE_PROD_ID12("ELSA GmbH, Aachen", "MicroLink ISDN/MC ", 0x639e5718, 0x333ba257),
|
||||||
@ -489,8 +430,7 @@ static struct pcmcia_driver elsa_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "elsa_cs",
|
.name = "elsa_cs",
|
||||||
},
|
},
|
||||||
.attach = elsa_cs_attach,
|
.probe = elsa_cs_attach,
|
||||||
.event = elsa_cs_event,
|
|
||||||
.remove = elsa_cs_detach,
|
.remove = elsa_cs_detach,
|
||||||
.id_table = elsa_ids,
|
.id_table = elsa_ids,
|
||||||
.suspend = elsa_suspend,
|
.suspend = elsa_suspend,
|
||||||
|
@ -97,8 +97,6 @@ module_param(protocol, int, 0);
|
|||||||
|
|
||||||
static void sedlbauer_config(dev_link_t *link);
|
static void sedlbauer_config(dev_link_t *link);
|
||||||
static void sedlbauer_release(dev_link_t *link);
|
static void sedlbauer_release(dev_link_t *link);
|
||||||
static int sedlbauer_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The attach() and detach() entry points are used to create and destroy
|
The attach() and detach() entry points are used to create and destroy
|
||||||
@ -106,7 +104,6 @@ static int sedlbauer_event(event_t event, int priority,
|
|||||||
needed to manage one actual PCMCIA card.
|
needed to manage one actual PCMCIA card.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static dev_link_t *sedlbauer_attach(void);
|
|
||||||
static void sedlbauer_detach(struct pcmcia_device *p_dev);
|
static void sedlbauer_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -116,24 +113,6 @@ static void sedlbauer_detach(struct pcmcia_device *p_dev);
|
|||||||
less on other parts of the kernel.
|
less on other parts of the kernel.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
The dev_info variable is the "key" that is used to match up this
|
|
||||||
device driver with appropriate cards, through the card configuration
|
|
||||||
database.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "sedlbauer_cs";
|
|
||||||
|
|
||||||
/*
|
|
||||||
A linked list of "instances" of the sedlbauer device. Each actual
|
|
||||||
PCMCIA card corresponds to one device instance, and is described
|
|
||||||
by one dev_link_t structure (defined in ds.h).
|
|
||||||
|
|
||||||
You may not want to use a linked list for this -- for example, the
|
|
||||||
memory card driver uses an array of dev_link_t pointers, where minor
|
|
||||||
device numbers are used to derive the corresponding array index.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
A driver needs to provide a dev_node_t structure for each device
|
A driver needs to provide a dev_node_t structure for each device
|
||||||
on a card. In some cases, there is only one device per card (for
|
on a card. In some cases, there is only one device per card (for
|
||||||
@ -169,18 +148,16 @@ typedef struct local_info_t {
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *sedlbauer_attach(void)
|
static int sedlbauer_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
local_info_t *local;
|
local_info_t *local;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
client_reg_t client_reg;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "sedlbauer_attach()\n");
|
DEBUG(0, "sedlbauer_attach()\n");
|
||||||
|
|
||||||
/* Allocate space for private device-specific data */
|
/* Allocate space for private device-specific data */
|
||||||
local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
|
local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
|
||||||
if (!local) return NULL;
|
if (!local) return -ENOMEM;
|
||||||
memset(local, 0, sizeof(local_info_t));
|
memset(local, 0, sizeof(local_info_t));
|
||||||
local->cardnr = -1;
|
local->cardnr = -1;
|
||||||
link = &local->link; link->priv = local;
|
link = &local->link; link->priv = local;
|
||||||
@ -210,19 +187,13 @@ static dev_link_t *sedlbauer_attach(void)
|
|||||||
link->conf.Vcc = 50;
|
link->conf.Vcc = 50;
|
||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != CS_SUCCESS) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
sedlbauer_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
sedlbauer_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* sedlbauer_attach */
|
} /* sedlbauer_attach */
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -541,33 +512,6 @@ static int sedlbauer_resume(struct pcmcia_device *p_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================================================================
|
|
||||||
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received.
|
|
||||||
|
|
||||||
When a CARD_REMOVAL event is received, we immediately set a
|
|
||||||
private flag to block future accesses to this device. All the
|
|
||||||
functions that actually access the device should check this flag
|
|
||||||
to make sure the card is still present.
|
|
||||||
|
|
||||||
======================================================================*/
|
|
||||||
|
|
||||||
static int sedlbauer_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "sedlbauer_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
sedlbauer_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* sedlbauer_event */
|
|
||||||
|
|
||||||
static struct pcmcia_device_id sedlbauer_ids[] = {
|
static struct pcmcia_device_id sedlbauer_ids[] = {
|
||||||
PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "speed star II", "V 3.1", 0x81fb79f5, 0xf3612e1d, 0x6b95c78a),
|
PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "speed star II", "V 3.1", 0x81fb79f5, 0xf3612e1d, 0x6b95c78a),
|
||||||
@ -586,8 +530,7 @@ static struct pcmcia_driver sedlbauer_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "sedlbauer_cs",
|
.name = "sedlbauer_cs",
|
||||||
},
|
},
|
||||||
.attach = sedlbauer_attach,
|
.probe = sedlbauer_attach,
|
||||||
.event = sedlbauer_event,
|
|
||||||
.remove = sedlbauer_detach,
|
.remove = sedlbauer_detach,
|
||||||
.id_table = sedlbauer_ids,
|
.id_table = sedlbauer_ids,
|
||||||
.suspend = sedlbauer_suspend,
|
.suspend = sedlbauer_suspend,
|
||||||
|
@ -77,8 +77,6 @@ module_param(protocol, int, 0);
|
|||||||
|
|
||||||
static void teles_cs_config(dev_link_t *link);
|
static void teles_cs_config(dev_link_t *link);
|
||||||
static void teles_cs_release(dev_link_t *link);
|
static void teles_cs_release(dev_link_t *link);
|
||||||
static int teles_cs_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The attach() and detach() entry points are used to create and destroy
|
The attach() and detach() entry points are used to create and destroy
|
||||||
@ -86,17 +84,8 @@ static int teles_cs_event(event_t event, int priority,
|
|||||||
needed to manage one actual PCMCIA card.
|
needed to manage one actual PCMCIA card.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static dev_link_t *teles_attach(void);
|
|
||||||
static void teles_detach(struct pcmcia_device *p_dev);
|
static void teles_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
/*
|
|
||||||
The dev_info variable is the "key" that is used to match up this
|
|
||||||
device driver with appropriate cards, through the card configuration
|
|
||||||
database.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "teles_cs";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
A linked list of "instances" of the teles_cs device. Each actual
|
A linked list of "instances" of the teles_cs device. Each actual
|
||||||
PCMCIA card corresponds to one device instance, and is described
|
PCMCIA card corresponds to one device instance, and is described
|
||||||
@ -141,18 +130,16 @@ typedef struct local_info_t {
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *teles_attach(void)
|
static int teles_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
local_info_t *local;
|
local_info_t *local;
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "teles_attach()\n");
|
DEBUG(0, "teles_attach()\n");
|
||||||
|
|
||||||
/* Allocate space for private device-specific data */
|
/* Allocate space for private device-specific data */
|
||||||
local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
|
local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
|
||||||
if (!local) return NULL;
|
if (!local) return -ENOMEM;
|
||||||
memset(local, 0, sizeof(local_info_t));
|
memset(local, 0, sizeof(local_info_t));
|
||||||
local->cardnr = -1;
|
local->cardnr = -1;
|
||||||
link = &local->link; link->priv = local;
|
link = &local->link; link->priv = local;
|
||||||
@ -177,19 +164,13 @@ static dev_link_t *teles_attach(void)
|
|||||||
link->conf.Vcc = 50;
|
link->conf.Vcc = 50;
|
||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != CS_SUCCESS) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
teles_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
teles_cs_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* teles_attach */
|
} /* teles_attach */
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -428,35 +409,6 @@ static int teles_resume(struct pcmcia_device *p_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================================================================
|
|
||||||
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
also sets some flags to discourage the net drivers from trying
|
|
||||||
to talk to the card any more.
|
|
||||||
|
|
||||||
When a CARD_REMOVAL event is received, we immediately set a flag
|
|
||||||
to block future accesses to this device. All the functions that
|
|
||||||
actually access the device should check this flag to make sure
|
|
||||||
the card is still present.
|
|
||||||
|
|
||||||
======================================================================*/
|
|
||||||
|
|
||||||
static int teles_cs_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "teles_cs_event(%d)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
teles_cs_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* teles_cs_event */
|
|
||||||
|
|
||||||
static struct pcmcia_device_id teles_ids[] = {
|
static struct pcmcia_device_id teles_ids[] = {
|
||||||
PCMCIA_DEVICE_PROD_ID12("TELES", "S0/PC", 0x67b50eae, 0xe9e70119),
|
PCMCIA_DEVICE_PROD_ID12("TELES", "S0/PC", 0x67b50eae, 0xe9e70119),
|
||||||
@ -469,8 +421,7 @@ static struct pcmcia_driver teles_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "teles_cs",
|
.name = "teles_cs",
|
||||||
},
|
},
|
||||||
.attach = teles_attach,
|
.probe = teles_attach,
|
||||||
.event = teles_cs_event,
|
|
||||||
.remove = teles_detach,
|
.remove = teles_detach,
|
||||||
.id_table = teles_ids,
|
.id_table = teles_ids,
|
||||||
.suspend = teles_suspend,
|
.suspend = teles_suspend,
|
||||||
|
@ -66,8 +66,6 @@ struct pcmciamtd_dev {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "pcmciamtd";
|
|
||||||
|
|
||||||
/* Module parameters */
|
/* Module parameters */
|
||||||
|
|
||||||
/* 2 = do 16-bit transfers, 1 = do 8-bit transfers */
|
/* 2 = do 16-bit transfers, 1 = do 8-bit transfers */
|
||||||
@ -708,30 +706,6 @@ static int pcmciamtd_resume(struct pcmcia_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The card status event handler. Mostly, this schedules other
|
|
||||||
* stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
* also sets some flags to discourage the driver from trying
|
|
||||||
* to talk to the card any more.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static int pcmciamtd_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "event=0x%06x", event);
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
DEBUG(2, "EVENT_CARD_INSERTION");
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
pcmciamtd_config(link);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
DEBUG(2, "Unknown event %d", event);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* This deletes a driver "instance". The device is de-registered
|
/* This deletes a driver "instance". The device is de-registered
|
||||||
* with Card Services. If it has been released, all local data
|
* with Card Services. If it has been released, all local data
|
||||||
@ -762,16 +736,14 @@ static void pcmciamtd_detach(struct pcmcia_device *p_dev)
|
|||||||
* with Card Services.
|
* with Card Services.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static dev_link_t *pcmciamtd_attach(void)
|
static int pcmciamtd_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
struct pcmciamtd_dev *dev;
|
struct pcmciamtd_dev *dev;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
client_reg_t client_reg;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Create new memory card device */
|
/* Create new memory card device */
|
||||||
dev = kmalloc(sizeof(*dev), GFP_KERNEL);
|
dev = kmalloc(sizeof(*dev), GFP_KERNEL);
|
||||||
if (!dev) return NULL;
|
if (!dev) return -ENOMEM;
|
||||||
DEBUG(1, "dev=0x%p", dev);
|
DEBUG(1, "dev=0x%p", dev);
|
||||||
|
|
||||||
memset(dev, 0, sizeof(*dev));
|
memset(dev, 0, sizeof(*dev));
|
||||||
@ -782,20 +754,13 @@ static dev_link_t *pcmciamtd_attach(void)
|
|||||||
link->conf.IntType = INT_MEMORY;
|
link->conf.IntType = INT_MEMORY;
|
||||||
|
|
||||||
link->next = NULL;
|
link->next = NULL;
|
||||||
|
link->handle = p_dev;
|
||||||
|
p_dev->instance = link;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
client_reg.dev_info = &dev_info;
|
pcmciamtd_config(link);
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
return 0;
|
||||||
DEBUG(2, "Calling RegisterClient");
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
pcmciamtd_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
DEBUG(2, "link = %p", link);
|
|
||||||
return link;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct pcmcia_device_id pcmciamtd_ids[] = {
|
static struct pcmcia_device_id pcmciamtd_ids[] = {
|
||||||
@ -829,8 +794,7 @@ static struct pcmcia_driver pcmciamtd_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "pcmciamtd"
|
.name = "pcmciamtd"
|
||||||
},
|
},
|
||||||
.attach = pcmciamtd_attach,
|
.probe = pcmciamtd_attach,
|
||||||
.event = pcmciamtd_event,
|
|
||||||
.remove = pcmciamtd_detach,
|
.remove = pcmciamtd_detach,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.id_table = pcmciamtd_ids,
|
.id_table = pcmciamtd_ids,
|
||||||
|
@ -227,8 +227,6 @@ static char mii_preamble_required = 0;
|
|||||||
|
|
||||||
static void tc574_config(dev_link_t *link);
|
static void tc574_config(dev_link_t *link);
|
||||||
static void tc574_release(dev_link_t *link);
|
static void tc574_release(dev_link_t *link);
|
||||||
static int tc574_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
static void mdio_sync(kio_addr_t ioaddr, int bits);
|
static void mdio_sync(kio_addr_t ioaddr, int bits);
|
||||||
static int mdio_read(kio_addr_t ioaddr, int phy_id, int location);
|
static int mdio_read(kio_addr_t ioaddr, int phy_id, int location);
|
||||||
@ -250,9 +248,6 @@ static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
|||||||
static struct ethtool_ops netdev_ethtool_ops;
|
static struct ethtool_ops netdev_ethtool_ops;
|
||||||
static void set_rx_mode(struct net_device *dev);
|
static void set_rx_mode(struct net_device *dev);
|
||||||
|
|
||||||
static dev_info_t dev_info = "3c574_cs";
|
|
||||||
|
|
||||||
static dev_link_t *tc574_attach(void);
|
|
||||||
static void tc574_detach(struct pcmcia_device *p_dev);
|
static void tc574_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -261,20 +256,18 @@ static void tc574_detach(struct pcmcia_device *p_dev);
|
|||||||
with Card Services.
|
with Card Services.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static dev_link_t *tc574_attach(void)
|
static int tc574_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
struct el3_private *lp;
|
struct el3_private *lp;
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "3c574_attach()\n");
|
DEBUG(0, "3c574_attach()\n");
|
||||||
|
|
||||||
/* Create the PC card device object. */
|
/* Create the PC card device object. */
|
||||||
dev = alloc_etherdev(sizeof(struct el3_private));
|
dev = alloc_etherdev(sizeof(struct el3_private));
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
lp = netdev_priv(dev);
|
lp = netdev_priv(dev);
|
||||||
link = &lp->link;
|
link = &lp->link;
|
||||||
link->priv = dev;
|
link->priv = dev;
|
||||||
@ -305,19 +298,13 @@ static dev_link_t *tc574_attach(void)
|
|||||||
dev->watchdog_timeo = TX_TIMEOUT;
|
dev->watchdog_timeo = TX_TIMEOUT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
tc574_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
tc574_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* tc574_attach */
|
} /* tc574_attach */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -565,29 +552,6 @@ static int tc574_resume(struct pcmcia_device *p_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
also sets some flags to discourage the net drivers from trying
|
|
||||||
to talk to the card any more.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static int tc574_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "3c574_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
tc574_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* tc574_event */
|
|
||||||
|
|
||||||
static void dump_status(struct net_device *dev)
|
static void dump_status(struct net_device *dev)
|
||||||
{
|
{
|
||||||
kio_addr_t ioaddr = dev->base_addr;
|
kio_addr_t ioaddr = dev->base_addr;
|
||||||
@ -1282,8 +1246,7 @@ static struct pcmcia_driver tc574_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "3c574_cs",
|
.name = "3c574_cs",
|
||||||
},
|
},
|
||||||
.attach = tc574_attach,
|
.probe = tc574_attach,
|
||||||
.event = tc574_event,
|
|
||||||
.remove = tc574_detach,
|
.remove = tc574_detach,
|
||||||
.id_table = tc574_ids,
|
.id_table = tc574_ids,
|
||||||
.suspend = tc574_suspend,
|
.suspend = tc574_suspend,
|
||||||
|
@ -143,8 +143,6 @@ DRV_NAME ".c " DRV_VERSION " 2001/10/13 00:08:50 (David Hinds)";
|
|||||||
|
|
||||||
static void tc589_config(dev_link_t *link);
|
static void tc589_config(dev_link_t *link);
|
||||||
static void tc589_release(dev_link_t *link);
|
static void tc589_release(dev_link_t *link);
|
||||||
static int tc589_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
static u16 read_eeprom(kio_addr_t ioaddr, int index);
|
static u16 read_eeprom(kio_addr_t ioaddr, int index);
|
||||||
static void tc589_reset(struct net_device *dev);
|
static void tc589_reset(struct net_device *dev);
|
||||||
@ -161,9 +159,6 @@ static void el3_tx_timeout(struct net_device *dev);
|
|||||||
static void set_multicast_list(struct net_device *dev);
|
static void set_multicast_list(struct net_device *dev);
|
||||||
static struct ethtool_ops netdev_ethtool_ops;
|
static struct ethtool_ops netdev_ethtool_ops;
|
||||||
|
|
||||||
static dev_info_t dev_info = "3c589_cs";
|
|
||||||
|
|
||||||
static dev_link_t *tc589_attach(void);
|
|
||||||
static void tc589_detach(struct pcmcia_device *p_dev);
|
static void tc589_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -174,20 +169,18 @@ static void tc589_detach(struct pcmcia_device *p_dev);
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *tc589_attach(void)
|
static int tc589_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
struct el3_private *lp;
|
struct el3_private *lp;
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "3c589_attach()\n");
|
DEBUG(0, "3c589_attach()\n");
|
||||||
|
|
||||||
/* Create new ethernet device */
|
/* Create new ethernet device */
|
||||||
dev = alloc_etherdev(sizeof(struct el3_private));
|
dev = alloc_etherdev(sizeof(struct el3_private));
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
lp = netdev_priv(dev);
|
lp = netdev_priv(dev);
|
||||||
link = &lp->link;
|
link = &lp->link;
|
||||||
link->priv = dev;
|
link->priv = dev;
|
||||||
@ -219,19 +212,13 @@ static dev_link_t *tc589_attach(void)
|
|||||||
#endif
|
#endif
|
||||||
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
|
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
tc589_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
tc589_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* tc589_attach */
|
} /* tc589_attach */
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -439,31 +426,6 @@ static int tc589_resume(struct pcmcia_device *p_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================================================================
|
|
||||||
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
also sets some flags to discourage the net drivers from trying
|
|
||||||
to talk to the card any more.
|
|
||||||
|
|
||||||
======================================================================*/
|
|
||||||
|
|
||||||
static int tc589_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "3c589_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
tc589_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* tc589_event */
|
|
||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1057,8 +1019,7 @@ static struct pcmcia_driver tc589_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "3c589_cs",
|
.name = "3c589_cs",
|
||||||
},
|
},
|
||||||
.attach = tc589_attach,
|
.probe = tc589_attach,
|
||||||
.event = tc589_event,
|
|
||||||
.remove = tc589_detach,
|
.remove = tc589_detach,
|
||||||
.id_table = tc589_ids,
|
.id_table = tc589_ids,
|
||||||
.suspend = tc589_suspend,
|
.suspend = tc589_suspend,
|
||||||
|
@ -87,8 +87,6 @@ static char *version =
|
|||||||
|
|
||||||
static void axnet_config(dev_link_t *link);
|
static void axnet_config(dev_link_t *link);
|
||||||
static void axnet_release(dev_link_t *link);
|
static void axnet_release(dev_link_t *link);
|
||||||
static int axnet_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
static int axnet_open(struct net_device *dev);
|
static int axnet_open(struct net_device *dev);
|
||||||
static int axnet_close(struct net_device *dev);
|
static int axnet_close(struct net_device *dev);
|
||||||
static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
||||||
@ -107,11 +105,8 @@ static void block_input(struct net_device *dev, int count,
|
|||||||
static void block_output(struct net_device *dev, int count,
|
static void block_output(struct net_device *dev, int count,
|
||||||
const u_char *buf, const int start_page);
|
const u_char *buf, const int start_page);
|
||||||
|
|
||||||
static dev_link_t *axnet_attach(void);
|
|
||||||
static void axnet_detach(struct pcmcia_device *p_dev);
|
static void axnet_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
static dev_info_t dev_info = "axnet_cs";
|
|
||||||
|
|
||||||
static void axdev_setup(struct net_device *dev);
|
static void axdev_setup(struct net_device *dev);
|
||||||
static void AX88190_init(struct net_device *dev, int startp);
|
static void AX88190_init(struct net_device *dev, int startp);
|
||||||
static int ax_open(struct net_device *dev);
|
static int ax_open(struct net_device *dev);
|
||||||
@ -146,13 +141,11 @@ static inline axnet_dev_t *PRIV(struct net_device *dev)
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *axnet_attach(void)
|
static int axnet_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
axnet_dev_t *info;
|
axnet_dev_t *info;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
client_reg_t client_reg;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "axnet_attach()\n");
|
DEBUG(0, "axnet_attach()\n");
|
||||||
|
|
||||||
@ -160,7 +153,7 @@ static dev_link_t *axnet_attach(void)
|
|||||||
"eth%d", axdev_setup);
|
"eth%d", axdev_setup);
|
||||||
|
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
|
|
||||||
info = PRIV(dev);
|
info = PRIV(dev);
|
||||||
link = &info->link;
|
link = &info->link;
|
||||||
@ -175,19 +168,13 @@ static dev_link_t *axnet_attach(void)
|
|||||||
dev->do_ioctl = &axnet_ioctl;
|
dev->do_ioctl = &axnet_ioctl;
|
||||||
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
|
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != CS_SUCCESS) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
axnet_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
axnet_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* axnet_attach */
|
} /* axnet_attach */
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -511,31 +498,6 @@ static int axnet_resume(struct pcmcia_device *p_dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*======================================================================
|
|
||||||
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
also sets some flags to discourage the net drivers from trying
|
|
||||||
to talk to the card any more.
|
|
||||||
|
|
||||||
======================================================================*/
|
|
||||||
|
|
||||||
static int axnet_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(2, "axnet_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
axnet_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* axnet_event */
|
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
|
|
||||||
MII interface support
|
MII interface support
|
||||||
@ -608,7 +570,7 @@ static int axnet_open(struct net_device *dev)
|
|||||||
|
|
||||||
link->open++;
|
link->open++;
|
||||||
|
|
||||||
request_irq(dev->irq, ei_irq_wrapper, SA_SHIRQ, dev_info, dev);
|
request_irq(dev->irq, ei_irq_wrapper, SA_SHIRQ, "axnet_cs", dev);
|
||||||
|
|
||||||
info->link_status = 0x00;
|
info->link_status = 0x00;
|
||||||
init_timer(&info->watchdog);
|
init_timer(&info->watchdog);
|
||||||
@ -869,8 +831,7 @@ static struct pcmcia_driver axnet_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "axnet_cs",
|
.name = "axnet_cs",
|
||||||
},
|
},
|
||||||
.attach = axnet_attach,
|
.probe = axnet_attach,
|
||||||
.event = axnet_event,
|
|
||||||
.remove = axnet_detach,
|
.remove = axnet_detach,
|
||||||
.id_table = axnet_ids,
|
.id_table = axnet_ids,
|
||||||
.suspend = axnet_suspend,
|
.suspend = axnet_suspend,
|
||||||
|
@ -120,12 +120,7 @@ MODULE_LICENSE("GPL");
|
|||||||
|
|
||||||
static void com20020_config(dev_link_t *link);
|
static void com20020_config(dev_link_t *link);
|
||||||
static void com20020_release(dev_link_t *link);
|
static void com20020_release(dev_link_t *link);
|
||||||
static int com20020_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "com20020_cs";
|
|
||||||
|
|
||||||
static dev_link_t *com20020_attach(void);
|
|
||||||
static void com20020_detach(struct pcmcia_device *p_dev);
|
static void com20020_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
@ -143,13 +138,11 @@ typedef struct com20020_dev_t {
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *com20020_attach(void)
|
static int com20020_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
com20020_dev_t *info;
|
com20020_dev_t *info;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
int ret;
|
|
||||||
struct arcnet_local *lp;
|
struct arcnet_local *lp;
|
||||||
|
|
||||||
DEBUG(0, "com20020_attach()\n");
|
DEBUG(0, "com20020_attach()\n");
|
||||||
@ -157,7 +150,7 @@ static dev_link_t *com20020_attach(void)
|
|||||||
/* Create new network device */
|
/* Create new network device */
|
||||||
link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
||||||
if (!link)
|
if (!link)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
|
|
||||||
info = kmalloc(sizeof(struct com20020_dev_t), GFP_KERNEL);
|
info = kmalloc(sizeof(struct com20020_dev_t), GFP_KERNEL);
|
||||||
if (!info)
|
if (!info)
|
||||||
@ -189,29 +182,19 @@ static dev_link_t *com20020_attach(void)
|
|||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
link->conf.Present = PRESENT_OPTION;
|
link->conf.Present = PRESENT_OPTION;
|
||||||
|
|
||||||
|
|
||||||
link->irq.Instance = info->dev = dev;
|
link->irq.Instance = info->dev = dev;
|
||||||
link->priv = info;
|
link->priv = info;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->state |= DEV_PRESENT;
|
||||||
link->next = NULL;
|
com20020_config(link);
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
com20020_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
return 0;
|
||||||
|
|
||||||
fail_alloc_dev:
|
fail_alloc_dev:
|
||||||
kfree(info);
|
kfree(info);
|
||||||
fail_alloc_info:
|
fail_alloc_info:
|
||||||
kfree(link);
|
kfree(link);
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
} /* com20020_attach */
|
} /* com20020_attach */
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -442,31 +425,6 @@ static int com20020_resume(struct pcmcia_device *p_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================================================================
|
|
||||||
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
also sets some flags to discourage the net drivers from trying
|
|
||||||
to talk to the card any more.
|
|
||||||
|
|
||||||
======================================================================*/
|
|
||||||
|
|
||||||
static int com20020_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "com20020_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT;
|
|
||||||
com20020_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* com20020_event */
|
|
||||||
|
|
||||||
static struct pcmcia_device_id com20020_ids[] = {
|
static struct pcmcia_device_id com20020_ids[] = {
|
||||||
PCMCIA_DEVICE_PROD_ID12("Contemporary Control Systems, Inc.", "PCM20 Arcnet Adapter", 0x59991666, 0x95dfffaf),
|
PCMCIA_DEVICE_PROD_ID12("Contemporary Control Systems, Inc.", "PCM20 Arcnet Adapter", 0x59991666, 0x95dfffaf),
|
||||||
PCMCIA_DEVICE_NULL
|
PCMCIA_DEVICE_NULL
|
||||||
@ -478,8 +436,7 @@ static struct pcmcia_driver com20020_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "com20020_cs",
|
.name = "com20020_cs",
|
||||||
},
|
},
|
||||||
.attach = com20020_attach,
|
.probe = com20020_attach,
|
||||||
.event = com20020_event,
|
|
||||||
.remove = com20020_detach,
|
.remove = com20020_detach,
|
||||||
.id_table = com20020_ids,
|
.id_table = com20020_ids,
|
||||||
.suspend = com20020_suspend,
|
.suspend = com20020_suspend,
|
||||||
|
@ -88,9 +88,6 @@ static void fmvj18x_config(dev_link_t *link);
|
|||||||
static int fmvj18x_get_hwinfo(dev_link_t *link, u_char *node_id);
|
static int fmvj18x_get_hwinfo(dev_link_t *link, u_char *node_id);
|
||||||
static int fmvj18x_setup_mfc(dev_link_t *link);
|
static int fmvj18x_setup_mfc(dev_link_t *link);
|
||||||
static void fmvj18x_release(dev_link_t *link);
|
static void fmvj18x_release(dev_link_t *link);
|
||||||
static int fmvj18x_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
static dev_link_t *fmvj18x_attach(void);
|
|
||||||
static void fmvj18x_detach(struct pcmcia_device *p_dev);
|
static void fmvj18x_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -108,8 +105,6 @@ static void set_rx_mode(struct net_device *dev);
|
|||||||
static void fjn_tx_timeout(struct net_device *dev);
|
static void fjn_tx_timeout(struct net_device *dev);
|
||||||
static struct ethtool_ops netdev_ethtool_ops;
|
static struct ethtool_ops netdev_ethtool_ops;
|
||||||
|
|
||||||
static dev_info_t dev_info = "fmvj18x_cs";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
card type
|
card type
|
||||||
*/
|
*/
|
||||||
@ -233,20 +228,18 @@ typedef struct local_info_t {
|
|||||||
#define BANK_1U 0x24 /* bank 1 (CONFIG_1) */
|
#define BANK_1U 0x24 /* bank 1 (CONFIG_1) */
|
||||||
#define BANK_2U 0x28 /* bank 2 (CONFIG_1) */
|
#define BANK_2U 0x28 /* bank 2 (CONFIG_1) */
|
||||||
|
|
||||||
static dev_link_t *fmvj18x_attach(void)
|
static int fmvj18x_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
local_info_t *lp;
|
local_info_t *lp;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
client_reg_t client_reg;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "fmvj18x_attach()\n");
|
DEBUG(0, "fmvj18x_attach()\n");
|
||||||
|
|
||||||
/* Make up a FMVJ18x specific data structure */
|
/* Make up a FMVJ18x specific data structure */
|
||||||
dev = alloc_etherdev(sizeof(local_info_t));
|
dev = alloc_etherdev(sizeof(local_info_t));
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
lp = netdev_priv(dev);
|
lp = netdev_priv(dev);
|
||||||
link = &lp->link;
|
link = &lp->link;
|
||||||
link->priv = dev;
|
link->priv = dev;
|
||||||
@ -281,19 +274,13 @@ static dev_link_t *fmvj18x_attach(void)
|
|||||||
#endif
|
#endif
|
||||||
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
|
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
fmvj18x_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
fmvj18x_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* fmvj18x_attach */
|
} /* fmvj18x_attach */
|
||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
@ -734,22 +721,6 @@ static int fmvj18x_resume(struct pcmcia_device *p_dev)
|
|||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
|
|
||||||
static int fmvj18x_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "fmvj18x_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
fmvj18x_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* fmvj18x_event */
|
|
||||||
|
|
||||||
static struct pcmcia_device_id fmvj18x_ids[] = {
|
static struct pcmcia_device_id fmvj18x_ids[] = {
|
||||||
PCMCIA_DEVICE_MANF_CARD(0x0004, 0x0004),
|
PCMCIA_DEVICE_MANF_CARD(0x0004, 0x0004),
|
||||||
PCMCIA_DEVICE_PROD_ID12("EAGLE Technology", "NE200 ETHERNET LAN MBH10302 04", 0x528c88c4, 0x74f91e59),
|
PCMCIA_DEVICE_PROD_ID12("EAGLE Technology", "NE200 ETHERNET LAN MBH10302 04", 0x528c88c4, 0x74f91e59),
|
||||||
@ -780,8 +751,7 @@ static struct pcmcia_driver fmvj18x_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "fmvj18x_cs",
|
.name = "fmvj18x_cs",
|
||||||
},
|
},
|
||||||
.attach = fmvj18x_attach,
|
.probe = fmvj18x_attach,
|
||||||
.event = fmvj18x_event,
|
|
||||||
.remove = fmvj18x_detach,
|
.remove = fmvj18x_detach,
|
||||||
.id_table = fmvj18x_ids,
|
.id_table = fmvj18x_ids,
|
||||||
.suspend = fmvj18x_suspend,
|
.suspend = fmvj18x_suspend,
|
||||||
|
@ -108,12 +108,6 @@ MODULE_LICENSE("GPL");
|
|||||||
static void ibmtr_config(dev_link_t *link);
|
static void ibmtr_config(dev_link_t *link);
|
||||||
static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase);
|
static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase);
|
||||||
static void ibmtr_release(dev_link_t *link);
|
static void ibmtr_release(dev_link_t *link);
|
||||||
static int ibmtr_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "ibmtr_cs";
|
|
||||||
|
|
||||||
static dev_link_t *ibmtr_attach(void);
|
|
||||||
static void ibmtr_detach(struct pcmcia_device *p_dev);
|
static void ibmtr_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
@ -144,24 +138,22 @@ static struct ethtool_ops netdev_ethtool_ops = {
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *ibmtr_attach(void)
|
static int ibmtr_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
ibmtr_dev_t *info;
|
ibmtr_dev_t *info;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
client_reg_t client_reg;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "ibmtr_attach()\n");
|
DEBUG(0, "ibmtr_attach()\n");
|
||||||
|
|
||||||
/* Create new token-ring device */
|
/* Create new token-ring device */
|
||||||
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
||||||
if (!info) return NULL;
|
if (!info) return -ENOMEM;
|
||||||
memset(info,0,sizeof(*info));
|
memset(info,0,sizeof(*info));
|
||||||
dev = alloc_trdev(sizeof(struct tok_info));
|
dev = alloc_trdev(sizeof(struct tok_info));
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
kfree(info);
|
kfree(info);
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
link = &info->link;
|
link = &info->link;
|
||||||
@ -183,24 +175,13 @@ static dev_link_t *ibmtr_attach(void)
|
|||||||
|
|
||||||
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
|
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
goto out_detach;
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
link->state |= DEV_PRESENT;
|
||||||
return link;
|
ibmtr_config(link);
|
||||||
|
|
||||||
out_detach:
|
return 0;
|
||||||
ibmtr_detach(link->handle);
|
|
||||||
link = NULL;
|
|
||||||
goto out;
|
|
||||||
} /* ibmtr_attach */
|
} /* ibmtr_attach */
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -420,31 +401,6 @@ static int ibmtr_resume(struct pcmcia_device *p_dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*======================================================================
|
|
||||||
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
also sets some flags to discourage the net drivers from trying
|
|
||||||
to talk to the card any more.
|
|
||||||
|
|
||||||
======================================================================*/
|
|
||||||
|
|
||||||
static int ibmtr_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "ibmtr_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT;
|
|
||||||
ibmtr_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* ibmtr_event */
|
|
||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
|
|
||||||
static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase)
|
static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase)
|
||||||
@ -500,8 +456,7 @@ static struct pcmcia_driver ibmtr_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "ibmtr_cs",
|
.name = "ibmtr_cs",
|
||||||
},
|
},
|
||||||
.attach = ibmtr_attach,
|
.probe = ibmtr_attach,
|
||||||
.event = ibmtr_event,
|
|
||||||
.remove = ibmtr_detach,
|
.remove = ibmtr_detach,
|
||||||
.id_table = ibmtr_ids,
|
.id_table = ibmtr_ids,
|
||||||
.suspend = ibmtr_suspend,
|
.suspend = ibmtr_suspend,
|
||||||
|
@ -388,8 +388,6 @@ static char *version =
|
|||||||
DRV_NAME " " DRV_VERSION " (Roger C. Pao)";
|
DRV_NAME " " DRV_VERSION " (Roger C. Pao)";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static dev_info_t dev_info="nmclan_cs";
|
|
||||||
|
|
||||||
static char *if_names[]={
|
static char *if_names[]={
|
||||||
"Auto", "10baseT", "BNC",
|
"Auto", "10baseT", "BNC",
|
||||||
};
|
};
|
||||||
@ -421,8 +419,6 @@ Function Prototypes
|
|||||||
|
|
||||||
static void nmclan_config(dev_link_t *link);
|
static void nmclan_config(dev_link_t *link);
|
||||||
static void nmclan_release(dev_link_t *link);
|
static void nmclan_release(dev_link_t *link);
|
||||||
static int nmclan_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
static void nmclan_reset(struct net_device *dev);
|
static void nmclan_reset(struct net_device *dev);
|
||||||
static int mace_config(struct net_device *dev, struct ifmap *map);
|
static int mace_config(struct net_device *dev, struct ifmap *map);
|
||||||
@ -438,7 +434,6 @@ static void set_multicast_list(struct net_device *dev);
|
|||||||
static struct ethtool_ops netdev_ethtool_ops;
|
static struct ethtool_ops netdev_ethtool_ops;
|
||||||
|
|
||||||
|
|
||||||
static dev_link_t *nmclan_attach(void);
|
|
||||||
static void nmclan_detach(struct pcmcia_device *p_dev);
|
static void nmclan_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
||||||
@ -448,13 +443,11 @@ nmclan_attach
|
|||||||
Services.
|
Services.
|
||||||
---------------------------------------------------------------------------- */
|
---------------------------------------------------------------------------- */
|
||||||
|
|
||||||
static dev_link_t *nmclan_attach(void)
|
static int nmclan_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
mace_private *lp;
|
mace_private *lp;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
client_reg_t client_reg;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "nmclan_attach()\n");
|
DEBUG(0, "nmclan_attach()\n");
|
||||||
DEBUG(1, "%s\n", rcsid);
|
DEBUG(1, "%s\n", rcsid);
|
||||||
@ -462,7 +455,7 @@ static dev_link_t *nmclan_attach(void)
|
|||||||
/* Create new ethernet device */
|
/* Create new ethernet device */
|
||||||
dev = alloc_etherdev(sizeof(mace_private));
|
dev = alloc_etherdev(sizeof(mace_private));
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
lp = netdev_priv(dev);
|
lp = netdev_priv(dev);
|
||||||
link = &lp->link;
|
link = &lp->link;
|
||||||
link->priv = dev;
|
link->priv = dev;
|
||||||
@ -496,19 +489,13 @@ static dev_link_t *nmclan_attach(void)
|
|||||||
dev->watchdog_timeo = TX_TIMEOUT;
|
dev->watchdog_timeo = TX_TIMEOUT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
nmclan_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
nmclan_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* nmclan_attach */
|
} /* nmclan_attach */
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
||||||
@ -821,31 +808,6 @@ static int nmclan_resume(struct pcmcia_device *p_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------
|
|
||||||
nmclan_event
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
also sets some flags to discourage the net drivers from trying
|
|
||||||
to talk to the card any more.
|
|
||||||
---------------------------------------------------------------------------- */
|
|
||||||
static int nmclan_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "nmclan_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
nmclan_config(link);
|
|
||||||
break;
|
|
||||||
case CS_EVENT_RESET_REQUEST:
|
|
||||||
return 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* nmclan_event */
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
||||||
nmclan_reset
|
nmclan_reset
|
||||||
@ -1673,8 +1635,7 @@ static struct pcmcia_driver nmclan_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "nmclan_cs",
|
.name = "nmclan_cs",
|
||||||
},
|
},
|
||||||
.attach = nmclan_attach,
|
.probe = nmclan_attach,
|
||||||
.event = nmclan_event,
|
|
||||||
.remove = nmclan_detach,
|
.remove = nmclan_detach,
|
||||||
.id_table = nmclan_ids,
|
.id_table = nmclan_ids,
|
||||||
.suspend = nmclan_suspend,
|
.suspend = nmclan_suspend,
|
||||||
|
@ -105,8 +105,6 @@ module_param_array(hw_addr, int, NULL, 0);
|
|||||||
static void mii_phy_probe(struct net_device *dev);
|
static void mii_phy_probe(struct net_device *dev);
|
||||||
static void pcnet_config(dev_link_t *link);
|
static void pcnet_config(dev_link_t *link);
|
||||||
static void pcnet_release(dev_link_t *link);
|
static void pcnet_release(dev_link_t *link);
|
||||||
static int pcnet_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
static int pcnet_open(struct net_device *dev);
|
static int pcnet_open(struct net_device *dev);
|
||||||
static int pcnet_close(struct net_device *dev);
|
static int pcnet_close(struct net_device *dev);
|
||||||
static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
||||||
@ -120,7 +118,6 @@ static int setup_shmem_window(dev_link_t *link, int start_pg,
|
|||||||
static int setup_dma_config(dev_link_t *link, int start_pg,
|
static int setup_dma_config(dev_link_t *link, int start_pg,
|
||||||
int stop_pg);
|
int stop_pg);
|
||||||
|
|
||||||
static dev_link_t *pcnet_attach(void);
|
|
||||||
static void pcnet_detach(struct pcmcia_device *p_dev);
|
static void pcnet_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
static dev_info_t dev_info = "pcnet_cs";
|
static dev_info_t dev_info = "pcnet_cs";
|
||||||
@ -243,19 +240,17 @@ static inline pcnet_dev_t *PRIV(struct net_device *dev)
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *pcnet_attach(void)
|
static int pcnet_probe(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
pcnet_dev_t *info;
|
pcnet_dev_t *info;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
client_reg_t client_reg;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "pcnet_attach()\n");
|
DEBUG(0, "pcnet_attach()\n");
|
||||||
|
|
||||||
/* Create new ethernet device */
|
/* Create new ethernet device */
|
||||||
dev = __alloc_ei_netdev(sizeof(pcnet_dev_t));
|
dev = __alloc_ei_netdev(sizeof(pcnet_dev_t));
|
||||||
if (!dev) return NULL;
|
if (!dev) return -ENOMEM;
|
||||||
info = PRIV(dev);
|
info = PRIV(dev);
|
||||||
link = &info->link;
|
link = &info->link;
|
||||||
link->priv = dev;
|
link->priv = dev;
|
||||||
@ -270,19 +265,13 @@ static dev_link_t *pcnet_attach(void)
|
|||||||
dev->stop = &pcnet_close;
|
dev->stop = &pcnet_close;
|
||||||
dev->set_config = &set_config;
|
dev->set_config = &set_config;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != CS_SUCCESS) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
pcnet_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
pcnet_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* pcnet_attach */
|
} /* pcnet_attach */
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -800,21 +789,6 @@ static int pcnet_resume(struct pcmcia_device *p_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pcnet_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(2, "pcnet_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
pcnet_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* pcnet_event */
|
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
|
|
||||||
@ -1835,8 +1809,7 @@ static struct pcmcia_driver pcnet_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "pcnet_cs",
|
.name = "pcnet_cs",
|
||||||
},
|
},
|
||||||
.attach = pcnet_attach,
|
.probe = pcnet_probe,
|
||||||
.event = pcnet_event,
|
|
||||||
.remove = pcnet_detach,
|
.remove = pcnet_detach,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.id_table = pcnet_ids,
|
.id_table = pcnet_ids,
|
||||||
|
@ -102,8 +102,6 @@ static const char *version =
|
|||||||
currently have room for another Tx packet. */
|
currently have room for another Tx packet. */
|
||||||
#define MEMORY_WAIT_TIME 8
|
#define MEMORY_WAIT_TIME 8
|
||||||
|
|
||||||
static dev_info_t dev_info = "smc91c92_cs";
|
|
||||||
|
|
||||||
struct smc_private {
|
struct smc_private {
|
||||||
dev_link_t link;
|
dev_link_t link;
|
||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
@ -279,12 +277,9 @@ enum RxCfg { RxAllMulti = 0x0004, RxPromisc = 0x0002,
|
|||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
|
|
||||||
static dev_link_t *smc91c92_attach(void);
|
|
||||||
static void smc91c92_detach(struct pcmcia_device *p_dev);
|
static void smc91c92_detach(struct pcmcia_device *p_dev);
|
||||||
static void smc91c92_config(dev_link_t *link);
|
static void smc91c92_config(dev_link_t *link);
|
||||||
static void smc91c92_release(dev_link_t *link);
|
static void smc91c92_release(dev_link_t *link);
|
||||||
static int smc91c92_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
static int smc_open(struct net_device *dev);
|
static int smc_open(struct net_device *dev);
|
||||||
static int smc_close(struct net_device *dev);
|
static int smc_close(struct net_device *dev);
|
||||||
@ -313,20 +308,18 @@ static struct ethtool_ops ethtool_ops;
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *smc91c92_attach(void)
|
static int smc91c92_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
client_reg_t client_reg;
|
|
||||||
struct smc_private *smc;
|
struct smc_private *smc;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "smc91c92_attach()\n");
|
DEBUG(0, "smc91c92_attach()\n");
|
||||||
|
|
||||||
/* Create new ethernet device */
|
/* Create new ethernet device */
|
||||||
dev = alloc_etherdev(sizeof(struct smc_private));
|
dev = alloc_etherdev(sizeof(struct smc_private));
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
smc = netdev_priv(dev);
|
smc = netdev_priv(dev);
|
||||||
link = &smc->link;
|
link = &smc->link;
|
||||||
link->priv = dev;
|
link->priv = dev;
|
||||||
@ -364,19 +357,13 @@ static dev_link_t *smc91c92_attach(void)
|
|||||||
smc->mii_if.phy_id_mask = 0x1f;
|
smc->mii_if.phy_id_mask = 0x1f;
|
||||||
smc->mii_if.reg_num_mask = 0x1f;
|
smc->mii_if.reg_num_mask = 0x1f;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
smc91c92_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
smc91c92_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* smc91c92_attach */
|
} /* smc91c92_attach */
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -1210,31 +1197,6 @@ static void smc91c92_release(dev_link_t *link)
|
|||||||
link->state &= ~DEV_CONFIG;
|
link->state &= ~DEV_CONFIG;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================================================================
|
|
||||||
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
also sets some flags to discourage the net drivers from trying
|
|
||||||
to talk to the card any more.
|
|
||||||
|
|
||||||
======================================================================*/
|
|
||||||
|
|
||||||
static int smc91c92_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "smc91c92_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
smc91c92_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* smc91c92_event */
|
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
|
|
||||||
MII interface support for SMC91cXX based cards
|
MII interface support for SMC91cXX based cards
|
||||||
@ -2349,8 +2311,7 @@ static struct pcmcia_driver smc91c92_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "smc91c92_cs",
|
.name = "smc91c92_cs",
|
||||||
},
|
},
|
||||||
.attach = smc91c92_attach,
|
.probe = smc91c92_attach,
|
||||||
.event = smc91c92_event,
|
|
||||||
.remove = smc91c92_detach,
|
.remove = smc91c92_detach,
|
||||||
.id_table = smc91c92_ids,
|
.id_table = smc91c92_ids,
|
||||||
.suspend = smc91c92_suspend,
|
.suspend = smc91c92_suspend,
|
||||||
|
@ -292,8 +292,6 @@ static void mii_wr(kio_addr_t ioaddr, u_char phyaddr, u_char phyreg,
|
|||||||
static int has_ce2_string(dev_link_t * link);
|
static int has_ce2_string(dev_link_t * link);
|
||||||
static void xirc2ps_config(dev_link_t * link);
|
static void xirc2ps_config(dev_link_t * link);
|
||||||
static void xirc2ps_release(dev_link_t * link);
|
static void xirc2ps_release(dev_link_t * link);
|
||||||
static int xirc2ps_event(event_t event, int priority,
|
|
||||||
event_callback_args_t * args);
|
|
||||||
|
|
||||||
/****************
|
/****************
|
||||||
* The attach() and detach() entry points are used to create and destroy
|
* The attach() and detach() entry points are used to create and destroy
|
||||||
@ -301,7 +299,6 @@ static int xirc2ps_event(event_t event, int priority,
|
|||||||
* needed to manage one actual PCMCIA card.
|
* needed to manage one actual PCMCIA card.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static dev_link_t *xirc2ps_attach(void);
|
|
||||||
static void xirc2ps_detach(struct pcmcia_device *p_dev);
|
static void xirc2ps_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
/****************
|
/****************
|
||||||
@ -313,14 +310,6 @@ static void xirc2ps_detach(struct pcmcia_device *p_dev);
|
|||||||
|
|
||||||
static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id, struct pt_regs *regs);
|
static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id, struct pt_regs *regs);
|
||||||
|
|
||||||
/*
|
|
||||||
* The dev_info variable is the "key" that is used to match up this
|
|
||||||
* device driver with appropriate cards, through the card configuration
|
|
||||||
* database.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "xirc2ps_cs";
|
|
||||||
|
|
||||||
/****************
|
/****************
|
||||||
* A linked list of "instances" of the device. Each actual
|
* A linked list of "instances" of the device. Each actual
|
||||||
* PCMCIA card corresponds to one device instance, and is described
|
* PCMCIA card corresponds to one device instance, and is described
|
||||||
@ -563,21 +552,19 @@ mii_wr(kio_addr_t ioaddr, u_char phyaddr, u_char phyreg, unsigned data, int len)
|
|||||||
* card insertion event.
|
* card insertion event.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static dev_link_t *
|
static int
|
||||||
xirc2ps_attach(void)
|
xirc2ps_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
local_info_t *local;
|
local_info_t *local;
|
||||||
int err;
|
|
||||||
|
|
||||||
DEBUG(0, "attach()\n");
|
DEBUG(0, "attach()\n");
|
||||||
|
|
||||||
/* Allocate the device structure */
|
/* Allocate the device structure */
|
||||||
dev = alloc_etherdev(sizeof(local_info_t));
|
dev = alloc_etherdev(sizeof(local_info_t));
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
local = netdev_priv(dev);
|
local = netdev_priv(dev);
|
||||||
link = &local->link;
|
link = &local->link;
|
||||||
link->priv = dev;
|
link->priv = dev;
|
||||||
@ -606,18 +593,13 @@ xirc2ps_attach(void)
|
|||||||
dev->watchdog_timeo = TX_TIMEOUT;
|
dev->watchdog_timeo = TX_TIMEOUT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
if ((err = pcmcia_register_client(&link->handle, &client_reg))) {
|
|
||||||
cs_error(link->handle, RegisterClient, err);
|
|
||||||
xirc2ps_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
xirc2ps_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* xirc2ps_attach */
|
} /* xirc2ps_attach */
|
||||||
|
|
||||||
/****************
|
/****************
|
||||||
@ -1162,34 +1144,6 @@ static int xirc2ps_resume(struct pcmcia_device *p_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************
|
|
||||||
* The card status event handler. Mostly, this schedules other
|
|
||||||
* stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
* also sets some flags to discourage the net drivers from trying
|
|
||||||
* to talk to the card any more.
|
|
||||||
*
|
|
||||||
* When a CARD_REMOVAL event is received, we immediately set a flag
|
|
||||||
* to block future accesses to this device. All the functions that
|
|
||||||
* actually access the device should check this flag to make sure
|
|
||||||
* the card is still present.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static int
|
|
||||||
xirc2ps_event(event_t event, int priority,
|
|
||||||
event_callback_args_t * args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(0, "event(%d)\n", (int)event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
xirc2ps_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* xirc2ps_event */
|
|
||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
|
|
||||||
@ -1981,8 +1935,7 @@ static struct pcmcia_driver xirc2ps_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "xirc2ps_cs",
|
.name = "xirc2ps_cs",
|
||||||
},
|
},
|
||||||
.attach = xirc2ps_attach,
|
.probe = xirc2ps_attach,
|
||||||
.event = xirc2ps_event,
|
|
||||||
.remove = xirc2ps_detach,
|
.remove = xirc2ps_detach,
|
||||||
.id_table = xirc2ps_ids,
|
.id_table = xirc2ps_ids,
|
||||||
.suspend = xirc2ps_suspend,
|
.suspend = xirc2ps_suspend,
|
||||||
|
@ -82,8 +82,6 @@ MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340 PCMCIA cards");
|
|||||||
|
|
||||||
static void airo_config(dev_link_t *link);
|
static void airo_config(dev_link_t *link);
|
||||||
static void airo_release(dev_link_t *link);
|
static void airo_release(dev_link_t *link);
|
||||||
static int airo_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The attach() and detach() entry points are used to create and destroy
|
The attach() and detach() entry points are used to create and destroy
|
||||||
@ -91,7 +89,6 @@ static int airo_event(event_t event, int priority,
|
|||||||
needed to manage one actual PCMCIA card.
|
needed to manage one actual PCMCIA card.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static dev_link_t *airo_attach(void);
|
|
||||||
static void airo_detach(struct pcmcia_device *p_dev);
|
static void airo_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -101,14 +98,6 @@ static void airo_detach(struct pcmcia_device *p_dev);
|
|||||||
less on other parts of the kernel.
|
less on other parts of the kernel.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
The dev_info variable is the "key" that is used to match up this
|
|
||||||
device driver with appropriate cards, through the card configuration
|
|
||||||
database.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "airo_cs";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
A linked list of "instances" of the aironet device. Each actual
|
A linked list of "instances" of the aironet device. Each actual
|
||||||
PCMCIA card corresponds to one device instance, and is described
|
PCMCIA card corresponds to one device instance, and is described
|
||||||
@ -152,12 +141,10 @@ typedef struct local_info_t {
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *airo_attach(void)
|
static int airo_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
local_info_t *local;
|
local_info_t *local;
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "airo_attach()\n");
|
DEBUG(0, "airo_attach()\n");
|
||||||
|
|
||||||
@ -165,7 +152,7 @@ static dev_link_t *airo_attach(void)
|
|||||||
link = kzalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
link = kzalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
||||||
if (!link) {
|
if (!link) {
|
||||||
printk(KERN_ERR "airo_cs: no memory for new device\n");
|
printk(KERN_ERR "airo_cs: no memory for new device\n");
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Interrupt setup */
|
/* Interrupt setup */
|
||||||
@ -189,23 +176,17 @@ static dev_link_t *airo_attach(void)
|
|||||||
if (!local) {
|
if (!local) {
|
||||||
printk(KERN_ERR "airo_cs: no memory for new device\n");
|
printk(KERN_ERR "airo_cs: no memory for new device\n");
|
||||||
kfree (link);
|
kfree (link);
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
link->priv = local;
|
link->priv = local;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
airo_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
airo_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* airo_attach */
|
} /* airo_attach */
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -497,34 +478,6 @@ static int airo_resume(struct pcmcia_device *p_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================================================================
|
|
||||||
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received.
|
|
||||||
|
|
||||||
When a CARD_REMOVAL event is received, we immediately set a
|
|
||||||
private flag to block future accesses to this device. All the
|
|
||||||
functions that actually access the device should check this flag
|
|
||||||
to make sure the card is still present.
|
|
||||||
|
|
||||||
======================================================================*/
|
|
||||||
|
|
||||||
static int airo_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "airo_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
airo_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* airo_event */
|
|
||||||
|
|
||||||
static struct pcmcia_device_id airo_ids[] = {
|
static struct pcmcia_device_id airo_ids[] = {
|
||||||
PCMCIA_DEVICE_MANF_CARD(0x015f, 0x000a),
|
PCMCIA_DEVICE_MANF_CARD(0x015f, 0x000a),
|
||||||
PCMCIA_DEVICE_MANF_CARD(0x015f, 0x0005),
|
PCMCIA_DEVICE_MANF_CARD(0x015f, 0x0005),
|
||||||
@ -539,8 +492,7 @@ static struct pcmcia_driver airo_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "airo_cs",
|
.name = "airo_cs",
|
||||||
},
|
},
|
||||||
.attach = airo_attach,
|
.probe = airo_attach,
|
||||||
.event = airo_event,
|
|
||||||
.remove = airo_detach,
|
.remove = airo_detach,
|
||||||
.id_table = airo_ids,
|
.id_table = airo_ids,
|
||||||
.suspend = airo_suspend,
|
.suspend = airo_suspend,
|
||||||
|
@ -93,8 +93,6 @@ MODULE_SUPPORTED_DEVICE("Atmel at76c50x PCMCIA cards");
|
|||||||
|
|
||||||
static void atmel_config(dev_link_t *link);
|
static void atmel_config(dev_link_t *link);
|
||||||
static void atmel_release(dev_link_t *link);
|
static void atmel_release(dev_link_t *link);
|
||||||
static int atmel_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The attach() and detach() entry points are used to create and destroy
|
The attach() and detach() entry points are used to create and destroy
|
||||||
@ -102,7 +100,6 @@ static int atmel_event(event_t event, int priority,
|
|||||||
needed to manage one actual PCMCIA card.
|
needed to manage one actual PCMCIA card.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static dev_link_t *atmel_attach(void);
|
|
||||||
static void atmel_detach(struct pcmcia_device *p_dev);
|
static void atmel_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -112,14 +109,6 @@ static void atmel_detach(struct pcmcia_device *p_dev);
|
|||||||
less on other parts of the kernel.
|
less on other parts of the kernel.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
The dev_info variable is the "key" that is used to match up this
|
|
||||||
device driver with appropriate cards, through the card configuration
|
|
||||||
database.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "atmel_cs";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
A linked list of "instances" of the atmelnet device. Each actual
|
A linked list of "instances" of the atmelnet device. Each actual
|
||||||
PCMCIA card corresponds to one device instance, and is described
|
PCMCIA card corresponds to one device instance, and is described
|
||||||
@ -163,12 +152,10 @@ typedef struct local_info_t {
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *atmel_attach(void)
|
static int atmel_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
local_info_t *local;
|
local_info_t *local;
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "atmel_attach()\n");
|
DEBUG(0, "atmel_attach()\n");
|
||||||
|
|
||||||
@ -176,7 +163,7 @@ static dev_link_t *atmel_attach(void)
|
|||||||
link = kzalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
link = kzalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
||||||
if (!link) {
|
if (!link) {
|
||||||
printk(KERN_ERR "atmel_cs: no memory for new device\n");
|
printk(KERN_ERR "atmel_cs: no memory for new device\n");
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Interrupt setup */
|
/* Interrupt setup */
|
||||||
@ -200,23 +187,17 @@ static dev_link_t *atmel_attach(void)
|
|||||||
if (!local) {
|
if (!local) {
|
||||||
printk(KERN_ERR "atmel_cs: no memory for new device\n");
|
printk(KERN_ERR "atmel_cs: no memory for new device\n");
|
||||||
kfree (link);
|
kfree (link);
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
link->priv = local;
|
link->priv = local;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
atmel_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
atmel_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* atmel_attach */
|
} /* atmel_attach */
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -485,34 +466,6 @@ static int atmel_resume(struct pcmcia_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================================================================
|
|
||||||
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received.
|
|
||||||
|
|
||||||
When a CARD_REMOVAL event is received, we immediately set a
|
|
||||||
private flag to block future accesses to this device. All the
|
|
||||||
functions that actually access the device should check this flag
|
|
||||||
to make sure the card is still present.
|
|
||||||
|
|
||||||
======================================================================*/
|
|
||||||
|
|
||||||
static int atmel_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "atmel_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
atmel_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* atmel_event */
|
|
||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
/* We use the driver_info field to store the correct firmware type for a card. */
|
/* We use the driver_info field to store the correct firmware type for a card. */
|
||||||
|
|
||||||
@ -562,8 +515,7 @@ static struct pcmcia_driver atmel_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "atmel_cs",
|
.name = "atmel_cs",
|
||||||
},
|
},
|
||||||
.attach = atmel_attach,
|
.probe = atmel_attach,
|
||||||
.event = atmel_event,
|
|
||||||
.remove = atmel_detach,
|
.remove = atmel_detach,
|
||||||
.id_table = atmel_ids,
|
.id_table = atmel_ids,
|
||||||
.suspend = atmel_suspend,
|
.suspend = atmel_suspend,
|
||||||
|
@ -204,8 +204,7 @@ static int hfa384x_to_bap(struct net_device *dev, u16 bap, void *buf, int len)
|
|||||||
|
|
||||||
static void prism2_detach(struct pcmcia_device *p_dev);
|
static void prism2_detach(struct pcmcia_device *p_dev);
|
||||||
static void prism2_release(u_long arg);
|
static void prism2_release(u_long arg);
|
||||||
static int prism2_event(event_t event, int priority,
|
static int prism2_config(dev_link_t *link);
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
|
|
||||||
static int prism2_pccard_card_present(local_info_t *local)
|
static int prism2_pccard_card_present(local_info_t *local)
|
||||||
@ -502,15 +501,13 @@ static struct prism2_helper_functions prism2_pccard_funcs =
|
|||||||
|
|
||||||
/* allocate local data and register with CardServices
|
/* allocate local data and register with CardServices
|
||||||
* initialize dev_link structure, but do not configure the card yet */
|
* initialize dev_link structure, but do not configure the card yet */
|
||||||
static dev_link_t *prism2_attach(void)
|
static int prism2_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
client_reg_t client_reg;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
link = kmalloc(sizeof(dev_link_t), GFP_KERNEL);
|
link = kmalloc(sizeof(dev_link_t), GFP_KERNEL);
|
||||||
if (link == NULL)
|
if (link == NULL)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
|
|
||||||
memset(link, 0, sizeof(dev_link_t));
|
memset(link, 0, sizeof(dev_link_t));
|
||||||
|
|
||||||
@ -518,18 +515,14 @@ static dev_link_t *prism2_attach(void)
|
|||||||
link->conf.Vcc = 33;
|
link->conf.Vcc = 33;
|
||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
|
|
||||||
/* register with CardServices */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
client_reg.event_callback_args.client_data = link;
|
if (prism2_config(link))
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
PDEBUG(DEBUG_EXTRA, "prism2_config() failed\n");
|
||||||
if (ret != CS_SUCCESS) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
return 0;
|
||||||
prism2_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return link;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -878,29 +871,6 @@ static int hostap_cs_resume(struct pcmcia_device *p_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int prism2_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_CARD_INSERTION\n", dev_info);
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
if (prism2_config(link)) {
|
|
||||||
PDEBUG(DEBUG_EXTRA, "prism2_config() failed\n");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
PDEBUG(DEBUG_EXTRA, "%s: prism2_event() - unknown event %d\n",
|
|
||||||
dev_info, event);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static struct pcmcia_device_id hostap_cs_ids[] = {
|
static struct pcmcia_device_id hostap_cs_ids[] = {
|
||||||
PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7100),
|
PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7100),
|
||||||
PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7300),
|
PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7300),
|
||||||
@ -959,10 +929,9 @@ static struct pcmcia_driver hostap_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "hostap_cs",
|
.name = "hostap_cs",
|
||||||
},
|
},
|
||||||
.attach = prism2_attach,
|
.probe = prism2_attach,
|
||||||
.remove = prism2_detach,
|
.remove = prism2_detach,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.event = prism2_event,
|
|
||||||
.id_table = hostap_cs_ids,
|
.id_table = hostap_cs_ids,
|
||||||
.suspend = hostap_cs_suspend,
|
.suspend = hostap_cs_suspend,
|
||||||
.resume = hostap_cs_resume,
|
.resume = hostap_cs_resume,
|
||||||
|
@ -166,8 +166,6 @@ static char *version =
|
|||||||
#define DEBUG(n, args...)
|
#define DEBUG(n, args...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static dev_info_t dev_info = "netwave_cs";
|
|
||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
|
|
||||||
/* Parameters that can be set with 'insmod' */
|
/* Parameters that can be set with 'insmod' */
|
||||||
@ -195,11 +193,8 @@ module_param(mem_speed, int, 0);
|
|||||||
|
|
||||||
/* PCMCIA (Card Services) related functions */
|
/* PCMCIA (Card Services) related functions */
|
||||||
static void netwave_release(dev_link_t *link); /* Card removal */
|
static void netwave_release(dev_link_t *link); /* Card removal */
|
||||||
static int netwave_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
static void netwave_pcmcia_config(dev_link_t *arg); /* Runs after card
|
static void netwave_pcmcia_config(dev_link_t *arg); /* Runs after card
|
||||||
insertion */
|
insertion */
|
||||||
static dev_link_t *netwave_attach(void); /* Create instance */
|
|
||||||
static void netwave_detach(struct pcmcia_device *p_dev); /* Destroy instance */
|
static void netwave_detach(struct pcmcia_device *p_dev); /* Destroy instance */
|
||||||
|
|
||||||
/* Hardware configuration */
|
/* Hardware configuration */
|
||||||
@ -383,20 +378,18 @@ static struct iw_statistics *netwave_get_wireless_stats(struct net_device *dev)
|
|||||||
* configure the card at this point -- we wait until we receive a
|
* configure the card at this point -- we wait until we receive a
|
||||||
* card insertion event.
|
* card insertion event.
|
||||||
*/
|
*/
|
||||||
static dev_link_t *netwave_attach(void)
|
static int netwave_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
netwave_private *priv;
|
netwave_private *priv;
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "netwave_attach()\n");
|
DEBUG(0, "netwave_attach()\n");
|
||||||
|
|
||||||
/* Initialize the dev_link_t structure */
|
/* Initialize the dev_link_t structure */
|
||||||
dev = alloc_etherdev(sizeof(netwave_private));
|
dev = alloc_etherdev(sizeof(netwave_private));
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
priv = netdev_priv(dev);
|
priv = netdev_priv(dev);
|
||||||
link = &priv->link;
|
link = &priv->link;
|
||||||
link->priv = dev;
|
link->priv = dev;
|
||||||
@ -439,19 +432,13 @@ static dev_link_t *netwave_attach(void)
|
|||||||
dev->stop = &netwave_close;
|
dev->stop = &netwave_close;
|
||||||
link->irq.Instance = dev;
|
link->irq.Instance = dev;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
netwave_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
netwave_pcmcia_config( link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* netwave_attach */
|
} /* netwave_attach */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -934,36 +921,6 @@ static int netwave_resume(struct pcmcia_device *p_dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Function netwave_event (event, priority, args)
|
|
||||||
*
|
|
||||||
* The card status event handler. Mostly, this schedules other
|
|
||||||
* stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
* also sets some flags to discourage the net drivers from trying
|
|
||||||
* to talk to the card any more.
|
|
||||||
*
|
|
||||||
* When a CARD_REMOVAL event is received, we immediately set a flag
|
|
||||||
* to block future accesses to this device. All the functions that
|
|
||||||
* actually access the device should check this flag to make sure
|
|
||||||
* the card is still present.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
static int netwave_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "netwave_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
netwave_pcmcia_config( link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* netwave_event */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Function netwave_doreset (ioBase, ramBase)
|
* Function netwave_doreset (ioBase, ramBase)
|
||||||
*
|
*
|
||||||
@ -1456,8 +1413,7 @@ static struct pcmcia_driver netwave_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "netwave_cs",
|
.name = "netwave_cs",
|
||||||
},
|
},
|
||||||
.attach = netwave_attach,
|
.probe = netwave_attach,
|
||||||
.event = netwave_event,
|
|
||||||
.remove = netwave_detach,
|
.remove = netwave_detach,
|
||||||
.id_table = netwave_ids,
|
.id_table = netwave_ids,
|
||||||
.suspend = netwave_suspend,
|
.suspend = netwave_suspend,
|
||||||
|
@ -42,17 +42,6 @@ static int ignore_cis_vcc; /* = 0 */
|
|||||||
module_param(ignore_cis_vcc, int, 0);
|
module_param(ignore_cis_vcc, int, 0);
|
||||||
MODULE_PARM_DESC(ignore_cis_vcc, "Allow voltage mismatch between card and socket");
|
MODULE_PARM_DESC(ignore_cis_vcc, "Allow voltage mismatch between card and socket");
|
||||||
|
|
||||||
/********************************************************************/
|
|
||||||
/* Magic constants */
|
|
||||||
/********************************************************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The dev_info variable is the "key" that is used to match up this
|
|
||||||
* device driver with appropriate cards, through the card
|
|
||||||
* configuration database.
|
|
||||||
*/
|
|
||||||
static dev_info_t dev_info = DRIVER_NAME;
|
|
||||||
|
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
/* Data structures */
|
/* Data structures */
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
@ -74,6 +63,7 @@ struct orinoco_pccard {
|
|||||||
/* Function prototypes */
|
/* Function prototypes */
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
|
|
||||||
|
static void orinoco_cs_config(dev_link_t *link);
|
||||||
static void orinoco_cs_release(dev_link_t *link);
|
static void orinoco_cs_release(dev_link_t *link);
|
||||||
static void orinoco_cs_detach(struct pcmcia_device *p_dev);
|
static void orinoco_cs_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
@ -113,19 +103,17 @@ orinoco_cs_hard_reset(struct orinoco_private *priv)
|
|||||||
* The dev_link structure is initialized, but we don't actually
|
* The dev_link structure is initialized, but we don't actually
|
||||||
* configure the card at this point -- we wait until we receive a card
|
* configure the card at this point -- we wait until we receive a card
|
||||||
* insertion event. */
|
* insertion event. */
|
||||||
static dev_link_t *
|
static int
|
||||||
orinoco_cs_attach(void)
|
orinoco_cs_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
struct orinoco_private *priv;
|
struct orinoco_private *priv;
|
||||||
struct orinoco_pccard *card;
|
struct orinoco_pccard *card;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
client_reg_t client_reg;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
dev = alloc_orinocodev(sizeof(*card), orinoco_cs_hard_reset);
|
dev = alloc_orinocodev(sizeof(*card), orinoco_cs_hard_reset);
|
||||||
if (! dev)
|
if (! dev)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
priv = netdev_priv(dev);
|
priv = netdev_priv(dev);
|
||||||
card = priv->card;
|
card = priv->card;
|
||||||
|
|
||||||
@ -150,18 +138,13 @@ orinoco_cs_attach(void)
|
|||||||
/* Register with Card Services */
|
/* Register with Card Services */
|
||||||
link->next = NULL;
|
link->next = NULL;
|
||||||
|
|
||||||
client_reg.dev_info = &dev_info;
|
link->handle = p_dev;
|
||||||
client_reg.Version = 0x0210; /* FIXME: what does this mean? */
|
p_dev->instance = link;
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
if (ret != CS_SUCCESS) {
|
orinoco_cs_config(link);
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
orinoco_cs_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
return 0;
|
||||||
} /* orinoco_cs_attach */
|
} /* orinoco_cs_attach */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -521,26 +504,6 @@ static int orinoco_cs_resume(struct pcmcia_device *p_dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The card status event handler. Mostly, this schedules other stuff
|
|
||||||
* to run after an event is received.
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
orinoco_cs_event(event_t event, int priority,
|
|
||||||
event_callback_args_t * args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
orinoco_cs_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
} /* orinoco_cs_event */
|
|
||||||
|
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
/* Module initialization */
|
/* Module initialization */
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
@ -640,9 +603,8 @@ static struct pcmcia_driver orinoco_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = DRIVER_NAME,
|
.name = DRIVER_NAME,
|
||||||
},
|
},
|
||||||
.attach = orinoco_cs_attach,
|
.probe = orinoco_cs_attach,
|
||||||
.remove = orinoco_cs_detach,
|
.remove = orinoco_cs_detach,
|
||||||
.event = orinoco_cs_event,
|
|
||||||
.id_table = orinoco_cs_ids,
|
.id_table = orinoco_cs_ids,
|
||||||
.suspend = orinoco_cs_suspend,
|
.suspend = orinoco_cs_suspend,
|
||||||
.resume = orinoco_cs_resume,
|
.resume = orinoco_cs_resume,
|
||||||
|
@ -92,8 +92,6 @@ module_param(pc_debug, int, 0);
|
|||||||
/** Prototypes based on PCMCIA skeleton driver *******************************/
|
/** Prototypes based on PCMCIA skeleton driver *******************************/
|
||||||
static void ray_config(dev_link_t *link);
|
static void ray_config(dev_link_t *link);
|
||||||
static void ray_release(dev_link_t *link);
|
static void ray_release(dev_link_t *link);
|
||||||
static int ray_event(event_t event, int priority, event_callback_args_t *args);
|
|
||||||
static dev_link_t *ray_attach(void);
|
|
||||||
static void ray_detach(struct pcmcia_device *p_dev);
|
static void ray_detach(struct pcmcia_device *p_dev);
|
||||||
|
|
||||||
/***** Prototypes indicated by device structure ******************************/
|
/***** Prototypes indicated by device structure ******************************/
|
||||||
@ -192,12 +190,6 @@ static int bc;
|
|||||||
static char *phy_addr = NULL;
|
static char *phy_addr = NULL;
|
||||||
|
|
||||||
|
|
||||||
/* The dev_info variable is the "key" that is used to match up this
|
|
||||||
device driver with appropriate cards, through the card configuration
|
|
||||||
database.
|
|
||||||
*/
|
|
||||||
static dev_info_t dev_info = "ray_cs";
|
|
||||||
|
|
||||||
/* A linked list of "instances" of the ray device. Each actual
|
/* A linked list of "instances" of the ray device. Each actual
|
||||||
PCMCIA card corresponds to one device instance, and is described
|
PCMCIA card corresponds to one device instance, and is described
|
||||||
by one dev_link_t structure (defined in ds.h).
|
by one dev_link_t structure (defined in ds.h).
|
||||||
@ -314,12 +306,10 @@ static char rcsid[] = "Raylink/WebGear wireless LAN - Corey <Thomas corey@world.
|
|||||||
configure the card at this point -- we wait until we receive a
|
configure the card at this point -- we wait until we receive a
|
||||||
card insertion event.
|
card insertion event.
|
||||||
=============================================================================*/
|
=============================================================================*/
|
||||||
static dev_link_t *ray_attach(void)
|
static int ray_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
ray_dev_t *local;
|
ray_dev_t *local;
|
||||||
int ret;
|
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
|
|
||||||
DEBUG(1, "ray_attach()\n");
|
DEBUG(1, "ray_attach()\n");
|
||||||
@ -328,7 +318,7 @@ static dev_link_t *ray_attach(void)
|
|||||||
link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
||||||
|
|
||||||
if (!link)
|
if (!link)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* Allocate space for private device-specific data */
|
/* Allocate space for private device-specific data */
|
||||||
dev = alloc_etherdev(sizeof(ray_dev_t));
|
dev = alloc_etherdev(sizeof(ray_dev_t));
|
||||||
@ -387,30 +377,19 @@ static dev_link_t *ray_attach(void)
|
|||||||
dev->stop = &ray_dev_close;
|
dev->stop = &ray_dev_close;
|
||||||
netif_stop_queue(dev);
|
netif_stop_queue(dev);
|
||||||
|
|
||||||
/* Register with Card Services */
|
|
||||||
link->next = dev_list;
|
|
||||||
dev_list = link;
|
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
|
|
||||||
DEBUG(2,"ray_cs ray_attach calling pcmcia_register_client(...)\n");
|
|
||||||
|
|
||||||
init_timer(&local->timer);
|
init_timer(&local->timer);
|
||||||
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
link->handle = p_dev;
|
||||||
if (ret != 0) {
|
p_dev->instance = link;
|
||||||
printk("ray_cs ray_attach RegisterClient unhappy - detaching\n");
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
ray_detach(link->handle);
|
ray_config(link);
|
||||||
return NULL;
|
|
||||||
}
|
return 0;
|
||||||
DEBUG(2,"ray_cs ray_attach ending\n");
|
|
||||||
return link;
|
|
||||||
|
|
||||||
fail_alloc_dev:
|
fail_alloc_dev:
|
||||||
kfree(link);
|
kfree(link);
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
} /* ray_attach */
|
} /* ray_attach */
|
||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
This deletes a driver "instance". The device is de-registered
|
This deletes a driver "instance". The device is de-registered
|
||||||
@ -924,32 +903,6 @@ static int ray_resume(struct pcmcia_device *p_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*=============================================================================
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
also sets some flags to discourage the net drivers from trying
|
|
||||||
to talk to the card any more.
|
|
||||||
|
|
||||||
When a CARD_REMOVAL event is received, we immediately set a flag
|
|
||||||
to block future accesses to this device. All the functions that
|
|
||||||
actually access the device should check this flag to make sure
|
|
||||||
the card is still present.
|
|
||||||
=============================================================================*/
|
|
||||||
static int ray_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
DEBUG(1, "ray_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
ray_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
DEBUG(2,"ray_event ending\n");
|
|
||||||
} /* ray_event */
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
int ray_dev_init(struct net_device *dev)
|
int ray_dev_init(struct net_device *dev)
|
||||||
{
|
{
|
||||||
@ -2945,8 +2898,7 @@ static struct pcmcia_driver ray_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "ray_cs",
|
.name = "ray_cs",
|
||||||
},
|
},
|
||||||
.attach = ray_attach,
|
.probe = ray_attach,
|
||||||
.event = ray_event,
|
|
||||||
.remove = ray_detach,
|
.remove = ray_detach,
|
||||||
.id_table = ray_ids,
|
.id_table = ray_ids,
|
||||||
.suspend = ray_suspend,
|
.suspend = ray_suspend,
|
||||||
|
@ -56,17 +56,6 @@ static int ignore_cis_vcc; /* = 0 */
|
|||||||
module_param(ignore_cis_vcc, int, 0);
|
module_param(ignore_cis_vcc, int, 0);
|
||||||
MODULE_PARM_DESC(ignore_cis_vcc, "Allow voltage mismatch between card and socket");
|
MODULE_PARM_DESC(ignore_cis_vcc, "Allow voltage mismatch between card and socket");
|
||||||
|
|
||||||
/********************************************************************/
|
|
||||||
/* Magic constants */
|
|
||||||
/********************************************************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The dev_info variable is the "key" that is used to match up this
|
|
||||||
* device driver with appropriate cards, through the card
|
|
||||||
* configuration database.
|
|
||||||
*/
|
|
||||||
static dev_info_t dev_info = DRIVER_NAME;
|
|
||||||
|
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
/* Data structures */
|
/* Data structures */
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
@ -82,8 +71,8 @@ struct orinoco_pccard {
|
|||||||
/* Function prototypes */
|
/* Function prototypes */
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
|
|
||||||
|
static void spectrum_cs_config(dev_link_t *link);
|
||||||
static void spectrum_cs_release(dev_link_t *link);
|
static void spectrum_cs_release(dev_link_t *link);
|
||||||
static void spectrum_cs_detach(struct pcmcia_device *p_dev);
|
|
||||||
|
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
/* Firmware downloader */
|
/* Firmware downloader */
|
||||||
@ -594,19 +583,17 @@ spectrum_cs_hard_reset(struct orinoco_private *priv)
|
|||||||
* The dev_link structure is initialized, but we don't actually
|
* The dev_link structure is initialized, but we don't actually
|
||||||
* configure the card at this point -- we wait until we receive a card
|
* configure the card at this point -- we wait until we receive a card
|
||||||
* insertion event. */
|
* insertion event. */
|
||||||
static dev_link_t *
|
static int
|
||||||
spectrum_cs_attach(void)
|
spectrum_cs_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
struct orinoco_private *priv;
|
struct orinoco_private *priv;
|
||||||
struct orinoco_pccard *card;
|
struct orinoco_pccard *card;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
client_reg_t client_reg;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
dev = alloc_orinocodev(sizeof(*card), spectrum_cs_hard_reset);
|
dev = alloc_orinocodev(sizeof(*card), spectrum_cs_hard_reset);
|
||||||
if (! dev)
|
if (! dev)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
priv = netdev_priv(dev);
|
priv = netdev_priv(dev);
|
||||||
card = priv->card;
|
card = priv->card;
|
||||||
|
|
||||||
@ -628,22 +615,13 @@ spectrum_cs_attach(void)
|
|||||||
link->conf.Attributes = 0;
|
link->conf.Attributes = 0;
|
||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
/* FIXME: need a lock? */
|
p_dev->instance = link;
|
||||||
link->next = NULL; /* not needed */
|
|
||||||
|
|
||||||
client_reg.dev_info = &dev_info;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
client_reg.Version = 0x0210; /* FIXME: what does this mean? */
|
spectrum_cs_config(link);
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
return 0;
|
||||||
if (ret != CS_SUCCESS) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
spectrum_cs_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
|
||||||
} /* spectrum_cs_attach */
|
} /* spectrum_cs_attach */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -977,26 +955,6 @@ spectrum_cs_resume(struct pcmcia_device *p_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* The card status event handler. Mostly, this schedules other stuff
|
|
||||||
* to run after an event is received.
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
spectrum_cs_event(event_t event, int priority,
|
|
||||||
event_callback_args_t * args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
spectrum_cs_config(link);
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
} /* spectrum_cs_event */
|
|
||||||
|
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
/* Module initialization */
|
/* Module initialization */
|
||||||
@ -1021,11 +979,10 @@ static struct pcmcia_driver orinoco_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = DRIVER_NAME,
|
.name = DRIVER_NAME,
|
||||||
},
|
},
|
||||||
.attach = spectrum_cs_attach,
|
.probe = spectrum_cs_attach,
|
||||||
.remove = spectrum_cs_detach,
|
.remove = spectrum_cs_detach,
|
||||||
.suspend = spectrum_cs_suspend,
|
.suspend = spectrum_cs_suspend,
|
||||||
.resume = spectrum_cs_resume,
|
.resume = spectrum_cs_resume,
|
||||||
.event = spectrum_cs_event,
|
|
||||||
.id_table = spectrum_cs_ids,
|
.id_table = spectrum_cs_ids,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4594,14 +4594,12 @@ wavelan_close(struct net_device * dev)
|
|||||||
* configure the card at this point -- we wait until we receive a
|
* configure the card at this point -- we wait until we receive a
|
||||||
* card insertion event.
|
* card insertion event.
|
||||||
*/
|
*/
|
||||||
static dev_link_t *
|
static int
|
||||||
wavelan_attach(void)
|
wavelan_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
client_reg_t client_reg; /* Register with cardmgr */
|
|
||||||
dev_link_t * link; /* Info for cardmgr */
|
dev_link_t * link; /* Info for cardmgr */
|
||||||
struct net_device * dev; /* Interface generic data */
|
struct net_device * dev; /* Interface generic data */
|
||||||
net_local * lp; /* Interface specific data */
|
net_local * lp; /* Interface specific data */
|
||||||
int ret;
|
|
||||||
|
|
||||||
#ifdef DEBUG_CALLBACK_TRACE
|
#ifdef DEBUG_CALLBACK_TRACE
|
||||||
printk(KERN_DEBUG "-> wavelan_attach()\n");
|
printk(KERN_DEBUG "-> wavelan_attach()\n");
|
||||||
@ -4609,7 +4607,7 @@ wavelan_attach(void)
|
|||||||
|
|
||||||
/* Initialize the dev_link_t structure */
|
/* Initialize the dev_link_t structure */
|
||||||
link = kzalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
link = kzalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
||||||
if (!link) return NULL;
|
if (!link) return -ENOMEM;
|
||||||
|
|
||||||
/* The io structure describes IO port mapping */
|
/* The io structure describes IO port mapping */
|
||||||
link->io.NumPorts1 = 8;
|
link->io.NumPorts1 = 8;
|
||||||
@ -4633,7 +4631,7 @@ wavelan_attach(void)
|
|||||||
dev = alloc_etherdev(sizeof(net_local));
|
dev = alloc_etherdev(sizeof(net_local));
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
kfree(link);
|
kfree(link);
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
link->priv = link->irq.Instance = dev;
|
link->priv = link->irq.Instance = dev;
|
||||||
|
|
||||||
@ -4678,28 +4676,21 @@ wavelan_attach(void)
|
|||||||
/* Other specific data */
|
/* Other specific data */
|
||||||
dev->mtu = WAVELAN_MTU;
|
dev->mtu = WAVELAN_MTU;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
client_reg.dev_info = &dev_info;
|
p_dev->instance = link;
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
|
|
||||||
#ifdef DEBUG_CONFIG_INFO
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
printk(KERN_DEBUG "wavelan_attach(): almost done, calling pcmcia_register_client\n");
|
if(wv_pcmcia_config(link) &&
|
||||||
#endif
|
wv_hw_config(dev))
|
||||||
|
wv_init_info(dev);
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
else
|
||||||
if(ret != 0)
|
dev->irq = 0;
|
||||||
{
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
wavelan_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_CALLBACK_TRACE
|
#ifdef DEBUG_CALLBACK_TRACE
|
||||||
printk(KERN_DEBUG "<- wavelan_attach()\n");
|
printk(KERN_DEBUG "<- wavelan_attach()\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return link;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
@ -4801,52 +4792,6 @@ static int wavelan_resume(struct pcmcia_device *p_dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
|
||||||
/*
|
|
||||||
* The card status event handler. Mostly, this schedules other stuff
|
|
||||||
* to run after an event is received. A CARD_REMOVAL event also sets
|
|
||||||
* some flags to discourage the net drivers from trying to talk to the
|
|
||||||
* card any more.
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
wavelan_event(event_t event, /* The event received */
|
|
||||||
int priority,
|
|
||||||
event_callback_args_t * args)
|
|
||||||
{
|
|
||||||
dev_link_t * link = (dev_link_t *) args->client_data;
|
|
||||||
struct net_device * dev = (struct net_device *) link->priv;
|
|
||||||
|
|
||||||
#ifdef DEBUG_CALLBACK_TRACE
|
|
||||||
printk(KERN_DEBUG "->wavelan_event(): %s\n",
|
|
||||||
((event == CS_EVENT_REGISTRATION_COMPLETE)?"registration complete" :
|
|
||||||
((event == CS_EVENT_CARD_REMOVAL) ? "card removal" :
|
|
||||||
((event == CS_EVENT_CARD_INSERTION) ? "card insertion" :
|
|
||||||
((event == CS_EVENT_PM_SUSPEND) ? "pm suspend" :
|
|
||||||
((event == CS_EVENT_RESET_PHYSICAL) ? "physical reset" :
|
|
||||||
((event == CS_EVENT_PM_RESUME) ? "pm resume" :
|
|
||||||
((event == CS_EVENT_CARD_RESET) ? "card reset" :
|
|
||||||
"unknown"))))))));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
switch(event)
|
|
||||||
{
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
/* Reset and configure the card */
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
if(wv_pcmcia_config(link) &&
|
|
||||||
wv_hw_config(dev))
|
|
||||||
wv_init_info(dev);
|
|
||||||
else
|
|
||||||
dev->irq = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_CALLBACK_TRACE
|
|
||||||
printk(KERN_DEBUG "<-wavelan_event()\n");
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct pcmcia_device_id wavelan_ids[] = {
|
static struct pcmcia_device_id wavelan_ids[] = {
|
||||||
PCMCIA_DEVICE_PROD_ID12("AT&T","WaveLAN/PCMCIA", 0xe7c5affd, 0x1bc50975),
|
PCMCIA_DEVICE_PROD_ID12("AT&T","WaveLAN/PCMCIA", 0xe7c5affd, 0x1bc50975),
|
||||||
PCMCIA_DEVICE_PROD_ID12("Digital", "RoamAbout/DS", 0x9999ab35, 0x00d05e06),
|
PCMCIA_DEVICE_PROD_ID12("Digital", "RoamAbout/DS", 0x9999ab35, 0x00d05e06),
|
||||||
@ -4861,8 +4806,7 @@ static struct pcmcia_driver wavelan_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "wavelan_cs",
|
.name = "wavelan_cs",
|
||||||
},
|
},
|
||||||
.attach = wavelan_attach,
|
.probe = wavelan_attach,
|
||||||
.event = wavelan_event,
|
|
||||||
.remove = wavelan_detach,
|
.remove = wavelan_detach,
|
||||||
.id_table = wavelan_ids,
|
.id_table = wavelan_ids,
|
||||||
.suspend = wavelan_suspend,
|
.suspend = wavelan_suspend,
|
||||||
|
@ -754,19 +754,11 @@ static void
|
|||||||
static int
|
static int
|
||||||
wavelan_open(struct net_device *), /* Open the device */
|
wavelan_open(struct net_device *), /* Open the device */
|
||||||
wavelan_close(struct net_device *); /* Close the device */
|
wavelan_close(struct net_device *); /* Close the device */
|
||||||
static dev_link_t *
|
|
||||||
wavelan_attach(void); /* Create a new device */
|
|
||||||
static void
|
static void
|
||||||
wavelan_detach(struct pcmcia_device *p_dev); /* Destroy a removed device */
|
wavelan_detach(struct pcmcia_device *p_dev); /* Destroy a removed device */
|
||||||
static int
|
|
||||||
wavelan_event(event_t, /* Manage pcmcia events */
|
|
||||||
int,
|
|
||||||
event_callback_args_t *);
|
|
||||||
|
|
||||||
/**************************** VARIABLES ****************************/
|
/**************************** VARIABLES ****************************/
|
||||||
|
|
||||||
static dev_info_t dev_info = "wavelan_cs";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parameters that can be set with 'insmod'
|
* Parameters that can be set with 'insmod'
|
||||||
* The exact syntax is 'insmod wavelan_cs.o <var>=<value>'
|
* The exact syntax is 'insmod wavelan_cs.o <var>=<value>'
|
||||||
|
@ -105,7 +105,6 @@ module_param(pc_debug, int, 0);
|
|||||||
*/
|
*/
|
||||||
static void wl3501_config(dev_link_t *link);
|
static void wl3501_config(dev_link_t *link);
|
||||||
static void wl3501_release(dev_link_t *link);
|
static void wl3501_release(dev_link_t *link);
|
||||||
static int wl3501_event(event_t event, int pri, event_callback_args_t *args);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The dev_info variable is the "key" that is used to match up this
|
* The dev_info variable is the "key" that is used to match up this
|
||||||
@ -1954,18 +1953,16 @@ static const struct iw_handler_def wl3501_handler_def = {
|
|||||||
* The dev_link structure is initialized, but we don't actually configure the
|
* The dev_link structure is initialized, but we don't actually configure the
|
||||||
* card at this point -- we wait until we receive a card insertion event.
|
* card at this point -- we wait until we receive a card insertion event.
|
||||||
*/
|
*/
|
||||||
static dev_link_t *wl3501_attach(void)
|
static int wl3501_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
struct wl3501_card *this;
|
struct wl3501_card *this;
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Initialize the dev_link_t structure */
|
/* Initialize the dev_link_t structure */
|
||||||
link = kzalloc(sizeof(*link), GFP_KERNEL);
|
link = kzalloc(sizeof(*link), GFP_KERNEL);
|
||||||
if (!link)
|
if (!link)
|
||||||
goto out;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* The io structure describes IO port mapping */
|
/* The io structure describes IO port mapping */
|
||||||
link->io.NumPorts1 = 16;
|
link->io.NumPorts1 = 16;
|
||||||
@ -2001,24 +1998,17 @@ static dev_link_t *wl3501_attach(void)
|
|||||||
netif_stop_queue(dev);
|
netif_stop_queue(dev);
|
||||||
link->priv = link->irq.Instance = dev;
|
link->priv = link->irq.Instance = dev;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = wl3501_dev_list;
|
p_dev->instance = link;
|
||||||
wl3501_dev_list = link;
|
|
||||||
client_reg.dev_info = &wl3501_dev_info;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
client_reg.Version = 0x0210;
|
wl3501_config(link);
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
return 0;
|
||||||
if (ret) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
wl3501_detach(link->handle);
|
|
||||||
link = NULL;
|
|
||||||
}
|
|
||||||
out:
|
|
||||||
return link;
|
|
||||||
out_link:
|
out_link:
|
||||||
kfree(link);
|
kfree(link);
|
||||||
link = NULL;
|
link = NULL;
|
||||||
goto out;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CS_CHECK(fn, ret) \
|
#define CS_CHECK(fn, ret) \
|
||||||
@ -2206,33 +2196,6 @@ static int wl3501_resume(struct pcmcia_device *p_dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* wl3501_event - The card status event handler
|
|
||||||
* @event - event
|
|
||||||
* @pri - priority
|
|
||||||
* @args - arguments for this event
|
|
||||||
*
|
|
||||||
* The card status event handler. Mostly, this schedules other stuff to run
|
|
||||||
* after an event is received. A CARD_REMOVAL event also sets some flags to
|
|
||||||
* discourage the net drivers from trying to talk to the card any more.
|
|
||||||
*
|
|
||||||
* When a CARD_REMOVAL event is received, we immediately set a flag to block
|
|
||||||
* future accesses to this device. All the functions that actually access the
|
|
||||||
* device should check this flag to make sure the card is still present.
|
|
||||||
*/
|
|
||||||
static int wl3501_event(event_t event, int pri, event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
wl3501_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct pcmcia_device_id wl3501_ids[] = {
|
static struct pcmcia_device_id wl3501_ids[] = {
|
||||||
PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0001),
|
PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0001),
|
||||||
PCMCIA_DEVICE_NULL
|
PCMCIA_DEVICE_NULL
|
||||||
@ -2244,8 +2207,7 @@ static struct pcmcia_driver wl3501_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "wl3501_cs",
|
.name = "wl3501_cs",
|
||||||
},
|
},
|
||||||
.attach = wl3501_attach,
|
.probe = wl3501_attach,
|
||||||
.event = wl3501_event,
|
|
||||||
.remove = wl3501_detach,
|
.remove = wl3501_detach,
|
||||||
.id_table = wl3501_ids,
|
.id_table = wl3501_ids,
|
||||||
.suspend = wl3501_suspend,
|
.suspend = wl3501_suspend,
|
||||||
|
@ -87,14 +87,9 @@ typedef struct parport_info_t {
|
|||||||
struct parport *port;
|
struct parport *port;
|
||||||
} parport_info_t;
|
} parport_info_t;
|
||||||
|
|
||||||
static dev_link_t *parport_attach(void);
|
|
||||||
static void parport_detach(struct pcmcia_device *p_dev);
|
static void parport_detach(struct pcmcia_device *p_dev);
|
||||||
static void parport_config(dev_link_t *link);
|
static void parport_config(dev_link_t *link);
|
||||||
static void parport_cs_release(dev_link_t *);
|
static void parport_cs_release(dev_link_t *);
|
||||||
static int parport_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "parport_cs";
|
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
|
|
||||||
@ -104,18 +99,16 @@ static dev_info_t dev_info = "parport_cs";
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *parport_attach(void)
|
static int parport_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
parport_info_t *info;
|
parport_info_t *info;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
client_reg_t client_reg;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "parport_attach()\n");
|
DEBUG(0, "parport_attach()\n");
|
||||||
|
|
||||||
/* Create new parport device */
|
/* Create new parport device */
|
||||||
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
||||||
if (!info) return NULL;
|
if (!info) return -ENOMEM;
|
||||||
memset(info, 0, sizeof(*info));
|
memset(info, 0, sizeof(*info));
|
||||||
link = &info->link; link->priv = info;
|
link = &info->link; link->priv = info;
|
||||||
|
|
||||||
@ -127,19 +120,13 @@ static dev_link_t *parport_attach(void)
|
|||||||
link->conf.Vcc = 50;
|
link->conf.Vcc = 50;
|
||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != CS_SUCCESS) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
parport_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
parport_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* parport_attach */
|
} /* parport_attach */
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -329,29 +316,6 @@ static int parport_resume(struct pcmcia_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================================================================
|
|
||||||
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received.
|
|
||||||
|
|
||||||
======================================================================*/
|
|
||||||
|
|
||||||
int parport_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "parport_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
parport_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* parport_event */
|
|
||||||
|
|
||||||
static struct pcmcia_device_id parport_ids[] = {
|
static struct pcmcia_device_id parport_ids[] = {
|
||||||
PCMCIA_DEVICE_FUNC_ID(3),
|
PCMCIA_DEVICE_FUNC_ID(3),
|
||||||
PCMCIA_DEVICE_MANF_CARD(0x0137, 0x0003),
|
PCMCIA_DEVICE_MANF_CARD(0x0137, 0x0003),
|
||||||
@ -364,8 +328,7 @@ static struct pcmcia_driver parport_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "parport_cs",
|
.name = "parport_cs",
|
||||||
},
|
},
|
||||||
.attach = parport_attach,
|
.probe = parport_attach,
|
||||||
.event = parport_event,
|
|
||||||
.remove = parport_detach,
|
.remove = parport_detach,
|
||||||
.id_table = parport_ids,
|
.id_table = parport_ids,
|
||||||
.suspend = parport_suspend,
|
.suspend = parport_suspend,
|
||||||
|
@ -203,7 +203,7 @@ static void pcmcia_check_driver(struct pcmcia_driver *p_drv)
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
u32 hash;
|
u32 hash;
|
||||||
|
|
||||||
if (!p_drv->attach || !p_drv->event || !p_drv->remove)
|
if (!p_drv->probe || !p_drv->remove)
|
||||||
printk(KERN_DEBUG "pcmcia: %s lacks a requisite callback "
|
printk(KERN_DEBUG "pcmcia: %s lacks a requisite callback "
|
||||||
"function\n", p_drv->drv.name);
|
"function\n", p_drv->drv.name);
|
||||||
|
|
||||||
@ -361,6 +361,7 @@ static int pcmcia_device_probe(struct device * dev)
|
|||||||
{
|
{
|
||||||
struct pcmcia_device *p_dev;
|
struct pcmcia_device *p_dev;
|
||||||
struct pcmcia_driver *p_drv;
|
struct pcmcia_driver *p_drv;
|
||||||
|
struct pcmcia_socket *s;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
dev = get_device(dev);
|
dev = get_device(dev);
|
||||||
@ -369,25 +370,39 @@ static int pcmcia_device_probe(struct device * dev)
|
|||||||
|
|
||||||
p_dev = to_pcmcia_dev(dev);
|
p_dev = to_pcmcia_dev(dev);
|
||||||
p_drv = to_pcmcia_drv(dev->driver);
|
p_drv = to_pcmcia_drv(dev->driver);
|
||||||
|
s = p_dev->socket;
|
||||||
|
|
||||||
if (!try_module_get(p_drv->owner)) {
|
if ((!p_drv->probe) || (!try_module_get(p_drv->owner))) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto put_dev;
|
goto put_dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_drv->attach) {
|
p_dev->state &= ~CLIENT_UNBOUND;
|
||||||
p_dev->instance = p_drv->attach();
|
|
||||||
if ((!p_dev->instance) || (p_dev->state & CLIENT_UNBOUND)) {
|
/* set up the device configuration, if it hasn't been done before */
|
||||||
printk(KERN_NOTICE "ds: unable to create instance "
|
if (!s->functions) {
|
||||||
"of '%s'!\n", p_drv->drv.name);
|
cistpl_longlink_mfc_t mfc;
|
||||||
ret = -EINVAL;
|
if (pccard_read_tuple(s, p_dev->func, CISTPL_LONGLINK_MFC,
|
||||||
|
&mfc) == CS_SUCCESS)
|
||||||
|
s->functions = mfc.nfn;
|
||||||
|
else
|
||||||
|
s->functions = 1;
|
||||||
|
s->config = kmalloc(sizeof(config_t) * s->functions,
|
||||||
|
GFP_KERNEL);
|
||||||
|
if (!s->config) {
|
||||||
|
ret = -ENOMEM;
|
||||||
|
goto put_module;
|
||||||
}
|
}
|
||||||
|
memset(s->config, 0, sizeof(config_t) * s->functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = p_drv->probe(p_dev);
|
||||||
|
|
||||||
|
put_module:
|
||||||
if (ret)
|
if (ret)
|
||||||
module_put(p_drv->owner);
|
module_put(p_drv->owner);
|
||||||
put_dev:
|
put_dev:
|
||||||
if ((ret) || !(p_drv->attach))
|
if (ret)
|
||||||
put_device(dev);
|
put_device(dev);
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
@ -418,11 +433,8 @@ static int pcmcia_device_remove(struct device * dev)
|
|||||||
printk(KERN_INFO "pcmcia: driver %s did not release windows properly\n",
|
printk(KERN_INFO "pcmcia: driver %s did not release windows properly\n",
|
||||||
p_drv->drv.name);
|
p_drv->drv.name);
|
||||||
|
|
||||||
/* undo pcmcia_register_client */
|
|
||||||
p_dev->state = CLIENT_UNBOUND;
|
|
||||||
pcmcia_put_dev(p_dev);
|
|
||||||
|
|
||||||
/* references from pcmcia_probe_device */
|
/* references from pcmcia_probe_device */
|
||||||
|
p_dev->state = CLIENT_UNBOUND;
|
||||||
pcmcia_put_dev(p_dev);
|
pcmcia_put_dev(p_dev);
|
||||||
module_put(p_drv->owner);
|
module_put(p_drv->owner);
|
||||||
|
|
||||||
@ -1042,49 +1054,6 @@ static int pcmcia_bus_suspend(struct pcmcia_socket *skt)
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
struct send_event_data {
|
|
||||||
struct pcmcia_socket *skt;
|
|
||||||
event_t event;
|
|
||||||
int priority;
|
|
||||||
};
|
|
||||||
|
|
||||||
static int send_event_callback(struct device *dev, void * _data)
|
|
||||||
{
|
|
||||||
struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
|
|
||||||
struct pcmcia_driver *p_drv;
|
|
||||||
struct send_event_data *data = _data;
|
|
||||||
|
|
||||||
/* we get called for all sockets, but may only pass the event
|
|
||||||
* for drivers _on the affected socket_ */
|
|
||||||
if (p_dev->socket != data->skt)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
p_drv = to_pcmcia_drv(p_dev->dev.driver);
|
|
||||||
if (!p_drv)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (p_dev->state & (CLIENT_UNBOUND|CLIENT_STALE))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (p_drv->event)
|
|
||||||
return p_drv->event(data->event, data->priority,
|
|
||||||
&p_dev->event_callback_args);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int send_event(struct pcmcia_socket *s, event_t event, int priority)
|
|
||||||
{
|
|
||||||
struct send_event_data private;
|
|
||||||
|
|
||||||
private.skt = s;
|
|
||||||
private.event = event;
|
|
||||||
private.priority = priority;
|
|
||||||
|
|
||||||
return bus_for_each_dev(&pcmcia_bus_type, NULL, &private, send_event_callback);
|
|
||||||
} /* send_event */
|
|
||||||
|
|
||||||
|
|
||||||
/* Normally, the event is passed to individual drivers after
|
/* Normally, the event is passed to individual drivers after
|
||||||
* informing userspace. Only for CS_EVENT_CARD_REMOVAL this
|
* informing userspace. Only for CS_EVENT_CARD_REMOVAL this
|
||||||
* is inversed to maintain historic compatibility.
|
* is inversed to maintain historic compatibility.
|
||||||
@ -1093,16 +1062,13 @@ static int send_event(struct pcmcia_socket *s, event_t event, int priority)
|
|||||||
static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
|
static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
|
||||||
{
|
{
|
||||||
struct pcmcia_socket *s = pcmcia_get_socket(skt);
|
struct pcmcia_socket *s = pcmcia_get_socket(skt);
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
ds_dbg(1, "ds_event(0x%06x, %d, 0x%p)\n",
|
ds_dbg(1, "ds_event(0x%06x, %d, 0x%p)\n",
|
||||||
event, priority, skt);
|
event, priority, skt);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
|
||||||
case CS_EVENT_CARD_REMOVAL:
|
case CS_EVENT_CARD_REMOVAL:
|
||||||
s->pcmcia_state.present = 0;
|
s->pcmcia_state.present = 0;
|
||||||
send_event(skt, event, priority);
|
|
||||||
pcmcia_card_remove(skt);
|
pcmcia_card_remove(skt);
|
||||||
handle_event(skt, event);
|
handle_event(skt, event);
|
||||||
break;
|
break;
|
||||||
@ -1114,19 +1080,14 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CS_EVENT_EJECTION_REQUEST:
|
case CS_EVENT_EJECTION_REQUEST:
|
||||||
ret = send_event(skt, event, priority);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CS_EVENT_PM_SUSPEND:
|
case CS_EVENT_PM_SUSPEND:
|
||||||
case CS_EVENT_PM_RESUME:
|
case CS_EVENT_PM_RESUME:
|
||||||
case CS_EVENT_RESET_PHYSICAL:
|
case CS_EVENT_RESET_PHYSICAL:
|
||||||
case CS_EVENT_CARD_RESET:
|
case CS_EVENT_CARD_RESET:
|
||||||
handle_event(skt, event);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
handle_event(skt, event);
|
handle_event(skt, event);
|
||||||
send_event(skt, event, priority);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1136,90 +1097,6 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
|
|||||||
} /* ds_event */
|
} /* ds_event */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int pcmcia_register_client(struct pcmcia_device **handle, client_reg_t *req)
|
|
||||||
{
|
|
||||||
struct pcmcia_socket *s = NULL;
|
|
||||||
struct pcmcia_device *p_dev = NULL;
|
|
||||||
struct pcmcia_driver *p_drv = NULL;
|
|
||||||
|
|
||||||
/* Look for unbound client with matching dev_info */
|
|
||||||
down_read(&pcmcia_socket_list_rwsem);
|
|
||||||
list_for_each_entry(s, &pcmcia_socket_list, socket_list) {
|
|
||||||
unsigned long flags;
|
|
||||||
|
|
||||||
if (s->state & SOCKET_CARDBUS)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
s = pcmcia_get_socket(s);
|
|
||||||
if (!s)
|
|
||||||
continue;
|
|
||||||
spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
|
|
||||||
list_for_each_entry(p_dev, &s->devices_list, socket_device_list) {
|
|
||||||
p_dev = pcmcia_get_dev(p_dev);
|
|
||||||
if (!p_dev)
|
|
||||||
continue;
|
|
||||||
if (!(p_dev->state & CLIENT_UNBOUND) ||
|
|
||||||
(!p_dev->dev.driver)) {
|
|
||||||
pcmcia_put_dev(p_dev);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
p_drv = to_pcmcia_drv(p_dev->dev.driver);
|
|
||||||
if (!strncmp(p_drv->drv.name, (char *)req->dev_info, DEV_NAME_LEN)) {
|
|
||||||
spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
|
|
||||||
goto found;
|
|
||||||
}
|
|
||||||
pcmcia_put_dev(p_dev);
|
|
||||||
}
|
|
||||||
spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
|
|
||||||
pcmcia_put_socket(s);
|
|
||||||
}
|
|
||||||
found:
|
|
||||||
up_read(&pcmcia_socket_list_rwsem);
|
|
||||||
if (!p_dev)
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
pcmcia_put_socket(s); /* safe, as we already hold a reference from bind_device */
|
|
||||||
|
|
||||||
*handle = p_dev;
|
|
||||||
p_dev->state &= ~CLIENT_UNBOUND;
|
|
||||||
p_dev->event_callback_args = req->event_callback_args;
|
|
||||||
p_dev->event_callback_args.client_handle = p_dev;
|
|
||||||
|
|
||||||
|
|
||||||
if (!s->functions) {
|
|
||||||
cistpl_longlink_mfc_t mfc;
|
|
||||||
if (pccard_read_tuple(s, p_dev->func, CISTPL_LONGLINK_MFC, &mfc)
|
|
||||||
== CS_SUCCESS)
|
|
||||||
s->functions = mfc.nfn;
|
|
||||||
else
|
|
||||||
s->functions = 1;
|
|
||||||
s->config = kmalloc(sizeof(config_t) * s->functions,
|
|
||||||
GFP_KERNEL);
|
|
||||||
if (!s->config)
|
|
||||||
goto out_no_resource;
|
|
||||||
memset(s->config, 0, sizeof(config_t) * s->functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
ds_dbg(1, "register_client(): client 0x%p, dev %s\n",
|
|
||||||
p_dev, p_dev->dev.bus_id);
|
|
||||||
|
|
||||||
if ((s->state & (SOCKET_PRESENT|SOCKET_CARDBUS)) == SOCKET_PRESENT) {
|
|
||||||
if (p_drv->event)
|
|
||||||
p_drv->event(CS_EVENT_CARD_INSERTION, CS_EVENT_PRI_LOW,
|
|
||||||
&p_dev->event_callback_args);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return CS_SUCCESS;
|
|
||||||
|
|
||||||
out_no_resource:
|
|
||||||
pcmcia_put_dev(p_dev);
|
|
||||||
return CS_OUT_OF_RESOURCE;
|
|
||||||
} /* register_client */
|
|
||||||
EXPORT_SYMBOL(pcmcia_register_client);
|
|
||||||
|
|
||||||
|
|
||||||
static struct pcmcia_callback pcmcia_bus_callback = {
|
static struct pcmcia_callback pcmcia_bus_callback = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.event = ds_event,
|
.event = ds_event,
|
||||||
|
@ -95,27 +95,21 @@ typedef struct scsi_info_t {
|
|||||||
} scsi_info_t;
|
} scsi_info_t;
|
||||||
|
|
||||||
static void aha152x_release_cs(dev_link_t *link);
|
static void aha152x_release_cs(dev_link_t *link);
|
||||||
static int aha152x_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
static dev_link_t *aha152x_attach(void);
|
|
||||||
static void aha152x_detach(struct pcmcia_device *p_dev);
|
static void aha152x_detach(struct pcmcia_device *p_dev);
|
||||||
|
static void aha152x_config_cs(dev_link_t *link);
|
||||||
|
|
||||||
static dev_link_t *dev_list;
|
static dev_link_t *dev_list;
|
||||||
static dev_info_t dev_info = "aha152x_cs";
|
|
||||||
|
|
||||||
static dev_link_t *aha152x_attach(void)
|
static int aha152x_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
scsi_info_t *info;
|
scsi_info_t *info;
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "aha152x_attach()\n");
|
DEBUG(0, "aha152x_attach()\n");
|
||||||
|
|
||||||
/* Create new SCSI device */
|
/* Create new SCSI device */
|
||||||
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
||||||
if (!info) return NULL;
|
if (!info) return -ENOMEM;
|
||||||
memset(info, 0, sizeof(*info));
|
memset(info, 0, sizeof(*info));
|
||||||
link = &info->link; link->priv = info;
|
link = &info->link; link->priv = info;
|
||||||
|
|
||||||
@ -129,20 +123,13 @@ static dev_link_t *aha152x_attach(void)
|
|||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
link->conf.Present = PRESENT_OPTION;
|
link->conf.Present = PRESENT_OPTION;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = dev_list;
|
p_dev->instance = link;
|
||||||
dev_list = link;
|
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
aha152x_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
aha152x_config_cs(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* aha152x_attach */
|
} /* aha152x_attach */
|
||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
@ -297,22 +284,6 @@ static int aha152x_resume(struct pcmcia_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int aha152x_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(0, "aha152x_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
aha152x_config_cs(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct pcmcia_device_id aha152x_ids[] = {
|
static struct pcmcia_device_id aha152x_ids[] = {
|
||||||
PCMCIA_DEVICE_PROD_ID123("New Media", "SCSI", "Bus Toaster", 0xcdf7e4cc, 0x35f26476, 0xa8851d6e),
|
PCMCIA_DEVICE_PROD_ID123("New Media", "SCSI", "Bus Toaster", 0xcdf7e4cc, 0x35f26476, 0xa8851d6e),
|
||||||
PCMCIA_DEVICE_PROD_ID123("NOTEWORTHY", "SCSI", "Bus Toaster", 0xad89c6e8, 0x35f26476, 0xa8851d6e),
|
PCMCIA_DEVICE_PROD_ID123("NOTEWORTHY", "SCSI", "Bus Toaster", 0xad89c6e8, 0x35f26476, 0xa8851d6e),
|
||||||
@ -328,8 +299,7 @@ static struct pcmcia_driver aha152x_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "aha152x_cs",
|
.name = "aha152x_cs",
|
||||||
},
|
},
|
||||||
.attach = aha152x_attach,
|
.probe = aha152x_attach,
|
||||||
.event = aha152x_event,
|
|
||||||
.remove = aha152x_detach,
|
.remove = aha152x_detach,
|
||||||
.id_table = aha152x_ids,
|
.id_table = aha152x_ids,
|
||||||
.suspend = aha152x_suspend,
|
.suspend = aha152x_suspend,
|
||||||
|
@ -80,27 +80,19 @@ typedef struct scsi_info_t {
|
|||||||
|
|
||||||
|
|
||||||
static void fdomain_release(dev_link_t *link);
|
static void fdomain_release(dev_link_t *link);
|
||||||
static int fdomain_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args);
|
|
||||||
|
|
||||||
static dev_link_t *fdomain_attach(void);
|
|
||||||
static void fdomain_detach(struct pcmcia_device *p_dev);
|
static void fdomain_detach(struct pcmcia_device *p_dev);
|
||||||
|
static void fdomain_config(dev_link_t *link);
|
||||||
|
|
||||||
|
static int fdomain_attach(struct pcmcia_device *p_dev)
|
||||||
static dev_info_t dev_info = "fdomain_cs";
|
|
||||||
|
|
||||||
static dev_link_t *fdomain_attach(void)
|
|
||||||
{
|
{
|
||||||
scsi_info_t *info;
|
scsi_info_t *info;
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "fdomain_attach()\n");
|
DEBUG(0, "fdomain_attach()\n");
|
||||||
|
|
||||||
/* Create new SCSI device */
|
/* Create new SCSI device */
|
||||||
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
||||||
if (!info) return NULL;
|
if (!info) return -ENOMEM;
|
||||||
memset(info, 0, sizeof(*info));
|
memset(info, 0, sizeof(*info));
|
||||||
link = &info->link; link->priv = info;
|
link = &info->link; link->priv = info;
|
||||||
link->io.NumPorts1 = 0x10;
|
link->io.NumPorts1 = 0x10;
|
||||||
@ -113,19 +105,13 @@ static dev_link_t *fdomain_attach(void)
|
|||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
link->conf.Present = PRESENT_OPTION;
|
link->conf.Present = PRESENT_OPTION;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
fdomain_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
fdomain_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* fdomain_attach */
|
} /* fdomain_attach */
|
||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
@ -265,23 +251,6 @@ static int fdomain_resume(struct pcmcia_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fdomain_event(event_t event, int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "fdomain_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
fdomain_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* fdomain_event */
|
|
||||||
|
|
||||||
|
|
||||||
static struct pcmcia_device_id fdomain_ids[] = {
|
static struct pcmcia_device_id fdomain_ids[] = {
|
||||||
PCMCIA_DEVICE_PROD_ID12("IBM Corp.", "SCSI PCMCIA Card", 0xe3736c88, 0x859cad20),
|
PCMCIA_DEVICE_PROD_ID12("IBM Corp.", "SCSI PCMCIA Card", 0xe3736c88, 0x859cad20),
|
||||||
PCMCIA_DEVICE_PROD_ID1("SCSI PCMCIA Adapter Card", 0x8dacb57e),
|
PCMCIA_DEVICE_PROD_ID1("SCSI PCMCIA Adapter Card", 0x8dacb57e),
|
||||||
@ -295,8 +264,7 @@ static struct pcmcia_driver fdomain_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "fdomain_cs",
|
.name = "fdomain_cs",
|
||||||
},
|
},
|
||||||
.attach = fdomain_attach,
|
.probe = fdomain_attach,
|
||||||
.event = fdomain_event,
|
|
||||||
.remove = fdomain_detach,
|
.remove = fdomain_detach,
|
||||||
.id_table = fdomain_ids,
|
.id_table = fdomain_ids,
|
||||||
.suspend = fdomain_suspend,
|
.suspend = fdomain_suspend,
|
||||||
|
@ -104,8 +104,6 @@ static struct scsi_host_template nsp_driver_template = {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static dev_info_t dev_info = {"nsp_cs"};
|
|
||||||
|
|
||||||
static nsp_hw_data nsp_data_base; /* attach <-> detect glue */
|
static nsp_hw_data nsp_data_base; /* attach <-> detect glue */
|
||||||
|
|
||||||
|
|
||||||
@ -1595,19 +1593,17 @@ static int nsp_eh_host_reset(Scsi_Cmnd *SCpnt)
|
|||||||
configure the card at this point -- we wait until we receive a
|
configure the card at this point -- we wait until we receive a
|
||||||
card insertion event.
|
card insertion event.
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
static dev_link_t *nsp_cs_attach(void)
|
static int nsp_cs_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
scsi_info_t *info;
|
scsi_info_t *info;
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
int ret;
|
|
||||||
nsp_hw_data *data = &nsp_data_base;
|
nsp_hw_data *data = &nsp_data_base;
|
||||||
|
|
||||||
nsp_dbg(NSP_DEBUG_INIT, "in");
|
nsp_dbg(NSP_DEBUG_INIT, "in");
|
||||||
|
|
||||||
/* Create new SCSI device */
|
/* Create new SCSI device */
|
||||||
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
||||||
if (info == NULL) { return NULL; }
|
if (info == NULL) { return -ENOMEM; }
|
||||||
memset(info, 0, sizeof(*info));
|
memset(info, 0, sizeof(*info));
|
||||||
link = &info->link;
|
link = &info->link;
|
||||||
link->priv = info;
|
link->priv = info;
|
||||||
@ -1635,22 +1631,14 @@ static dev_link_t *nsp_cs_attach(void)
|
|||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
link->conf.Present = PRESENT_OPTION;
|
link->conf.Present = PRESENT_OPTION;
|
||||||
|
|
||||||
|
link->handle = p_dev;
|
||||||
|
p_dev->instance = link;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
link->next = NULL;
|
nsp_cs_config(link);
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != CS_SUCCESS) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
nsp_cs_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
nsp_dbg(NSP_DEBUG_INIT, "link=0x%p", link);
|
nsp_dbg(NSP_DEBUG_INIT, "link=0x%p", link);
|
||||||
return link;
|
return 0;
|
||||||
} /* nsp_cs_attach */
|
} /* nsp_cs_attach */
|
||||||
|
|
||||||
|
|
||||||
@ -2056,44 +2044,6 @@ static int nsp_cs_resume(struct pcmcia_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================================================================
|
|
||||||
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
also sets some flags to discourage the net drivers from trying
|
|
||||||
to talk to the card any more.
|
|
||||||
|
|
||||||
When a CARD_REMOVAL event is received, we immediately set a flag
|
|
||||||
to block future accesses to this device. All the functions that
|
|
||||||
actually access the device should check this flag to make sure
|
|
||||||
the card is still present.
|
|
||||||
|
|
||||||
======================================================================*/
|
|
||||||
static int nsp_cs_event(event_t event,
|
|
||||||
int priority,
|
|
||||||
event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
nsp_dbg(NSP_DEBUG_INIT, "in, event=0x%08x", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
nsp_dbg(NSP_DEBUG_INIT, "event: insert");
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68))
|
|
||||||
info->bus = args->bus;
|
|
||||||
#endif
|
|
||||||
nsp_cs_config(link);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
nsp_dbg(NSP_DEBUG_INIT, "event: unknown");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
nsp_dbg(NSP_DEBUG_INIT, "end");
|
|
||||||
return 0;
|
|
||||||
} /* nsp_cs_event */
|
|
||||||
|
|
||||||
/*======================================================================*
|
/*======================================================================*
|
||||||
* module entry point
|
* module entry point
|
||||||
*====================================================================*/
|
*====================================================================*/
|
||||||
@ -2115,8 +2065,7 @@ static struct pcmcia_driver nsp_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "nsp_cs",
|
.name = "nsp_cs",
|
||||||
},
|
},
|
||||||
.attach = nsp_cs_attach,
|
.probe = nsp_cs_attach,
|
||||||
.event = nsp_cs_event,
|
|
||||||
.remove = nsp_cs_detach,
|
.remove = nsp_cs_detach,
|
||||||
.id_table = nsp_cs_ids,
|
.id_table = nsp_cs_ids,
|
||||||
.suspend = nsp_cs_suspend,
|
.suspend = nsp_cs_suspend,
|
||||||
|
@ -296,11 +296,9 @@ typedef struct _nsp_hw_data {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Card service functions */
|
/* Card service functions */
|
||||||
static dev_link_t *nsp_cs_attach (void);
|
|
||||||
static void nsp_cs_detach (struct pcmcia_device *p_dev);
|
static void nsp_cs_detach (struct pcmcia_device *p_dev);
|
||||||
static void nsp_cs_release(dev_link_t *link);
|
static void nsp_cs_release(dev_link_t *link);
|
||||||
static void nsp_cs_config (dev_link_t *link);
|
static void nsp_cs_config (dev_link_t *link);
|
||||||
static int nsp_cs_event (event_t event, int priority, event_callback_args_t *args);
|
|
||||||
|
|
||||||
/* Linux SCSI subsystem specific functions */
|
/* Linux SCSI subsystem specific functions */
|
||||||
static struct Scsi_Host *nsp_detect (struct scsi_host_template *sht);
|
static struct Scsi_Host *nsp_detect (struct scsi_host_template *sht);
|
||||||
|
@ -98,13 +98,8 @@ typedef struct scsi_info_t {
|
|||||||
} scsi_info_t;
|
} scsi_info_t;
|
||||||
|
|
||||||
static void qlogic_release(dev_link_t *link);
|
static void qlogic_release(dev_link_t *link);
|
||||||
static int qlogic_event(event_t event, int priority, event_callback_args_t * args);
|
|
||||||
|
|
||||||
static dev_link_t *qlogic_attach(void);
|
|
||||||
static void qlogic_detach(struct pcmcia_device *p_dev);
|
static void qlogic_detach(struct pcmcia_device *p_dev);
|
||||||
|
static void qlogic_config(dev_link_t * link);
|
||||||
|
|
||||||
static dev_info_t dev_info = "qlogic_cs";
|
|
||||||
|
|
||||||
static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host,
|
static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host,
|
||||||
dev_link_t *link, int qbase, int qlirq)
|
dev_link_t *link, int qbase, int qlirq)
|
||||||
@ -161,19 +156,17 @@ free_scsi_host:
|
|||||||
err:
|
err:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
static dev_link_t *qlogic_attach(void)
|
static int qlogic_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
scsi_info_t *info;
|
scsi_info_t *info;
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "qlogic_attach()\n");
|
DEBUG(0, "qlogic_attach()\n");
|
||||||
|
|
||||||
/* Create new SCSI device */
|
/* Create new SCSI device */
|
||||||
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
||||||
if (!info)
|
if (!info)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
memset(info, 0, sizeof(*info));
|
memset(info, 0, sizeof(*info));
|
||||||
link = &info->link;
|
link = &info->link;
|
||||||
link->priv = info;
|
link->priv = info;
|
||||||
@ -187,19 +180,13 @@ static dev_link_t *qlogic_attach(void)
|
|||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
link->conf.Present = PRESENT_OPTION;
|
link->conf.Present = PRESENT_OPTION;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
qlogic_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
qlogic_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* qlogic_attach */
|
} /* qlogic_attach */
|
||||||
|
|
||||||
/*====================================================================*/
|
/*====================================================================*/
|
||||||
@ -368,21 +355,6 @@ static int qlogic_resume(struct pcmcia_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int qlogic_event(event_t event, int priority, event_callback_args_t * args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "qlogic_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
qlogic_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* qlogic_event */
|
|
||||||
|
|
||||||
static struct pcmcia_device_id qlogic_ids[] = {
|
static struct pcmcia_device_id qlogic_ids[] = {
|
||||||
PCMCIA_DEVICE_PROD_ID12("EIger Labs", "PCMCIA-to-SCSI Adapter", 0x88395fa7, 0x33b7a5e6),
|
PCMCIA_DEVICE_PROD_ID12("EIger Labs", "PCMCIA-to-SCSI Adapter", 0x88395fa7, 0x33b7a5e6),
|
||||||
PCMCIA_DEVICE_PROD_ID12("EPSON", "SCSI-2 PC Card SC200", 0xd361772f, 0x299d1751),
|
PCMCIA_DEVICE_PROD_ID12("EPSON", "SCSI-2 PC Card SC200", 0xd361772f, 0x299d1751),
|
||||||
@ -410,8 +382,7 @@ static struct pcmcia_driver qlogic_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "qlogic_cs",
|
.name = "qlogic_cs",
|
||||||
},
|
},
|
||||||
.attach = qlogic_attach,
|
.probe = qlogic_attach,
|
||||||
.event = qlogic_event,
|
|
||||||
.remove = qlogic_detach,
|
.remove = qlogic_detach,
|
||||||
.id_table = qlogic_ids,
|
.id_table = qlogic_ids,
|
||||||
.suspend = qlogic_suspend,
|
.suspend = qlogic_suspend,
|
||||||
|
@ -228,14 +228,6 @@ enum Phase {
|
|||||||
|
|
||||||
/* ================================================================== */
|
/* ================================================================== */
|
||||||
|
|
||||||
/*
|
|
||||||
* Global (within this module) variables other than
|
|
||||||
* sym53c500_driver_template (the scsi_host_template).
|
|
||||||
*/
|
|
||||||
static dev_info_t dev_info = "sym53c500_cs";
|
|
||||||
|
|
||||||
/* ================================================================== */
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
chip_init(int io_port)
|
chip_init(int io_port)
|
||||||
{
|
{
|
||||||
@ -909,22 +901,6 @@ static int sym53c500_resume(struct pcmcia_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
SYM53C500_event(event_t event, int priority, event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "SYM53C500_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
SYM53C500_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} /* SYM53C500_event */
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SYM53C500_detach(struct pcmcia_device *p_dev)
|
SYM53C500_detach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
@ -939,20 +915,18 @@ SYM53C500_detach(struct pcmcia_device *p_dev)
|
|||||||
link->priv = NULL;
|
link->priv = NULL;
|
||||||
} /* SYM53C500_detach */
|
} /* SYM53C500_detach */
|
||||||
|
|
||||||
static dev_link_t *
|
static int
|
||||||
SYM53C500_attach(void)
|
SYM53C500_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
struct scsi_info_t *info;
|
struct scsi_info_t *info;
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "SYM53C500_attach()\n");
|
DEBUG(0, "SYM53C500_attach()\n");
|
||||||
|
|
||||||
/* Create new SCSI device */
|
/* Create new SCSI device */
|
||||||
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
||||||
if (!info)
|
if (!info)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
memset(info, 0, sizeof(*info));
|
memset(info, 0, sizeof(*info));
|
||||||
link = &info->link;
|
link = &info->link;
|
||||||
link->priv = info;
|
link->priv = info;
|
||||||
@ -966,19 +940,13 @@ SYM53C500_attach(void)
|
|||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
link->conf.Present = PRESENT_OPTION;
|
link->conf.Present = PRESENT_OPTION;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != 0) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
SYM53C500_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
SYM53C500_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
} /* SYM53C500_attach */
|
} /* SYM53C500_attach */
|
||||||
|
|
||||||
MODULE_AUTHOR("Bob Tracy <rct@frus.com>");
|
MODULE_AUTHOR("Bob Tracy <rct@frus.com>");
|
||||||
@ -998,8 +966,7 @@ static struct pcmcia_driver sym53c500_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "sym53c500_cs",
|
.name = "sym53c500_cs",
|
||||||
},
|
},
|
||||||
.attach = SYM53C500_attach,
|
.probe = SYM53C500_attach,
|
||||||
.event = SYM53C500_event,
|
|
||||||
.remove = SYM53C500_detach,
|
.remove = SYM53C500_detach,
|
||||||
.id_table = sym53c500_ids,
|
.id_table = sym53c500_ids,
|
||||||
.suspend = sym53c500_suspend,
|
.suspend = sym53c500_suspend,
|
||||||
|
@ -114,13 +114,7 @@ struct serial_cfg_mem {
|
|||||||
|
|
||||||
|
|
||||||
static void serial_config(dev_link_t * link);
|
static void serial_config(dev_link_t * link);
|
||||||
static int serial_event(event_t event, int priority,
|
|
||||||
event_callback_args_t * args);
|
|
||||||
|
|
||||||
static dev_info_t dev_info = "serial_cs";
|
|
||||||
|
|
||||||
static dev_link_t *serial_attach(void);
|
|
||||||
static void serial_detach(struct pcmcia_device *p_dev);
|
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
|
|
||||||
@ -203,19 +197,17 @@ static int serial_resume(struct pcmcia_device *dev)
|
|||||||
|
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static dev_link_t *serial_attach(void)
|
static int serial_probe(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
struct serial_info *info;
|
struct serial_info *info;
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
int ret;
|
|
||||||
|
|
||||||
DEBUG(0, "serial_attach()\n");
|
DEBUG(0, "serial_attach()\n");
|
||||||
|
|
||||||
/* Create new serial device */
|
/* Create new serial device */
|
||||||
info = kmalloc(sizeof (*info), GFP_KERNEL);
|
info = kmalloc(sizeof (*info), GFP_KERNEL);
|
||||||
if (!info)
|
if (!info)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
memset(info, 0, sizeof (*info));
|
memset(info, 0, sizeof (*info));
|
||||||
link = &info->link;
|
link = &info->link;
|
||||||
link->priv = info;
|
link->priv = info;
|
||||||
@ -231,19 +223,12 @@ static dev_link_t *serial_attach(void)
|
|||||||
}
|
}
|
||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL; /* not needed */
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = &dev_info;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
client_reg.Version = 0x0210;
|
serial_config(link);
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != CS_SUCCESS) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
serial_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================================================================
|
/*======================================================================
|
||||||
@ -706,32 +691,6 @@ void serial_config(dev_link_t * link)
|
|||||||
kfree(cfg_mem);
|
kfree(cfg_mem);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================================================================
|
|
||||||
|
|
||||||
The card status event handler. Mostly, this schedules other
|
|
||||||
stuff to run after an event is received. A CARD_REMOVAL event
|
|
||||||
also sets some flags to discourage the serial drivers from
|
|
||||||
talking to the ports.
|
|
||||||
|
|
||||||
======================================================================*/
|
|
||||||
|
|
||||||
static int
|
|
||||||
serial_event(event_t event, int priority, event_callback_args_t * args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DEBUG(1, "serial_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
serial_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct pcmcia_device_id serial_ids[] = {
|
static struct pcmcia_device_id serial_ids[] = {
|
||||||
PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0057, 0x0021),
|
PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0057, 0x0021),
|
||||||
PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0089, 0x110a),
|
PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0089, 0x110a),
|
||||||
@ -843,8 +802,7 @@ static struct pcmcia_driver serial_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "serial_cs",
|
.name = "serial_cs",
|
||||||
},
|
},
|
||||||
.attach = serial_attach,
|
.probe = serial_probe,
|
||||||
.event = serial_event,
|
|
||||||
.remove = serial_detach,
|
.remove = serial_detach,
|
||||||
.id_table = serial_ids,
|
.id_table = serial_ids,
|
||||||
.suspend = serial_suspend,
|
.suspend = serial_suspend,
|
||||||
|
@ -34,23 +34,19 @@ typedef struct ixj_info_t {
|
|||||||
struct ixj *port;
|
struct ixj *port;
|
||||||
} ixj_info_t;
|
} ixj_info_t;
|
||||||
|
|
||||||
static dev_link_t *ixj_attach(void);
|
|
||||||
static void ixj_detach(struct pcmcia_device *p_dev);
|
static void ixj_detach(struct pcmcia_device *p_dev);
|
||||||
static void ixj_config(dev_link_t * link);
|
static void ixj_config(dev_link_t * link);
|
||||||
static void ixj_cs_release(dev_link_t * link);
|
static void ixj_cs_release(dev_link_t * link);
|
||||||
static int ixj_event(event_t event, int priority, event_callback_args_t * args);
|
|
||||||
static dev_info_t dev_info = "ixj_cs";
|
|
||||||
|
|
||||||
static dev_link_t *ixj_attach(void)
|
static int ixj_attach(struct pcmcia_device *p_dev)
|
||||||
{
|
{
|
||||||
client_reg_t client_reg;
|
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
int ret;
|
|
||||||
DEBUG(0, "ixj_attach()\n");
|
DEBUG(0, "ixj_attach()\n");
|
||||||
/* Create new ixj device */
|
/* Create new ixj device */
|
||||||
link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
|
||||||
if (!link)
|
if (!link)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
memset(link, 0, sizeof(struct dev_link_t));
|
memset(link, 0, sizeof(struct dev_link_t));
|
||||||
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
|
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
|
||||||
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
|
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
|
||||||
@ -60,21 +56,17 @@ static dev_link_t *ixj_attach(void)
|
|||||||
link->priv = kmalloc(sizeof(struct ixj_info_t), GFP_KERNEL);
|
link->priv = kmalloc(sizeof(struct ixj_info_t), GFP_KERNEL);
|
||||||
if (!link->priv) {
|
if (!link->priv) {
|
||||||
kfree(link);
|
kfree(link);
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
memset(link->priv, 0, sizeof(struct ixj_info_t));
|
memset(link->priv, 0, sizeof(struct ixj_info_t));
|
||||||
/* Register with Card Services */
|
|
||||||
link->next = NULL;
|
link->handle = p_dev;
|
||||||
client_reg.dev_info = &dev_info;
|
p_dev->instance = link;
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
ixj_config(link);
|
||||||
if (ret != CS_SUCCESS) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
return 0;
|
||||||
ixj_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return link;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ixj_detach(struct pcmcia_device *p_dev)
|
static void ixj_detach(struct pcmcia_device *p_dev)
|
||||||
@ -265,19 +257,6 @@ static int ixj_resume(struct pcmcia_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ixj_event(event_t event, int priority, event_callback_args_t * args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
DEBUG(1, "ixj_event(0x%06x)\n", event);
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
ixj_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct pcmcia_device_id ixj_ids[] = {
|
static struct pcmcia_device_id ixj_ids[] = {
|
||||||
PCMCIA_DEVICE_MANF_CARD(0x0257, 0x0600),
|
PCMCIA_DEVICE_MANF_CARD(0x0257, 0x0600),
|
||||||
PCMCIA_DEVICE_NULL
|
PCMCIA_DEVICE_NULL
|
||||||
@ -289,8 +268,7 @@ static struct pcmcia_driver ixj_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = "ixj_cs",
|
.name = "ixj_cs",
|
||||||
},
|
},
|
||||||
.attach = ixj_attach,
|
.probe = ixj_attach,
|
||||||
.event = ixj_event,
|
|
||||||
.remove = ixj_detach,
|
.remove = ixj_detach,
|
||||||
.id_table = ixj_ids,
|
.id_table = ixj_ids,
|
||||||
.suspend = ixj_suspend,
|
.suspend = ixj_suspend,
|
||||||
|
@ -325,32 +325,14 @@ static int sl811_resume(struct pcmcia_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int sl811_cs_attach(struct pcmcia_device *p_dev)
|
||||||
sl811_cs_event(event_t event, int priority, event_callback_args_t *args)
|
|
||||||
{
|
|
||||||
dev_link_t *link = args->client_data;
|
|
||||||
|
|
||||||
DBG(1, "sl811_cs_event(0x%06x)\n", event);
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case CS_EVENT_CARD_INSERTION:
|
|
||||||
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
|
||||||
sl811_cs_config(link);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static dev_link_t *sl811_cs_attach(void)
|
|
||||||
{
|
{
|
||||||
local_info_t *local;
|
local_info_t *local;
|
||||||
dev_link_t *link;
|
dev_link_t *link;
|
||||||
client_reg_t client_reg;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
|
local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
|
||||||
if (!local)
|
if (!local)
|
||||||
return NULL;
|
return -ENOMEM;
|
||||||
memset(local, 0, sizeof(local_info_t));
|
memset(local, 0, sizeof(local_info_t));
|
||||||
link = &local->link;
|
link = &local->link;
|
||||||
link->priv = local;
|
link->priv = local;
|
||||||
@ -364,20 +346,13 @@ static dev_link_t *sl811_cs_attach(void)
|
|||||||
link->conf.Vcc = 33;
|
link->conf.Vcc = 33;
|
||||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||||
|
|
||||||
/* Register with Card Services */
|
link->handle = p_dev;
|
||||||
link->next = NULL;
|
p_dev->instance = link;
|
||||||
client_reg.dev_info = (dev_info_t *) &driver_name;
|
|
||||||
client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
|
|
||||||
client_reg.Version = 0x0210;
|
|
||||||
client_reg.event_callback_args.client_data = link;
|
|
||||||
ret = pcmcia_register_client(&link->handle, &client_reg);
|
|
||||||
if (ret != CS_SUCCESS) {
|
|
||||||
cs_error(link->handle, RegisterClient, ret);
|
|
||||||
sl811_cs_detach(link->handle);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return link;
|
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
|
||||||
|
sl811_cs_config(link);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct pcmcia_device_id sl811_ids[] = {
|
static struct pcmcia_device_id sl811_ids[] = {
|
||||||
@ -391,8 +366,7 @@ static struct pcmcia_driver sl811_cs_driver = {
|
|||||||
.drv = {
|
.drv = {
|
||||||
.name = (char *)driver_name,
|
.name = (char *)driver_name,
|
||||||
},
|
},
|
||||||
.attach = sl811_cs_attach,
|
.probe = sl811_cs_attach,
|
||||||
.event = sl811_cs_event,
|
|
||||||
.remove = sl811_cs_detach,
|
.remove = sl811_cs_detach,
|
||||||
.id_table = sl811_ids,
|
.id_table = sl811_ids,
|
||||||
.suspend = sl811_suspend,
|
.suspend = sl811_suspend,
|
||||||
|
@ -389,7 +389,6 @@ int pcmcia_get_status(struct pcmcia_device *p_dev, cs_status_t *status);
|
|||||||
int pcmcia_get_mem_page(window_handle_t win, memreq_t *req);
|
int pcmcia_get_mem_page(window_handle_t win, memreq_t *req);
|
||||||
int pcmcia_map_mem_page(window_handle_t win, memreq_t *req);
|
int pcmcia_map_mem_page(window_handle_t win, memreq_t *req);
|
||||||
int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
|
int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
|
||||||
int pcmcia_register_client(client_handle_t *handle, client_reg_t *req);
|
|
||||||
int pcmcia_release_configuration(struct pcmcia_device *p_dev);
|
int pcmcia_release_configuration(struct pcmcia_device *p_dev);
|
||||||
int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req);
|
int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req);
|
||||||
int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req);
|
int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req);
|
||||||
|
@ -133,10 +133,7 @@ typedef struct dev_link_t {
|
|||||||
struct pcmcia_socket;
|
struct pcmcia_socket;
|
||||||
|
|
||||||
struct pcmcia_driver {
|
struct pcmcia_driver {
|
||||||
dev_link_t *(*attach)(void);
|
int (*probe) (struct pcmcia_device *dev);
|
||||||
int (*event) (event_t event, int priority,
|
|
||||||
event_callback_args_t *);
|
|
||||||
|
|
||||||
void (*remove) (struct pcmcia_device *dev);
|
void (*remove) (struct pcmcia_device *dev);
|
||||||
|
|
||||||
int (*suspend) (struct pcmcia_device *dev);
|
int (*suspend) (struct pcmcia_device *dev);
|
||||||
@ -169,7 +166,6 @@ struct pcmcia_device {
|
|||||||
/* deprecated, a cleaned up version will be moved into this
|
/* deprecated, a cleaned up version will be moved into this
|
||||||
struct soon */
|
struct soon */
|
||||||
dev_link_t *instance;
|
dev_link_t *instance;
|
||||||
event_callback_args_t event_callback_args;
|
|
||||||
u_int state;
|
u_int state;
|
||||||
|
|
||||||
/* information about this device */
|
/* information about this device */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user