git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[pandora-kernel.git]
/
drivers
/
net
/
pcmcia
/
xirc2ps_cs.c
diff --git
a/drivers/net/pcmcia/xirc2ps_cs.c
b/drivers/net/pcmcia/xirc2ps_cs.c
index
9bae77c
..
8478dca
100644
(file)
--- a/
drivers/net/pcmcia/xirc2ps_cs.c
+++ b/
drivers/net/pcmcia/xirc2ps_cs.c
@@
-308,7
+308,7
@@
static void xirc2ps_detach(struct pcmcia_device *p_dev);
* less on other parts of the kernel.
*/
* less on other parts of the kernel.
*/
-static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id
, struct pt_regs *regs
);
+static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id);
/****************
* A linked list of "instances" of the device. Each actual
/****************
* A linked list of "instances" of the device. Each actual
@@
-332,6
+332,7
@@
static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id, struct pt_regs *regs
*/
typedef struct local_info_t {
*/
typedef struct local_info_t {
+ struct net_device *dev;
struct pcmcia_device *p_dev;
dev_node_t node;
struct net_device_stats stats;
struct pcmcia_device *p_dev;
dev_node_t node;
struct net_device_stats stats;
@@
-345,6
+346,7
@@
typedef struct local_info_t {
void __iomem *dingo_ccr; /* only used for CEM56 cards */
unsigned last_ptr_value; /* last packets transmitted value */
const char *manf_str;
void __iomem *dingo_ccr; /* only used for CEM56 cards */
unsigned last_ptr_value; /* last packets transmitted value */
const char *manf_str;
+ struct work_struct tx_timeout_task;
} local_info_t;
/****************
} local_info_t;
/****************
@@
-352,6
+354,7
@@
typedef struct local_info_t {
*/
static int do_start_xmit(struct sk_buff *skb, struct net_device *dev);
static void do_tx_timeout(struct net_device *dev);
*/
static int do_start_xmit(struct sk_buff *skb, struct net_device *dev);
static void do_tx_timeout(struct net_device *dev);
+static void xirc2ps_tx_timeout_task(struct work_struct *work);
static struct net_device_stats *do_get_stats(struct net_device *dev);
static void set_addresses(struct net_device *dev);
static void set_multicast_list(struct net_device *dev);
static struct net_device_stats *do_get_stats(struct net_device *dev);
static void set_addresses(struct net_device *dev);
static void set_multicast_list(struct net_device *dev);
@@
-359,7
+362,7
@@
static int set_card_type(struct pcmcia_device *link, const void *s);
static int do_config(struct net_device *dev, struct ifmap *map);
static int do_open(struct net_device *dev);
static int do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static int do_config(struct net_device *dev, struct ifmap *map);
static int do_open(struct net_device *dev);
static int do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
-static struct ethtool_ops netdev_ethtool_ops;
+static
const
struct ethtool_ops netdev_ethtool_ops;
static void hardreset(struct net_device *dev);
static void do_reset(struct net_device *dev, int full);
static int init_mii(struct net_device *dev);
static void hardreset(struct net_device *dev);
static void do_reset(struct net_device *dev, int full);
static int init_mii(struct net_device *dev);
@@
-565,6
+568,7
@@
xirc2ps_probe(struct pcmcia_device *link)
if (!dev)
return -ENOMEM;
local = netdev_priv(dev);
if (!dev)
return -ENOMEM;
local = netdev_priv(dev);
+ local->dev = dev;
local->p_dev = link;
link->priv = dev;
local->p_dev = link;
link->priv = dev;
@@
-589,6
+593,7
@@
xirc2ps_probe(struct pcmcia_device *link)
#ifdef HAVE_TX_TIMEOUT
dev->tx_timeout = do_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT;
#ifdef HAVE_TX_TIMEOUT
dev->tx_timeout = do_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT;
+ INIT_WORK(&local->tx_timeout_task, xirc2ps_tx_timeout_task);
#endif
return xirc2ps_config(link);
#endif
return xirc2ps_config(link);
@@
-704,22
+709,11
@@
set_card_type(struct pcmcia_device *link, const void *s)
* Returns: true if this is a CE2
*/
static int
* Returns: true if this is a CE2
*/
static int
-has_ce2_string(struct pcmcia_device *
link
)
+has_ce2_string(struct pcmcia_device *
p_dev
)
{
{
- tuple_t tuple;
- cisparse_t parse;
- u_char buf[256];
-
- tuple.Attributes = 0;
- tuple.TupleData = buf;
- tuple.TupleDataMax = 254;
- tuple.TupleOffset = 0;
- tuple.DesiredTuple = CISTPL_VERS_1;
- if (!first_tuple(link, &tuple, &parse) && parse.version_1.ns > 2) {
- if (strstr(parse.version_1.str + parse.version_1.ofs[2], "CE2"))
- return 1;
- }
- return 0;
+ if (p_dev->prod_id[2] && strstr(p_dev->prod_id[2], "CE2"))
+ return 1;
+ return 0;
}
/****************
}
/****************
@@
-789,13
+783,6
@@
xirc2ps_config(struct pcmcia_device * link)
goto failure;
}
goto failure;
}
- /* get configuration stuff */
- tuple.DesiredTuple = CISTPL_CONFIG;
- if ((err=first_tuple(link, &tuple, &parse)))
- goto cis_error;
- link->conf.ConfigBase = parse.config.base;
- link->conf.Present = parse.config.rmask[0];
-
/* get the ethernet address from the CIS */
tuple.DesiredTuple = CISTPL_FUNCE;
for (err = first_tuple(link, &tuple, &parse); !err;
/* get the ethernet address from the CIS */
tuple.DesiredTuple = CISTPL_FUNCE;
for (err = first_tuple(link, &tuple, &parse); !err;
@@
-1059,8
+1046,6
@@
xirc2ps_config(struct pcmcia_device * link)
xirc2ps_release(link);
return -ENODEV;
xirc2ps_release(link);
return -ENODEV;
- cis_error:
- printk(KNOT_XIRC "unable to parse CIS\n");
failure:
return -ENODEV;
} /* xirc2ps_config */
failure:
return -ENODEV;
} /* xirc2ps_config */
@@
-1118,7
+1103,7
@@
static int xirc2ps_resume(struct pcmcia_device *link)
* This is the Interrupt service route.
*/
static irqreturn_t
* This is the Interrupt service route.
*/
static irqreturn_t
-xirc2ps_interrupt(int irq, void *dev_id
, struct pt_regs *regs
)
+xirc2ps_interrupt(int irq, void *dev_id)
{
struct net_device *dev = (struct net_device *)dev_id;
local_info_t *lp = netdev_priv(dev);
{
struct net_device *dev = (struct net_device *)dev_id;
local_info_t *lp = netdev_priv(dev);
@@
-1341,17
+1326,26
@@
xirc2ps_interrupt(int irq, void *dev_id, struct pt_regs *regs)
/*====================================================================*/
static void
/*====================================================================*/
static void
-
do_tx_timeout(struct net_device *dev
)
+
xirc2ps_tx_timeout_task(struct work_struct *work
)
{
{
- local_info_t *lp = netdev_priv(dev);
-
printk(KERN_NOTICE "%s: transmit timed out\n", dev->name
);
-
lp->stats.tx_errors++
;
+ local_info_t *local =
+
container_of(work, local_info_t, tx_timeout_task
);
+
struct net_device *dev = local->dev
;
/* reset the card */
do_reset(dev,1);
dev->trans_start = jiffies;
netif_wake_queue(dev);
}
/* reset the card */
do_reset(dev,1);
dev->trans_start = jiffies;
netif_wake_queue(dev);
}
+static void
+do_tx_timeout(struct net_device *dev)
+{
+ local_info_t *lp = netdev_priv(dev);
+ lp->stats.tx_errors++;
+ printk(KERN_NOTICE "%s: transmit timed out\n", dev->name);
+ schedule_work(&lp->tx_timeout_task);
+}
+
static int
do_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
static int
do_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
@@
-1543,7
+1537,7
@@
static void netdev_get_drvinfo(struct net_device *dev,
sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr);
}
sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr);
}
-static struct ethtool_ops netdev_ethtool_ops = {
+static
const
struct ethtool_ops netdev_ethtool_ops = {
.get_drvinfo = netdev_get_drvinfo,
};
.get_drvinfo = netdev_get_drvinfo,
};