aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/atari_bionet.c2
-rw-r--r--drivers/net/atari_pamsnet.c2
-rw-r--r--drivers/net/bsd_comp.c28
-rw-r--r--drivers/net/cris/eth_v10.c6
-rw-r--r--drivers/net/cs89x0.c19
-rw-r--r--drivers/net/hamradio/yam.c2
-rw-r--r--drivers/net/mv643xx_eth.c2
-rw-r--r--drivers/net/ppp_generic.c23
-rw-r--r--drivers/net/tulip/de4x5.c4
9 files changed, 46 insertions, 42 deletions
diff --git a/drivers/net/atari_bionet.c b/drivers/net/atari_bionet.c
index 1798ce7262c9..0095384ff454 100644
--- a/drivers/net/atari_bionet.c
+++ b/drivers/net/atari_bionet.c
@@ -155,7 +155,7 @@ static int bionet_close(struct net_device *dev);
155static struct net_device_stats *net_get_stats(struct net_device *dev); 155static struct net_device_stats *net_get_stats(struct net_device *dev);
156static void bionet_tick(unsigned long); 156static void bionet_tick(unsigned long);
157 157
158static struct timer_list bionet_timer = TIMER_INITIALIZER(bionet_tick, 0, 0); 158static DEFINE_TIMER(bionet_timer, bionet_tick, 0, 0);
159 159
160#define STRAM_ADDR(a) (((a) & 0xff000000) == 0) 160#define STRAM_ADDR(a) (((a) & 0xff000000) == 0)
161 161
diff --git a/drivers/net/atari_pamsnet.c b/drivers/net/atari_pamsnet.c
index 81c362c8cb97..8b997809f9de 100644
--- a/drivers/net/atari_pamsnet.c
+++ b/drivers/net/atari_pamsnet.c
@@ -165,7 +165,7 @@ static void pamsnet_tick(unsigned long);
165 165
166static irqreturn_t pamsnet_intr(int irq, void *data, struct pt_regs *fp); 166static irqreturn_t pamsnet_intr(int irq, void *data, struct pt_regs *fp);
167 167
168static struct timer_list pamsnet_timer = TIMER_INITIALIZER(pamsnet_tick, 0, 0); 168static DEFINE_TIMER(pamsnet_timer, pamsnet_tick, 0, 0);
169 169
170#define STRAM_ADDR(a) (((a) & 0xff000000) == 0) 170#define STRAM_ADDR(a) (((a) & 0xff000000) == 0)
171 171
diff --git a/drivers/net/bsd_comp.c b/drivers/net/bsd_comp.c
index 3d88ad622bdb..fb4098ed469e 100644
--- a/drivers/net/bsd_comp.c
+++ b/drivers/net/bsd_comp.c
@@ -323,33 +323,27 @@ static void bsd_reset (void *state)
323 */ 323 */
324 324
325static void bsd_free (void *state) 325static void bsd_free (void *state)
326 { 326{
327 struct bsd_db *db = (struct bsd_db *) state; 327 struct bsd_db *db = state;
328 328
329 if (db) 329 if (!db)
330 { 330 return;
331
331/* 332/*
332 * Release the dictionary 333 * Release the dictionary
333 */ 334 */
334 if (db->dict) 335 vfree(db->dict);
335 { 336 db->dict = NULL;
336 vfree (db->dict);
337 db->dict = NULL;
338 }
339/* 337/*
340 * Release the string buffer 338 * Release the string buffer
341 */ 339 */
342 if (db->lens) 340 vfree(db->lens);
343 { 341 db->lens = NULL;
344 vfree (db->lens);
345 db->lens = NULL;
346 }
347/* 342/*
348 * Finally release the structure itself. 343 * Finally release the structure itself.
349 */ 344 */
350 kfree (db); 345 kfree(db);
351 } 346}
352 }
353 347
354/* 348/*
355 * Allocate space for a (de) compressor. 349 * Allocate space for a (de) compressor.
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index 442670860fca..b68b9cad76e9 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -384,8 +384,8 @@ static unsigned int mdio_phy_addr; /* Transciever address */
384static unsigned int network_tr_ctrl_shadow = 0; 384static unsigned int network_tr_ctrl_shadow = 0;
385 385
386/* Network speed indication. */ 386/* Network speed indication. */
387static struct timer_list speed_timer = TIMER_INITIALIZER(NULL, 0, 0); 387static DEFINE_TIMER(speed_timer, NULL, 0, 0);
388static struct timer_list clear_led_timer = TIMER_INITIALIZER(NULL, 0, 0); 388static DEFINE_TIMER(clear_led_timer, NULL, 0, 0);
389static int current_speed; /* Speed read from transceiver */ 389static int current_speed; /* Speed read from transceiver */
390static int current_speed_selection; /* Speed selected by user */ 390static int current_speed_selection; /* Speed selected by user */
391static unsigned long led_next_time; 391static unsigned long led_next_time;
@@ -393,7 +393,7 @@ static int led_active;
393static int rx_queue_len; 393static int rx_queue_len;
394 394
395/* Duplex */ 395/* Duplex */
396static struct timer_list duplex_timer = TIMER_INITIALIZER(NULL, 0, 0); 396static DEFINE_TIMER(duplex_timer, NULL, 0, 0);
397static int full_duplex; 397static int full_duplex;
398static enum duplex current_duplex; 398static enum duplex current_duplex;
399 399
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index b780307093eb..cdc07ccd7332 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -247,6 +247,9 @@ static int get_eeprom_data(struct net_device *dev, int off, int len, int *buffer
247static int get_eeprom_cksum(int off, int len, int *buffer); 247static int get_eeprom_cksum(int off, int len, int *buffer);
248static int set_mac_address(struct net_device *dev, void *addr); 248static int set_mac_address(struct net_device *dev, void *addr);
249static void count_rx_errors(int status, struct net_local *lp); 249static void count_rx_errors(int status, struct net_local *lp);
250#ifdef CONFIG_NET_POLL_CONTROLLER
251static void net_poll_controller(struct net_device *dev);
252#endif
250#if ALLOW_DMA 253#if ALLOW_DMA
251static void get_dma_channel(struct net_device *dev); 254static void get_dma_channel(struct net_device *dev);
252static void release_dma_buff(struct net_local *lp); 255static void release_dma_buff(struct net_local *lp);
@@ -405,6 +408,19 @@ get_eeprom_cksum(int off, int len, int *buffer)
405 return -1; 408 return -1;
406} 409}
407 410
411#ifdef CONFIG_NET_POLL_CONTROLLER
412/*
413 * Polling receive - used by netconsole and other diagnostic tools
414 * to allow network i/o with interrupts disabled.
415 */
416static void net_poll_controller(struct net_device *dev)
417{
418 disable_irq(dev->irq);
419 net_interrupt(dev->irq, dev, NULL);
420 enable_irq(dev->irq);
421}
422#endif
423
408/* This is the real probe routine. Linux has a history of friendly device 424/* This is the real probe routine. Linux has a history of friendly device
409 probes on the ISA bus. A good device probes avoids doing writes, and 425 probes on the ISA bus. A good device probes avoids doing writes, and
410 verifies that the correct device exists and functions. 426 verifies that the correct device exists and functions.
@@ -760,6 +776,9 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
760 dev->get_stats = net_get_stats; 776 dev->get_stats = net_get_stats;
761 dev->set_multicast_list = set_multicast_list; 777 dev->set_multicast_list = set_multicast_list;
762 dev->set_mac_address = set_mac_address; 778 dev->set_mac_address = set_mac_address;
779#ifdef CONFIG_NET_POLL_CONTROLLER
780 dev->poll_controller = net_poll_controller;
781#endif
763 782
764 printk("\n"); 783 printk("\n");
765 if (net_debug) 784 if (net_debug)
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index 41213ef602dc..f52ee3162c51 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -170,7 +170,7 @@ static char ax25_bcast[7] =
170static char ax25_test[7] = 170static char ax25_test[7] =
171{'L' << 1, 'I' << 1, 'N' << 1, 'U' << 1, 'X' << 1, ' ' << 1, '1' << 1}; 171{'L' << 1, 'I' << 1, 'N' << 1, 'U' << 1, 'X' << 1, ' ' << 1, '1' << 1};
172 172
173static struct timer_list yam_timer = TIMER_INITIALIZER(NULL, 0, 0); 173static DEFINE_TIMER(yam_timer, NULL, 0, 0);
174 174
175/* --------------------------------------------------------------------- */ 175/* --------------------------------------------------------------------- */
176 176
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 7c9dbc8c9423..25c9a99c377b 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -94,7 +94,7 @@ static char mv643xx_driver_version[] = "1.0";
94static void __iomem *mv643xx_eth_shared_base; 94static void __iomem *mv643xx_eth_shared_base;
95 95
96/* used to protect MV643XX_ETH_SMI_REG, which is shared across ports */ 96/* used to protect MV643XX_ETH_SMI_REG, which is shared across ports */
97static spinlock_t mv643xx_eth_phy_lock = SPIN_LOCK_UNLOCKED; 97static DEFINE_SPINLOCK(mv643xx_eth_phy_lock);
98 98
99static inline u32 mv_read(int offset) 99static inline u32 mv_read(int offset)
100{ 100{
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index bb71638a7c44..0df7e92b0bf8 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -1232,9 +1232,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
1232 navail = 0; /* total # of usable channels (not deregistered) */ 1232 navail = 0; /* total # of usable channels (not deregistered) */
1233 hdrlen = (ppp->flags & SC_MP_XSHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN; 1233 hdrlen = (ppp->flags & SC_MP_XSHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN;
1234 i = 0; 1234 i = 0;
1235 list = &ppp->channels; 1235 list_for_each_entry(pch, &ppp->channels, clist) {
1236 while ((list = list->next) != &ppp->channels) {
1237 pch = list_entry(list, struct channel, clist);
1238 navail += pch->avail = (pch->chan != NULL); 1236 navail += pch->avail = (pch->chan != NULL);
1239 if (pch->avail) { 1237 if (pch->avail) {
1240 if (skb_queue_empty(&pch->file.xq) || 1238 if (skb_queue_empty(&pch->file.xq) ||
@@ -1280,6 +1278,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
1280 1278
1281 /* skip to the channel after the one we last used 1279 /* skip to the channel after the one we last used
1282 and start at that one */ 1280 and start at that one */
1281 list = &ppp->channels;
1283 for (i = 0; i < ppp->nxchan; ++i) { 1282 for (i = 0; i < ppp->nxchan; ++i) {
1284 list = list->next; 1283 list = list->next;
1285 if (list == &ppp->channels) { 1284 if (list == &ppp->channels) {
@@ -1730,7 +1729,7 @@ static void
1730ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) 1729ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
1731{ 1730{
1732 u32 mask, seq; 1731 u32 mask, seq;
1733 struct list_head *l; 1732 struct channel *ch;
1734 int mphdrlen = (ppp->flags & SC_MP_SHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN; 1733 int mphdrlen = (ppp->flags & SC_MP_SHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN;
1735 1734
1736 if (!pskb_may_pull(skb, mphdrlen) || ppp->mrru == 0) 1735 if (!pskb_may_pull(skb, mphdrlen) || ppp->mrru == 0)
@@ -1784,8 +1783,7 @@ ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
1784 * The list of channels can't change because we have the receive 1783 * The list of channels can't change because we have the receive
1785 * side of the ppp unit locked. 1784 * side of the ppp unit locked.
1786 */ 1785 */
1787 for (l = ppp->channels.next; l != &ppp->channels; l = l->next) { 1786 list_for_each_entry(ch, &ppp->channels, clist) {
1788 struct channel *ch = list_entry(l, struct channel, clist);
1789 if (seq_before(ch->lastseq, seq)) 1787 if (seq_before(ch->lastseq, seq))
1790 seq = ch->lastseq; 1788 seq = ch->lastseq;
1791 } 1789 }
@@ -2271,10 +2269,8 @@ static struct compressor_entry *
2271find_comp_entry(int proto) 2269find_comp_entry(int proto)
2272{ 2270{
2273 struct compressor_entry *ce; 2271 struct compressor_entry *ce;
2274 struct list_head *list = &compressor_list;
2275 2272
2276 while ((list = list->next) != &compressor_list) { 2273 list_for_each_entry(ce, &compressor_list, list) {
2277 ce = list_entry(list, struct compressor_entry, list);
2278 if (ce->comp->compress_proto == proto) 2274 if (ce->comp->compress_proto == proto)
2279 return ce; 2275 return ce;
2280 } 2276 }
@@ -2540,20 +2536,15 @@ static struct channel *
2540ppp_find_channel(int unit) 2536ppp_find_channel(int unit)
2541{ 2537{
2542 struct channel *pch; 2538 struct channel *pch;
2543 struct list_head *list;
2544 2539
2545 list = &new_channels; 2540 list_for_each_entry(pch, &new_channels, list) {
2546 while ((list = list->next) != &new_channels) {
2547 pch = list_entry(list, struct channel, list);
2548 if (pch->file.index == unit) { 2541 if (pch->file.index == unit) {
2549 list_del(&pch->list); 2542 list_del(&pch->list);
2550 list_add(&pch->list, &all_channels); 2543 list_add(&pch->list, &all_channels);
2551 return pch; 2544 return pch;
2552 } 2545 }
2553 } 2546 }
2554 list = &all_channels; 2547 list_for_each_entry(pch, &all_channels, list) {
2555 while ((list = list->next) != &all_channels) {
2556 pch = list_entry(list, struct channel, list);
2557 if (pch->file.index == unit) 2548 if (pch->file.index == unit)
2558 return pch; 2549 return pch;
2559 } 2550 }
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index 93800c126e86..ee48bfd67349 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -2144,9 +2144,9 @@ srom_search(struct net_device *dev, struct pci_dev *pdev)
2144 u_long iobase = 0; /* Clear upper 32 bits in Alphas */ 2144 u_long iobase = 0; /* Clear upper 32 bits in Alphas */
2145 int i, j, cfrv; 2145 int i, j, cfrv;
2146 struct de4x5_private *lp = netdev_priv(dev); 2146 struct de4x5_private *lp = netdev_priv(dev);
2147 struct list_head *walk = &pdev->bus_list; 2147 struct list_head *walk;
2148 2148
2149 for (walk = walk->next; walk != &pdev->bus_list; walk = walk->next) { 2149 list_for_each(walk, &pdev->bus_list) {
2150 struct pci_dev *this_dev = pci_dev_b(walk); 2150 struct pci_dev *this_dev = pci_dev_b(walk);
2151 2151
2152 /* Skip the pci_bus list entry */ 2152 /* Skip the pci_bus list entry */