Lines Matching +full:use +full:- +full:ram +full:- +full:code

1 // SPDX-License-Identifier: GPL-2.0-only
6 * Uses the generic 7990.c LANCE code.
30 /* We have 32K of RAM for the init block and buffers. This places
31 * an upper limit on the number of buffers we can use. NetBSD uses 8 Rx
37 #include "7990.h" /* use generic LANCE code */
42 unsigned long ram; member
47 * plus board-specific init, open and close actions.
48 * Oh, and we need to tell the generic code how to read and write LANCE registers...
70 /* Initialise the one and only on-board 7990 */
83 return ERR_PTR(-ENODEV); in mvme147lance_probe()
88 return ERR_PTR(-ENOMEM); in mvme147lance_probe()
91 dev->base_addr = (unsigned long)MVME147_LANCE_BASE; in mvme147lance_probe()
92 dev->netdev_ops = &lance_netdev_ops; in mvme147lance_probe()
93 dev->dma = 0; in mvme147lance_probe()
109 lp->ram = __get_dma_pages(GFP_ATOMIC, 3); /* 32K */ in mvme147lance_probe()
110 if (!lp->ram) { in mvme147lance_probe()
111 printk("%s: No memory for LANCE buffers\n", dev->name); in mvme147lance_probe()
113 return ERR_PTR(-ENOMEM); in mvme147lance_probe()
116 lp->lance.name = name; in mvme147lance_probe()
117 lp->lance.base = dev->base_addr; in mvme147lance_probe()
118 lp->lance.init_block = (struct lance_init_block *)(lp->ram); /* CPU addr */ in mvme147lance_probe()
119 …lp->lance.lance_init_block = (struct lance_init_block *)(lp->ram); /* LANCE addr o… in mvme147lance_probe()
120 lp->lance.busmaster_regval = LE_C3_BSWP; /* we're bigendian */ in mvme147lance_probe()
121 lp->lance.irq = MVME147_LANCE_IRQ; in mvme147lance_probe()
122 lp->lance.writerap = (writerap_t)m147lance_writerap; in mvme147lance_probe()
123 lp->lance.writerdp = (writerdp_t)m147lance_writerdp; in mvme147lance_probe()
124 lp->lance.readrdp = (readrdp_t)m147lance_readrdp; in mvme147lance_probe()
125 lp->lance.lance_log_rx_bufs = LANCE_LOG_RX_BUFFERS; in mvme147lance_probe()
126 lp->lance.lance_log_tx_bufs = LANCE_LOG_TX_BUFFERS; in mvme147lance_probe()
127 lp->lance.rx_ring_mod_mask = RX_RING_MOD_MASK; in mvme147lance_probe()
128 lp->lance.tx_ring_mod_mask = TX_RING_MOD_MASK; in mvme147lance_probe()
132 free_pages(lp->ram, 3); in mvme147lance_probe()
138 dev->base_addr, MVME147_LANCE_IRQ, dev->dev_addr); in mvme147lance_probe()
145 out_be16(lp->base + LANCE_RAP, value); in m147lance_writerap()
150 out_be16(lp->base + LANCE_RDP, value); in m147lance_writerdp()
155 return in_be16(lp->base + LANCE_RDP); in m147lance_readrdp()
162 status = lance_open(dev); /* call generic lance open code */ in m147lance_open()
166 m147_pcc->lan_cntrl = 0; /* clear the interrupts (if any) */ in m147lance_open()
167 m147_pcc->lan_cntrl = 0x08 | 0x04; /* Enable irq 4 */ in m147lance_open()
175 m147_pcc->lan_cntrl = 0x0; /* disable interrupts */ in m147lance_close()
195 free_pages(lp->ram, 3); in m147lance_exit()