29 PCI_ROM (0x1039, 0x0190,
"sis190",
"sis190", 0),
30 PCI_ROM (0x1039, 0x0191,
"sis191",
"sis191", 0),
45 PCI_ID (0x1039, 0x0965,
"",
"", 0),
46 PCI_ID (0x1039, 0x0966,
"",
"", 0),
47 PCI_ID (0x1039, 0x0968,
"",
"", 0),
83 for (i = 0; i < 100; i++) {
90 DBG(
"sis190: PHY command timed out !\n");
138 for (i = 0; i < 200; i++) {
207 DBG(
"sis190: alloc_iob failed\n");
218 for (cur =
start; cur <
end; cur++) {
226 if (!
tp->Rx_iobuf[i])
234 #define ErrMask (OVRUN | SHORT | LIMIT | MIIER | NIBON | COLON | ABORT) 249 for (; rx_left > 0; rx_left--,
cur_rx++) {
266 DBG(
"sis190: (frag) status = %08x.\n",
status);
275 DBG2(
"sis190: received packet. len: %d\n", pkt_size);
278 tp->Rx_iobuf[entry] =
NULL;
286 DBG(
"sis190: no Rx buffer allocated.\n");
287 tp->dirty_rx += delta;
290 DBG(
"sis190: Rx buffers exhausted.\n");
297 #define TxErrMask (WND | TABRT | FIFO | LINK) 320 iob =
tp->Tx_iobuf[entry];
326 DBG2(
"sis190: Transmitted packet: %#08x\n",
status);
329 DBG(
"sis190: Transmit error: %#08x\n",
status);
333 tp->Tx_iobuf[entry] =
NULL;
336 if (
tp->dirty_tx != dirty_tx)
337 tp->dirty_tx = dirty_tx;
404 mc_filter[1] = mc_filter[0] = 0xffffffff;
452 int phy_id =
tp->mii_if.phy_id;
468 DBG(
"sis190: BMCR_RESET timeout\n");
474 DBG(
"sis190: auto-negotiating...\n");
484 "1000 Mbps Full Duplex" },
486 "1000 Mbps Half Duplex" },
488 "100 Mbps Full Duplex" },
490 "100 Mbps Half Duplex" },
492 "10 Mbps Full Duplex" },
494 "10 Mbps Half Duplex" },
495 { 0, 0x04000400,
"unknown" }
497 u16 adv, autoexp, gigadv, gigrec;
510 val = (gigadv & (gigrec >> 2));
520 for (p = reg31; p->val; p++) {
521 if ((
val & p->val) == p->val)
534 p->ctl |= 0x03000000;
544 DBG(
"sis190: link on %s mode.\n", p->msg);
556 if (!
tp->TxDescRing) {
557 DBG(
"sis190: TX ring allocation failed\n");
565 if (!
tp->RxDescRing) {
566 DBG(
"sis190: RX ring allocation failed\n");
612 tp->cur_tx =
tp->dirty_tx = 0;
645 desc =
tp->TxDescRing + entry;
648 DBG(
"sis190: Tx Ring full\n");
652 tp->Tx_iobuf[entry] = iob;
691 struct sis190_phy *phy, *phy_home, *phy_default, *phy_lan;
696 phy_home = phy_default = phy_lan =
NULL;
719 phy_default = phy_home;
721 phy_default = phy_lan;
729 DBG(
"sis190: Using transceiver at address %d as default.\n",
757 if ((p->
id[0] == phy->
id[0]) &&
758 (p->
id[1] == (phy->
id[1] & 0xfff0))) {
769 DBG(
"sis190: %s transceiver at address %d.\n", p->
name, phy_id);
773 DBG(
"sis190: unknown PHY 0x%x:0x%x transceiver at address %d\n",
774 phy->
id[0], (phy->
id[1] & 0xfff0), phy_id);
782 int phy_id =
tp->mii_if.phy_id;
825 phy =
zalloc(
sizeof(*phy));
832 DBG(
"sis190: found PHY\n");
840 DBG(
"sis190: No MII transceivers found!\n");
875 DBG(
"sis190: unable to alloc new etherdev\n");
891 DBG(
"sis190: cannot remap MMIO, aborting\n");
896 tp->pci_device = pdev;
924 DBG(
"sis190: Read MAC address from EEPROM\n");
929 if ((
sig == 0xffff) || (
sig == 0x0000)) {
930 DBG(
"sis190: Error EEPROM read.\n");
935 for (i = 0; i <
ETH_ALEN / 2; i++) {
964 DBG(
"sis190: Read MAC address from APC.\n");
968 for(i = 0; i < sis190_isa_bridge_driver.id_count; i++) {
971 sis190_isa_bridge_driver.ids[i].vendor
973 sis190_isa_bridge_driver.ids[i].device) {
974 DBG(
"sis190: ISA bridge found\n");
985 DBG(
"sis190: Can not find ISA bridge.\n");
991 reg = (tmp8 & ~0x02);
1052 if (
reg & 0x00000001)
1062 int phy_id =
tp->mii_if.phy_id;
1065 DBG(
"sis190: Enabling Auto-negotiation.\n");
#define EINVAL
Invalid argument.
static struct pci_device_id sis190_isa_bridge_tbl[]
static void sis190_free(struct net_device *dev)
unsigned long membase
Memory base.
struct arbelprm_rc_send_wqe rc
static void netdev_tx_complete(struct net_device *netdev, struct io_buffer *iobuf)
Complete network transmission.
static int sis190_mii_probe(struct net_device *dev)
sis190_mii_probe - Probe MII PHY for sis190 @dev: the net device to probe for
#define iob_put(iobuf, len)
static void sis190_mark_as_last_descriptor(struct RxDesc *desc)
#define ADVERTISE_1000FULL
void msg(unsigned int row, const char *fmt,...)
Print message centred on specified row.
static void sis190_init_rxfilter(struct net_device *dev)
sis190_init_rxfilter - Initialize the Rx filter @dev: network device to initialize
#define SIS_W16(reg, val)
static unsigned int unsigned int reg
static void sis190_set_rgmii(struct sis190_private *tp, u8 reg)
#define le32_to_cpu(value)
int(* open)(struct net_device *netdev)
Open network device.
#define list_add(new, head)
Add a new entry to the head of a list.
uint32_t next
Next descriptor address.
static struct mii_chip_info mii_chip_table[]
int(* mdio_read)(struct net_device *dev, int phy_id, int location)
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
struct pci_device_id * ids
PCI ID table.
struct arbelprm_completion_with_error error
static void sis190_irq(struct net_device *dev, int enable)
static void sis190_hw_start(struct net_device *dev)
static void sis190_mii_probe_88e1111_fixup(struct sis190_private *tp)
uint64_t desc
Microcode descriptor list physical address.
static struct net_device_operations sis190_netdev_ops
static void *__malloc malloc_phys(size_t size, size_t phys_align)
Allocate memory with specified physical alignment.
#define ADVERTISE_100FULL
void netdev_link_down(struct net_device *netdev)
Mark network device as having link down.
static int sis190_process_rx(struct sis190_private *tp)
static u16 mdio_read_latched(void *ioaddr, int phy_id, int reg)
static void sis190_init_phy(struct sis190_private *tp, struct sis190_phy *phy, unsigned int phy_id, u16 mii_status)
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
static u16 sis190_default_phy(struct sis190_private *tp)
sis190_default_phy - Select default PHY for sis190 mac.
struct device dev
Generic device.
static int sis190_transmit(struct net_device *dev, struct io_buffer *iob)
A doubly-linked list entry (or list head)
uint32_t pending
Pending events.
uint32_t start
Starting offset.
#define list_empty(list)
Test whether a list is empty.
static void sis190_phy_task(struct sis190_private *tp)
static void sis190_init_ring_indexes(struct sis190_private *tp)
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
#define ENOMEM
Not enough space.
struct pci_driver sis190_isa_bridge_driver __pci_driver
static unsigned long ioaddr
static void sis190_down(struct net_device *dev)
static int sis190_get_mac_addr(struct pci_device *pdev, struct net_device *dev)
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
uint16_t device
Device ID.
static int sis190_probe(struct pci_device *pdev)
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
#define container_of(ptr, type, field)
Get containing structure.
static int sis190_get_mac_addr_from_eeprom(struct pci_device *pdev __unused, struct net_device *dev)
static const u32 sis190_intr_mask
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
void * priv
Driver private data.
#define __unused
Declare a variable or data structure as unused.
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
#define BMSR_ANEGCOMPLETE
static int netdev_link_ok(struct net_device *netdev)
Check link state of network device.
static struct net_device * netdev
uint16_t count
Number of entries.
static struct tulip_private * tp
static void sis190_isa_bridge_remove(struct pci_device *pdev __unused)
static void __mdio_write(struct net_device *dev, int phy_id, int reg, int val)
void unregister_netdev(struct net_device *netdev)
Unregister network device.
#define list_for_each_entry_safe(pos, tmp, head, member)
Iterate over entries in a list, safe against deletion of the current entry.
#define cpu_to_le32(value)
#define SIS_W32(reg, val)
static int sis190_rx_pkt_err(u32 status)
static int sis190_init_board(struct pci_device *pdev, struct net_device **netdev)
static void sis190_irq_mask_and_ack(void *ioaddr)
static void(* free)(struct refcnt *refcnt))
int pci_write_config_byte(struct pci_device *pci, unsigned int where, uint8_t value)
Write byte to PCI configuration space.
void * zalloc(size_t size)
Allocate cleared memory.
struct list_head siblings
Devices on the same bus.
int register_netdev(struct net_device *netdev)
Register network device.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
void(* mdio_write)(struct net_device *dev, int phy_id, int location, int val)
static int sis190_isa_bridge_probe(struct pci_device *pdev __unused)
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
static int sis190_tx_pkt_err(u32 status)
static void sis190_give_to_asic(struct RxDesc *desc)
uint8_t inb(volatile uint8_t *io_addr)
Read byte from I/O-mapped device.
static void sis190_make_unusable_by_asic(struct RxDesc *desc)
A PCI device ID list entry.
#define ADVERTISE_1000HALF
static struct xen_remove_from_physmap * remove
uint16_t vendor
Vendor ID.
static void sis190_map_to_asic(struct RxDesc *desc, u32 mapping)
Network device operations.
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
static void sis190_set_rx_mode(struct net_device *dev)
struct device * dev
Underlying hardware device.
static void * pci_get_drvdata(struct pci_device *pci)
Get PCI driver-private data.
static int sis190_open(struct net_device *dev)
static void __mdio_cmd(void *ioaddr, u32 ctl)
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
#define INIT_LIST_HEAD(list)
Initialise a list head.
static void sis190_set_speed_auto(struct net_device *dev)
#define outb(data, io_addr)
void netdev_tx_complete_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Complete network transmission.
static void sis190_soft_reset(void *ioaddr)
int(* probe)(struct pci_device *pci)
Probe device.
static unsigned int cur_rx
void * data
Start of data.
static void sis190_free_phy(struct list_head *first_phy)
static u16 sis190_read_eeprom(void *ioaddr, u32 reg)
#define EIO
Input/output error.
static struct io_buffer * sis190_alloc_rx_iob(struct RxDesc *desc)
static struct pci_device_id sis190_pci_tbl[]
#define PCI_ID(_vendor, _device, _name, _description, _data)
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
#define cpu_to_le16(value)
static void sis190_close(struct net_device *dev)
uint32_t end
Ending offset.
void iounmap(volatile const void *io_addr)
Unmap I/O address.
uint8_t data[48]
Additional event data.
static int mdio_read(void *ioaddr, int phy_id, int reg)
static void free_phys(void *ptr, size_t size)
Free memory allocated with malloc_phys()
static void sis190_asic_down(void *ioaddr)
#define ADVERTISE_100HALF
static void sis190_process_tx(struct sis190_private *tp)
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
#define DBG(...)
Print a debugging message.
static void sis190_mii_remove(struct net_device *dev)
void * pci_ioremap(struct pci_device *pci, unsigned long bus_addr, size_t len)
Map PCI bus address as an I/O address.
#define list_entry(list, type, member)
Get the container of a list entry.
static int sis190_init_ring(struct net_device *dev)
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
#define NULL
NULL pointer (VOID *)
static void mdio_write(void *ioaddr, int phy_id, int reg, int val)
static u32 sis190_rx_fill(struct sis190_private *tp, u32 start, u32 end)
#define PCI_ROM(_vendor, _device, _name, _description, _data)
void iob_pad(struct io_buffer *iobuf, size_t min_len)
Pad I/O buffer.
static int __mdio_read(struct net_device *dev, int phy_id, int reg)
static void sis190_poll(struct net_device *dev)
static void sis190_remove(struct pci_device *pdev)
void * memset(void *dest, int character, size_t len) __nonnull
int pci_read_config_byte(struct pci_device *pci, unsigned int where, uint8_t *value)
Read byte from PCI configuration space.
static int sis190_get_mac_addr_from_apc(struct pci_device *pdev, struct net_device *dev)
sis190_get_mac_addr_from_apc - Get MAC address for SiS96x model @pdev: PCI device @dev: network devic...