};
typedef struct netwave_private {
- dev_link_t link;
+ struct pcmcia_device *p_dev;
spinlock_t spinlock; /* Serialize access to the hardware (SMP) */
dev_node_t node;
u_char __iomem *ramBase;
*/
static int netwave_attach(struct pcmcia_device *p_dev)
{
- dev_link_t *link;
struct net_device *dev;
netwave_private *priv;
+ dev_link_t *link = dev_to_instance(p_dev);
DEBUG(0, "netwave_attach()\n");
if (!dev)
return -ENOMEM;
priv = netdev_priv(dev);
- link = &priv->link;
+ priv->p_dev = p_dev;
link->priv = dev;
/* The io structure describes IO port mapping */
dev->stop = &netwave_close;
link->irq.Instance = dev;
- link->handle = p_dev;
- p_dev->instance = link;
-
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
netwave_pcmcia_config( link);
if (link->state & DEV_CONFIG)
netwave_release(link);
- if (link->dev)
+ if (link->dev_node)
unregister_netdev(dev);
free_netdev(dev);
}
strcpy(priv->node.dev_name, dev->name);
- link->dev = &priv->node;
+ link->dev_node = &priv->node;
link->state &= ~DEV_CONFIG_PENDING;
/* Reset card before reading physical address */
u_char __iomem *ramBase;
struct net_device *dev = (struct net_device *)dev_id;
struct netwave_private *priv = netdev_priv(dev);
- dev_link_t *link = &priv->link;
+ dev_link_t *link = priv->p_dev;
int i;
if (!netif_device_present(dev))
static int netwave_open(struct net_device *dev) {
netwave_private *priv = netdev_priv(dev);
- dev_link_t *link = &priv->link;
+ dev_link_t *link = priv->p_dev;
DEBUG(1, "netwave_open: starting.\n");
static int netwave_close(struct net_device *dev) {
netwave_private *priv = netdev_priv(dev);
- dev_link_t *link = &priv->link;
+ dev_link_t *link = priv->p_dev;
DEBUG(1, "netwave_close: finishing.\n");