// SPDX-License-Identifier: GPL-2.0-only /* hplance.c : the Linux/hp300/lance ethernet driver * * Copyright (C) 05/1998 Peter Maydell <pmaydell@chiark.greenend.org.uk> * Based on the Sun Lance driver and the NetBSD HP Lance driver * Uses the generic 7990.c LANCE code.
*/
/* We have 16392 bytes of RAM for the init block and buffers. This places * an upper limit on the number of buffers we can use. NetBSD uses 8 Rx * buffers and 2 Tx buffers, it takes (8 + 2) * 1544 bytes.
*/ #define LANCE_LOG_TX_BUFFERS 1 #define LANCE_LOG_RX_BUFFERS 3
/* function prototypes... This is easy because all the grot is in the * generic LANCE support. All we have to support is probing for boards, * plus board-specific init, open and close actions. * Oh, and we need to tell the generic code how to read and write LANCE registers...
*/ staticint hplance_init_one(struct dio_dev *d, conststruct dio_device_id *ent); staticvoid hplance_init(struct net_device *dev, struct dio_dev *d); staticvoid hplance_remove_one(struct dio_dev *d); staticvoid hplance_writerap(void *priv, unsignedshort value); staticvoid hplance_writerdp(void *priv, unsignedshort value); staticunsignedshort hplance_readrdp(void *priv); staticint hplance_open(struct net_device *dev); staticint hplance_close(struct net_device *dev);
/* Initialise a single lance board at the given DIO device */ staticvoid hplance_init(struct net_device *dev, struct dio_dev *d)
{ unsignedlong va = (d->resource.start + DIO_VIRADDRBASE); struct hplance_private *lp;
u8 addr[ETH_ALEN]; int i;
/* This is disgusting. We have to check the DIO status register for ack every * time we read or write the LANCE registers.
*/ staticvoid hplance_writerap(void *priv, unsignedshort value)
{ struct lance_private *lp = (struct lance_private *)priv;
do {
out_be16(lp->base + HPLANCE_REGOFF + LANCE_RAP, value);
} while ((in_8(lp->base + HPLANCE_STATUS) & LE_ACK) == 0);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.