20 #include <linux/kernel.h>
22 #include <linux/export.h>
23 #include <linux/pci.h>
24 #include <linux/slab.h>
26 #include <linux/sched.h>
41 static int base_hw_irq;
43 static int num_txch, num_rxch;
45 static struct pci_dev *dma_pdev;
142 static void pasemi_free_tx_chan(
int chan)
148 static int pasemi_alloc_rx_chan(
void)
161 static void pasemi_free_rx_chan(
int chan)
201 chno = pasemi_alloc_rx_chan();
204 base_hw_irq + num_txch + chno);
208 chno = pasemi_alloc_tx_chan(type);
234 pasemi_free_rx_chan(chan->
chno);
237 pasemi_free_tx_chan(chan->
chno);
260 ring_size *
sizeof(
u64),
318 #define MAX_RETRIES 5000
327 for (retries = 0; retries <
MAX_RETRIES; retries++) {
338 for (retries = 0; retries <
MAX_RETRIES; retries++) {
488 dn = pci_device_to_OF_node(p);
523 if (!machine_is(pasemi))
526 spin_lock(&init_lock);
539 iob_regs = map_onedev(iob_pdev, 0);
561 mac_regs[intf++] = map_onedev(pdev, 0);
568 mac_regs[intf++] = map_onedev(pdev, 0);
572 dn = pci_device_to_OF_node(iob_pdev);
577 res.
start = 0xfd800000;
593 pr_warning(
"Warning: Could not disable RX section\n");
602 pr_warning(
"Warning: Could not disable TX section\n");
628 "(%d tx, %d rx channels)\n", num_txch, num_rxch);
631 spin_unlock(&init_lock);