Commit 8c7981bc authored by Mike Phillips's avatar Mike Phillips Committed by Linus Torvalds

[PATCH] ibmtr_cs/ibmtr - get working again

Patch to get ibmtr_cs / ibmtr working again.  A change went in a while back
I missed that killed it.  Also fixed the timer to eliminate the
uninitialized timer error on close.
parent 1910e4dc
...@@ -136,7 +136,7 @@ typedef struct ibmtr_dev_t { ...@@ -136,7 +136,7 @@ typedef struct ibmtr_dev_t {
struct net_device *dev; struct net_device *dev;
dev_node_t node; dev_node_t node;
window_handle_t sram_win_handle; window_handle_t sram_win_handle;
struct tok_info ti; struct tok_info *ti;
} ibmtr_dev_t; } ibmtr_dev_t;
static void netdev_get_drvinfo(struct net_device *dev, static void netdev_get_drvinfo(struct net_device *dev,
...@@ -168,13 +168,18 @@ static dev_link_t *ibmtr_attach(void) ...@@ -168,13 +168,18 @@ static dev_link_t *ibmtr_attach(void)
DEBUG(0, "ibmtr_attach()\n"); DEBUG(0, "ibmtr_attach()\n");
/* Create new token-ring device */ /* Create new token-ring device */
dev = alloc_trdev(sizeof(*info)); info = kmalloc(sizeof(*info), GFP_KERNEL);
if (!dev) if (!info) return NULL;
return NULL; memset(info,0,sizeof(*info));
info = dev->priv; dev = alloc_trdev(sizeof(struct tok_info));
if (!dev) {
kfree(info);
return NULL;
}
link = &info->link; link = &info->link;
link->priv = info; link->priv = info;
info->ti = dev->priv;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 4; link->io.NumPorts1 = 4;
...@@ -265,6 +270,7 @@ static void ibmtr_detach(dev_link_t *link) ...@@ -265,6 +270,7 @@ static void ibmtr_detach(dev_link_t *link)
*linkp = link->next; *linkp = link->next;
unregister_netdev(dev); unregister_netdev(dev);
free_netdev(dev); free_netdev(dev);
kfree(info);
} /* ibmtr_detach */ } /* ibmtr_detach */
/*====================================================================== /*======================================================================
......
...@@ -152,7 +152,7 @@ static char version[] __initdata = ...@@ -152,7 +152,7 @@ static char version[] __initdata =
/* this allows displaying full adapter information */ /* this allows displaying full adapter information */
char *channel_def[] __initdata = { "ISA", "MCA", "ISA P&P" }; char *channel_def[] __devinitdata = { "ISA", "MCA", "ISA P&P" };
static char pcchannelid[] __devinitdata = { static char pcchannelid[] __devinitdata = {
0x05, 0x00, 0x04, 0x09, 0x05, 0x00, 0x04, 0x09,
...@@ -864,7 +864,8 @@ static int tok_open(struct net_device *dev) ...@@ -864,7 +864,8 @@ static int tok_open(struct net_device *dev)
ti->sram_virt &= ~1; /* to reverse what we do in tok_close */ ti->sram_virt &= ~1; /* to reverse what we do in tok_close */
/* init the spinlock */ /* init the spinlock */
ti->lock = (spinlock_t) SPIN_LOCK_UNLOCKED; ti->lock = (spinlock_t) SPIN_LOCK_UNLOCKED;
init_timer(&ti->tr_timer);
i = tok_init_card(dev); i = tok_init_card(dev);
if (i) return i; if (i) return i;
...@@ -1033,7 +1034,7 @@ static int tok_close(struct net_device *dev) ...@@ -1033,7 +1034,7 @@ static int tok_close(struct net_device *dev)
/* Important for PCMCIA hot unplug, otherwise, we'll pull the card, */ /* Important for PCMCIA hot unplug, otherwise, we'll pull the card, */
/* unloading the module from memory, and then if a timer pops, ouch */ /* unloading the module from memory, and then if a timer pops, ouch */
del_timer(&ti->tr_timer); del_timer_sync(&ti->tr_timer);
outb(0, dev->base_addr + ADAPTRESET); outb(0, dev->base_addr + ADAPTRESET);
ti->sram_virt |= 1; ti->sram_virt |= 1;
ti->open_status = CLOSED; ti->open_status = CLOSED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment