diff options
Diffstat (limited to 'drivers/net/tokenring/ibmtr.c')
| -rw-r--r-- | drivers/net/tokenring/ibmtr.c | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c index c098863bdd9d..e7b001017b9a 100644 --- a/drivers/net/tokenring/ibmtr.c +++ b/drivers/net/tokenring/ibmtr.c | |||
| @@ -151,7 +151,7 @@ static char version[] __initdata = | |||
| 151 | 151 | ||
| 152 | /* this allows displaying full adapter information */ | 152 | /* this allows displaying full adapter information */ |
| 153 | 153 | ||
| 154 | char *channel_def[] __devinitdata = { "ISA", "MCA", "ISA P&P" }; | 154 | static char *channel_def[] __devinitdata = { "ISA", "MCA", "ISA P&P" }; |
| 155 | 155 | ||
| 156 | static char pcchannelid[] __devinitdata = { | 156 | static char pcchannelid[] __devinitdata = { |
| 157 | 0x05, 0x00, 0x04, 0x09, | 157 | 0x05, 0x00, 0x04, 0x09, |
| @@ -171,7 +171,7 @@ static char mcchannelid[] __devinitdata = { | |||
| 171 | 0x03, 0x08, 0x02, 0x00 | 171 | 0x03, 0x08, 0x02, 0x00 |
| 172 | }; | 172 | }; |
| 173 | 173 | ||
| 174 | char __devinit *adapter_def(char type) | 174 | static char __devinit *adapter_def(char type) |
| 175 | { | 175 | { |
| 176 | switch (type) { | 176 | switch (type) { |
| 177 | case 0xF: return "PC Adapter | PC Adapter II | Adapter/A"; | 177 | case 0xF: return "PC Adapter | PC Adapter II | Adapter/A"; |
| @@ -184,7 +184,7 @@ char __devinit *adapter_def(char type) | |||
| 184 | 184 | ||
| 185 | #define TRC_INIT 0x01 /* Trace initialization & PROBEs */ | 185 | #define TRC_INIT 0x01 /* Trace initialization & PROBEs */ |
| 186 | #define TRC_INITV 0x02 /* verbose init trace points */ | 186 | #define TRC_INITV 0x02 /* verbose init trace points */ |
| 187 | unsigned char ibmtr_debug_trace = 0; | 187 | static unsigned char ibmtr_debug_trace = 0; |
| 188 | 188 | ||
| 189 | static int ibmtr_probe(struct net_device *dev); | 189 | static int ibmtr_probe(struct net_device *dev); |
| 190 | static int ibmtr_probe1(struct net_device *dev, int ioaddr); | 190 | static int ibmtr_probe1(struct net_device *dev, int ioaddr); |
| @@ -192,20 +192,20 @@ static unsigned char get_sram_size(struct tok_info *adapt_info); | |||
| 192 | static int trdev_init(struct net_device *dev); | 192 | static int trdev_init(struct net_device *dev); |
| 193 | static int tok_open(struct net_device *dev); | 193 | static int tok_open(struct net_device *dev); |
| 194 | static int tok_init_card(struct net_device *dev); | 194 | static int tok_init_card(struct net_device *dev); |
| 195 | void tok_open_adapter(unsigned long dev_addr); | 195 | static void tok_open_adapter(unsigned long dev_addr); |
| 196 | static void open_sap(unsigned char type, struct net_device *dev); | 196 | static void open_sap(unsigned char type, struct net_device *dev); |
| 197 | static void tok_set_multicast_list(struct net_device *dev); | 197 | static void tok_set_multicast_list(struct net_device *dev); |
| 198 | static int tok_send_packet(struct sk_buff *skb, struct net_device *dev); | 198 | static int tok_send_packet(struct sk_buff *skb, struct net_device *dev); |
| 199 | static int tok_close(struct net_device *dev); | 199 | static int tok_close(struct net_device *dev); |
| 200 | irqreturn_t tok_interrupt(int irq, void *dev_id, struct pt_regs *regs); | 200 | static irqreturn_t tok_interrupt(int irq, void *dev_id, struct pt_regs *regs); |
| 201 | static void initial_tok_int(struct net_device *dev); | 201 | static void initial_tok_int(struct net_device *dev); |
| 202 | static void tr_tx(struct net_device *dev); | 202 | static void tr_tx(struct net_device *dev); |
| 203 | static void tr_rx(struct net_device *dev); | 203 | static void tr_rx(struct net_device *dev); |
| 204 | void ibmtr_reset_timer(struct timer_list*tmr,struct net_device *dev); | 204 | static void ibmtr_reset_timer(struct timer_list*tmr,struct net_device *dev); |
| 205 | static void tok_rerun(unsigned long dev_addr); | 205 | static void tok_rerun(unsigned long dev_addr); |
| 206 | void ibmtr_readlog(struct net_device *dev); | 206 | static void ibmtr_readlog(struct net_device *dev); |
| 207 | static struct net_device_stats *tok_get_stats(struct net_device *dev); | 207 | static struct net_device_stats *tok_get_stats(struct net_device *dev); |
| 208 | int ibmtr_change_mtu(struct net_device *dev, int mtu); | 208 | static int ibmtr_change_mtu(struct net_device *dev, int mtu); |
| 209 | static void find_turbo_adapters(int *iolist); | 209 | static void find_turbo_adapters(int *iolist); |
| 210 | 210 | ||
| 211 | static int ibmtr_portlist[IBMTR_MAX_ADAPTERS+1] __devinitdata = { | 211 | static int ibmtr_portlist[IBMTR_MAX_ADAPTERS+1] __devinitdata = { |
| @@ -888,11 +888,6 @@ static int tok_open(struct net_device *dev) | |||
| 888 | ti->sap_status = CLOSED; /* CLOSED or OPEN */ | 888 | ti->sap_status = CLOSED; /* CLOSED or OPEN */ |
| 889 | ti->open_failure = NO; /* NO or YES */ | 889 | ti->open_failure = NO; /* NO or YES */ |
| 890 | ti->open_mode = MANUAL; /* MANUAL or AUTOMATIC */ | 890 | ti->open_mode = MANUAL; /* MANUAL or AUTOMATIC */ |
| 891 | /* 12/2000 not typical Linux, but we can use RUNNING to let us know when | ||
| 892 | the network has crapped out or cables are disconnected. Useful because | ||
| 893 | the IFF_UP flag stays up the whole time, until ifconfig tr0 down. | ||
| 894 | */ | ||
| 895 | dev->flags &= ~IFF_RUNNING; | ||
| 896 | 891 | ||
| 897 | ti->sram_phys &= ~1; /* to reverse what we do in tok_close */ | 892 | ti->sram_phys &= ~1; /* to reverse what we do in tok_close */ |
| 898 | /* init the spinlock */ | 893 | /* init the spinlock */ |
| @@ -933,7 +928,7 @@ static int tok_open(struct net_device *dev) | |||
| 933 | #define DLC_MAX_SAP_OFST 32 | 928 | #define DLC_MAX_SAP_OFST 32 |
| 934 | #define DLC_MAX_STA_OFST 33 | 929 | #define DLC_MAX_STA_OFST 33 |
| 935 | 930 | ||
| 936 | void tok_open_adapter(unsigned long dev_addr) | 931 | static void tok_open_adapter(unsigned long dev_addr) |
| 937 | { | 932 | { |
| 938 | struct net_device *dev = (struct net_device *) dev_addr; | 933 | struct net_device *dev = (struct net_device *) dev_addr; |
| 939 | struct tok_info *ti; | 934 | struct tok_info *ti; |
| @@ -1104,7 +1099,7 @@ static void __iomem *map_address(struct tok_info *ti, unsigned index, __u8 *page | |||
| 1104 | return ti->sram_virt + index; | 1099 | return ti->sram_virt + index; |
| 1105 | } | 1100 | } |
| 1106 | 1101 | ||
| 1107 | void dir_open_adapter (struct net_device *dev) | 1102 | static void dir_open_adapter (struct net_device *dev) |
| 1108 | { | 1103 | { |
| 1109 | struct tok_info *ti = (struct tok_info *) dev->priv; | 1104 | struct tok_info *ti = (struct tok_info *) dev->priv; |
| 1110 | unsigned char ret_code; | 1105 | unsigned char ret_code; |
| @@ -1177,7 +1172,7 @@ void dir_open_adapter (struct net_device *dev) | |||
| 1177 | 1172 | ||
| 1178 | /******************************************************************************/ | 1173 | /******************************************************************************/ |
| 1179 | 1174 | ||
| 1180 | irqreturn_t tok_interrupt(int irq, void *dev_id, struct pt_regs *regs) | 1175 | static irqreturn_t tok_interrupt(int irq, void *dev_id, struct pt_regs *regs) |
| 1181 | { | 1176 | { |
| 1182 | unsigned char status; | 1177 | unsigned char status; |
| 1183 | /* unsigned char status_even ; */ | 1178 | /* unsigned char status_even ; */ |
| @@ -1242,7 +1237,7 @@ irqreturn_t tok_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
| 1242 | ti->open_status = CLOSED; | 1237 | ti->open_status = CLOSED; |
| 1243 | ti->sap_status = CLOSED; | 1238 | ti->sap_status = CLOSED; |
| 1244 | ti->open_mode = AUTOMATIC; | 1239 | ti->open_mode = AUTOMATIC; |
| 1245 | dev->flags &= ~IFF_RUNNING; | 1240 | netif_carrier_off(dev); |
| 1246 | netif_stop_queue(dev); | 1241 | netif_stop_queue(dev); |
| 1247 | ti->open_action = RESTART; | 1242 | ti->open_action = RESTART; |
| 1248 | outb(0, dev->base_addr + ADAPTRESET); | 1243 | outb(0, dev->base_addr + ADAPTRESET); |
| @@ -1323,7 +1318,7 @@ irqreturn_t tok_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
| 1323 | break; | 1318 | break; |
| 1324 | } | 1319 | } |
| 1325 | netif_wake_queue(dev); | 1320 | netif_wake_queue(dev); |
| 1326 | dev->flags |= IFF_RUNNING;/*BMS 12/2000*/ | 1321 | netif_carrier_on(dev); |
| 1327 | break; | 1322 | break; |
| 1328 | case DIR_INTERRUPT: | 1323 | case DIR_INTERRUPT: |
| 1329 | case DIR_MOD_OPEN_PARAMS: | 1324 | case DIR_MOD_OPEN_PARAMS: |
| @@ -1427,7 +1422,7 @@ irqreturn_t tok_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
| 1427 | ring_status); | 1422 | ring_status); |
| 1428 | if(ring_status& (REMOVE_RECV|AUTO_REMOVAL|LOBE_FAULT)){ | 1423 | if(ring_status& (REMOVE_RECV|AUTO_REMOVAL|LOBE_FAULT)){ |
| 1429 | netif_stop_queue(dev); | 1424 | netif_stop_queue(dev); |
| 1430 | dev->flags &= ~IFF_RUNNING;/*not typical Linux*/ | 1425 | netif_carrier_off(dev); |
| 1431 | DPRINTK("Remove received, or Auto-removal error" | 1426 | DPRINTK("Remove received, or Auto-removal error" |
| 1432 | ", or Lobe fault\n"); | 1427 | ", or Lobe fault\n"); |
| 1433 | DPRINTK("We'll try to reopen the closed adapter" | 1428 | DPRINTK("We'll try to reopen the closed adapter" |
| @@ -1845,7 +1840,7 @@ static void tr_rx(struct net_device *dev) | |||
| 1845 | 1840 | ||
| 1846 | /*****************************************************************************/ | 1841 | /*****************************************************************************/ |
| 1847 | 1842 | ||
| 1848 | void ibmtr_reset_timer(struct timer_list *tmr, struct net_device *dev) | 1843 | static void ibmtr_reset_timer(struct timer_list *tmr, struct net_device *dev) |
| 1849 | { | 1844 | { |
| 1850 | tmr->expires = jiffies + TR_RETRY_INTERVAL; | 1845 | tmr->expires = jiffies + TR_RETRY_INTERVAL; |
| 1851 | tmr->data = (unsigned long) dev; | 1846 | tmr->data = (unsigned long) dev; |
| @@ -1877,7 +1872,7 @@ void tok_rerun(unsigned long dev_addr){ | |||
| 1877 | 1872 | ||
| 1878 | /*****************************************************************************/ | 1873 | /*****************************************************************************/ |
| 1879 | 1874 | ||
| 1880 | void ibmtr_readlog(struct net_device *dev) | 1875 | static void ibmtr_readlog(struct net_device *dev) |
| 1881 | { | 1876 | { |
| 1882 | struct tok_info *ti; | 1877 | struct tok_info *ti; |
| 1883 | 1878 | ||
| @@ -1910,7 +1905,7 @@ static struct net_device_stats *tok_get_stats(struct net_device *dev) | |||
| 1910 | 1905 | ||
| 1911 | /*****************************************************************************/ | 1906 | /*****************************************************************************/ |
| 1912 | 1907 | ||
| 1913 | int ibmtr_change_mtu(struct net_device *dev, int mtu) | 1908 | static int ibmtr_change_mtu(struct net_device *dev, int mtu) |
| 1914 | { | 1909 | { |
| 1915 | struct tok_info *ti = (struct tok_info *) dev->priv; | 1910 | struct tok_info *ti = (struct tok_info *) dev->priv; |
| 1916 | 1911 | ||
