1 --- a/drivers/net/ethernet/dec/tulip/tulip_core.c
2 +++ b/drivers/net/ethernet/dec/tulip/tulip_core.c
3 @@ -206,7 +206,7 @@ struct tulip_chip_table tulip_tbl[] = {
8 +#ifdef CONFIG_TULIP_PCI
9 static DEFINE_PCI_DEVICE_TABLE(tulip_pci_tbl) = {
10 { 0x1011, 0x0009, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DC21140 },
11 { 0x1011, 0x0019, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DC21143 },
12 @@ -250,7 +250,7 @@ static DEFINE_PCI_DEVICE_TABLE(tulip_pci
13 { } /* terminate list */
15 MODULE_DEVICE_TABLE(pci, tulip_pci_tbl);
19 /* A full-duplex map for media types. */
20 const char tulip_media_cap[32] =
21 @@ -268,11 +268,14 @@ static void tulip_down(struct net_device
22 static struct net_device_stats *tulip_get_stats(struct net_device *dev);
23 static int private_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
24 static void set_rx_mode(struct net_device *dev);
25 +#ifdef CONFIG_TULIP_PCI
26 static void tulip_set_wolopts(struct pci_dev *pdev, u32 wolopts);
28 #ifdef CONFIG_NET_POLL_CONTROLLER
29 static void poll_tulip(struct net_device *dev);
32 +#ifdef CONFIG_TULIP_PCI
33 static void tulip_set_power_state (struct tulip_private *tp,
34 int sleep, int snooze)
36 @@ -289,7 +292,7 @@ static void tulip_set_power_state (struc
43 static void tulip_up(struct net_device *dev)
45 @@ -303,6 +306,7 @@ static void tulip_up(struct net_device *
46 napi_enable(&tp->napi);
49 +#ifdef CONFIG_TULIP_PCI
50 /* Wake the chip from sleep/snooze mode. */
51 tulip_set_power_state (tp, 0, 0);
53 @@ -310,6 +314,7 @@ static void tulip_up(struct net_device *
54 pci_enable_wake(tp->pdev, PCI_D3hot, 0);
55 pci_enable_wake(tp->pdev, PCI_D3cold, 0);
56 tulip_set_wolopts(tp->pdev, 0);
59 /* On some chip revs we must set the MII/SYM port before the reset!? */
60 if (tp->mii_cnt || (tp->mtable && tp->mtable->has_mii))
61 @@ -317,14 +322,18 @@ static void tulip_up(struct net_device *
63 /* Reset the chip, holding bit 0 set at least 50 PCI cycles. */
64 iowrite32(0x00000001, ioaddr + CSR0);
65 +#ifdef CONFIG_TULIP_PCI
66 pci_read_config_dword(tp->pdev, PCI_COMMAND, ®); /* flush write */
71 Wait the specified 50 PCI cycles after a reset by initializing
72 Tx and Rx queues and the address filter list. */
73 iowrite32(tp->csr0, ioaddr + CSR0);
74 +#ifdef CONFIG_TULIP_PCI
75 pci_read_config_dword(tp->pdev, PCI_COMMAND, ®); /* flush write */
80 @@ -362,9 +371,11 @@ static void tulip_up(struct net_device *
81 *setup_frm++ = eaddrs[1]; *setup_frm++ = eaddrs[1];
82 *setup_frm++ = eaddrs[2]; *setup_frm++ = eaddrs[2];
84 +#ifdef CONFIG_TULIP_PCI
85 mapping = pci_map_single(tp->pdev, tp->setup_frame,
86 sizeof(tp->setup_frame),
89 tp->tx_buffers[tp->cur_tx].skb = NULL;
90 tp->tx_buffers[tp->cur_tx].mapping = mapping;
92 @@ -642,8 +653,10 @@ static void tulip_init_ring(struct net_d
93 tp->rx_buffers[i].skb = skb;
96 +#ifdef CONFIG_TULIP_PCI
97 mapping = pci_map_single(tp->pdev, skb->data,
98 PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
100 tp->rx_buffers[i].mapping = mapping;
101 skb->dev = dev; /* Mark as being used by this device. */
102 tp->rx_ring[i].status = cpu_to_le32(DescOwned); /* Owned by Tulip chip */
103 @@ -677,8 +690,10 @@ tulip_start_xmit(struct sk_buff *skb, st
104 entry = tp->cur_tx % TX_RING_SIZE;
106 tp->tx_buffers[entry].skb = skb;
107 +#ifdef CONFIG_TULIP_PCI
108 mapping = pci_map_single(tp->pdev, skb->data,
109 skb->len, PCI_DMA_TODEVICE);
111 tp->tx_buffers[entry].mapping = mapping;
112 tp->tx_ring[entry].buffer1 = cpu_to_le32(mapping);
114 @@ -729,16 +744,19 @@ static void tulip_clean_tx_ring(struct t
115 if (tp->tx_buffers[entry].skb == NULL) {
116 /* test because dummy frames not mapped */
117 if (tp->tx_buffers[entry].mapping)
118 +#ifdef CONFIG_TULIP_PCI
119 pci_unmap_single(tp->pdev,
120 tp->tx_buffers[entry].mapping,
121 sizeof(tp->setup_frame),
127 +#ifdef CONFIG_TULIP_PCI
128 pci_unmap_single(tp->pdev, tp->tx_buffers[entry].mapping,
129 tp->tx_buffers[entry].skb->len,
133 /* Free the original skb. */
134 dev_kfree_skb_irq(tp->tx_buffers[entry].skb);
135 @@ -789,7 +807,9 @@ static void tulip_down (struct net_devic
136 dev->if_port = tp->saved_if_port;
138 /* Leave the driver in snooze, not sleep, mode. */
139 +#ifdef CONFIG_TULIP_PCI
140 tulip_set_power_state (tp, 0, 1);
144 static void tulip_free_ring (struct net_device *dev)
145 @@ -810,8 +830,10 @@ static void tulip_free_ring (struct net_
146 /* An invalid address. */
147 tp->rx_ring[i].buffer1 = cpu_to_le32(0xBADF00D0);
149 +#ifdef CONFIG_TULIP_PCI
150 pci_unmap_single(tp->pdev, mapping, PKT_BUF_SZ,
156 @@ -820,8 +842,10 @@ static void tulip_free_ring (struct net_
157 struct sk_buff *skb = tp->tx_buffers[i].skb;
160 +#ifdef CONFIG_TULIP_PCI
161 pci_unmap_single(tp->pdev, tp->tx_buffers[i].mapping,
162 skb->len, PCI_DMA_TODEVICE);
166 tp->tx_buffers[i].skb = NULL;
167 @@ -873,7 +897,9 @@ static void tulip_get_drvinfo(struct net
168 struct tulip_private *np = netdev_priv(dev);
169 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
170 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
171 +#ifdef CONFIG_TULIP_PCI
172 strlcpy(info->bus_info, pci_name(np->pdev), sizeof(info->bus_info));
177 @@ -886,7 +912,9 @@ static int tulip_ethtool_set_wol(struct
180 tp->wolinfo.wolopts = wolinfo->wolopts;
181 +#ifdef CONFIG_TULIP_PCI
182 device_set_wakeup_enable(&tp->pdev->dev, tp->wolinfo.wolopts);
187 @@ -1167,9 +1195,11 @@ static void set_rx_mode(struct net_devic
189 tp->tx_buffers[entry].skb = NULL;
190 tp->tx_buffers[entry].mapping =
191 +#ifdef CONFIG_TULIP_PCI
192 pci_map_single(tp->pdev, tp->setup_frame,
193 sizeof(tp->setup_frame),
196 /* Put the setup frame on the Tx list. */
197 if (entry == TX_RING_SIZE-1)
198 tx_flags |= DESC_RING_WRAP; /* Wrap ring. */
199 @@ -1267,19 +1297,22 @@ out:
200 netdev_dbg(dev, "MWI config cacheline=%d, csr0=%08x\n",
206 * Chips that have the MRM/reserved bit quirk and the burst quirk. That
207 * is the DM910X and the on chip ULi devices
211 +#ifdef CONFIG_TULIP_PCI
212 static int tulip_uli_dm_quirk(struct pci_dev *pdev)
214 if (pdev->vendor == 0x1282 && pdev->device == 0x9102)
221 static const struct net_device_ops tulip_netdev_ops = {
222 .ndo_open = tulip_open,
223 @@ -1297,6 +1330,7 @@ static const struct net_device_ops tulip
227 +#ifdef CONFIG_TULIP_PCI
228 DEFINE_PCI_DEVICE_TABLE(early_486_chipsets) = {
229 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82424) },
230 { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_496) },
231 @@ -1814,6 +1848,7 @@ err_out_free_netdev:
235 +#ifdef CONFIG_TULIP_PCI
236 /* set the registers according to the given wolopts */
237 static void tulip_set_wolopts (struct pci_dev *pdev, u32 wolopts)
239 @@ -1842,6 +1877,7 @@ static void tulip_set_wolopts (struct pc
240 iowrite32(tmp, ioaddr + CSR13);
247 @@ -1953,6 +1989,7 @@ static void __devexit tulip_remove_one (
249 /* pci_power_off (pdev, -1); */
251 +#endif /* CONFIG_TULIP_PCI */
253 #ifdef CONFIG_NET_POLL_CONTROLLER
255 @@ -1971,7 +2008,8 @@ static void poll_tulip (struct net_devic
259 -static struct pci_driver tulip_driver = {
260 +#ifdef CONFIG_TULIP_PCI
261 +static struct pci_driver tulip_pci_driver = {
263 .id_table = tulip_pci_tbl,
264 .probe = tulip_init_one,
265 @@ -1981,10 +2019,12 @@ static struct pci_driver tulip_driver =
266 .resume = tulip_resume,
267 #endif /* CONFIG_PM */
272 static int __init tulip_init (void)
276 pr_info("%s", version);
278 @@ -1994,13 +2034,18 @@ static int __init tulip_init (void)
279 tulip_max_interrupt_work = max_interrupt_work;
281 /* probe for and init boards */
282 - return pci_register_driver(&tulip_driver);
283 +#ifdef CONFIG_TULIP_PCI
284 + ret = pci_register_driver(&tulip_pci_driver);
290 static void __exit tulip_cleanup (void)
292 - pci_unregister_driver (&tulip_driver);
293 +#ifdef CONFIG_TULIP_PCI
294 + pci_unregister_driver (&tulip_pci_driver);
299 --- a/drivers/net/ethernet/dec/tulip/interrupt.c
300 +++ b/drivers/net/ethernet/dec/tulip/interrupt.c
301 @@ -72,9 +72,10 @@ int tulip_refill_rx(struct net_device *d
302 skb = tp->rx_buffers[entry].skb = dev_alloc_skb(PKT_BUF_SZ);
306 +#ifdef CONFIG_TULIP_PCI
307 mapping = pci_map_single(tp->pdev, skb->data, PKT_BUF_SZ,
310 tp->rx_buffers[entry].mapping = mapping;
312 skb->dev = dev; /* Mark as being used by this device. */
313 @@ -204,9 +205,11 @@ int tulip_poll(struct napi_struct *napi,
314 if (pkt_len < tulip_rx_copybreak &&
315 (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
316 skb_reserve(skb, 2); /* 16 byte align the IP header */
317 +#ifdef CONFIG_TULIP_PCI
318 pci_dma_sync_single_for_cpu(tp->pdev,
319 tp->rx_buffers[entry].mapping,
320 pkt_len, PCI_DMA_FROMDEVICE);
322 #if ! defined(__alpha__)
323 skb_copy_to_linear_data(skb, tp->rx_buffers[entry].skb->data,
325 @@ -216,9 +219,11 @@ int tulip_poll(struct napi_struct *napi,
326 tp->rx_buffers[entry].skb->data,
329 +#ifdef CONFIG_TULIP_PCI
330 pci_dma_sync_single_for_device(tp->pdev,
331 tp->rx_buffers[entry].mapping,
332 pkt_len, PCI_DMA_FROMDEVICE);
334 } else { /* Pass up the skb already on the Rx ring. */
335 char *temp = skb_put(skb = tp->rx_buffers[entry].skb,
337 @@ -233,9 +238,10 @@ int tulip_poll(struct napi_struct *napi,
342 +#ifdef CONFIG_TULIP_PCI
343 pci_unmap_single(tp->pdev, tp->rx_buffers[entry].mapping,
344 PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
347 tp->rx_buffers[entry].skb = NULL;
348 tp->rx_buffers[entry].mapping = 0;
349 @@ -591,10 +597,12 @@ irqreturn_t tulip_interrupt(int irq, voi
350 if (tp->tx_buffers[entry].skb == NULL) {
351 /* test because dummy frames not mapped */
352 if (tp->tx_buffers[entry].mapping)
353 +#ifdef CONFIG_TULIP_PCI
354 pci_unmap_single(tp->pdev,
355 tp->tx_buffers[entry].mapping,
356 sizeof(tp->setup_frame),
362 @@ -622,10 +630,11 @@ irqreturn_t tulip_interrupt(int irq, voi
363 dev->stats.collisions += (status >> 3) & 15;
364 dev->stats.tx_packets++;
367 +#ifdef CONFIG_TULIP_PCI
368 pci_unmap_single(tp->pdev, tp->tx_buffers[entry].mapping,
369 tp->tx_buffers[entry].skb->len,
373 /* Free the original skb. */
374 dev_kfree_skb_irq(tp->tx_buffers[entry].skb);
375 --- a/drivers/net/ethernet/dec/tulip/Kconfig
376 +++ b/drivers/net/ethernet/dec/tulip/Kconfig
377 @@ -40,8 +40,12 @@ config DE2104X_DSL
378 Default is 0, and range is 0 to 31.
384 tristate "DECchip Tulip (dc2114x) PCI support"
389 This driver is developed for the SMC EtherPower series Ethernet
390 @@ -58,7 +62,7 @@ config TULIP
393 bool "New bus configuration (EXPERIMENTAL)"
394 - depends on TULIP && EXPERIMENTAL
395 + depends on TULIP_PCI && EXPERIMENTAL
397 This configures your Tulip card specifically for the card and
398 system cache line size type you are using.
399 @@ -69,7 +73,7 @@ config TULIP_MWI
402 bool "Use PCI shared mem for NIC registers"
404 + depends on TULIP_PCI
406 Use PCI shared memory for the NIC registers, rather than going through
407 the Tulip's PIO (programmed I/O ports). Faster, but could produce