OpenCloudOS-Kernel/drivers/net/ixp2000/ixpdev_priv.h

58 lines
1.8 KiB
C
Raw Normal View History

[PATCH] intel ixp2000 network driver The way the hardware and firmware work is that there is one shared RX queue and IRQ for a number of different network interfaces. Due to this, we would like to process received packets for every interface in the same NAPI poll handler, so we need a pseudo-device to schedule polling on. What the driver currently does is that it always schedules polling for the first network interface in the list, and processes packets for every interface in the poll handler for that first interface -- however, this scheme breaks down if the first network interface happens to not be up, since netif_rx_schedule_prep() checks netif_running(). sky2 apparently has the same issue, and Stephen Hemminger suggested a way to work around this: create a variant of netif_rx_schedule_prep() that does not check netif_running(). I implemented this locally and called it netif_rx_schedule_prep_notup(), and it seems to work well, but it's something that probably not everyone would be happy with. The ixp2000 is an ARM CPU with a high-speed network interface in the CPU itself (full duplex 4Gb/s or 10Gb/s depending on the IXP model.) The CPU package also contains 8 or 16 (again depending on the IXP model) 'microengines', which are somewhat primitive but very fast and efficient processor cores which can be used to offload various things from the main CPU. This driver makes the high-speed network interface in the CPU visible and usable as a regular linux network device. Currently, it only supports the Radisys ENP2611 IXP board, but adding support for other board types should be fairly easy. Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2005-11-12 01:23:13 +08:00
/*
* IXP2000 MSF network device driver
* Copyright (C) 2004, 2005 Lennert Buytenhek <buytenh@wantstofly.org>
* Dedicated to Marija Kulikova.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef __IXPDEV_PRIV_H
#define __IXPDEV_PRIV_H
#define RX_BUF_DESC_BASE 0x00001000
#define RX_BUF_COUNT ((3 * PAGE_SIZE) / (4 * sizeof(struct ixpdev_rx_desc)))
#define TX_BUF_DESC_BASE 0x00002000
#define TX_BUF_COUNT ((3 * PAGE_SIZE) / (4 * sizeof(struct ixpdev_tx_desc)))
#define TX_BUF_COUNT_PER_CHAN (TX_BUF_COUNT / 4)
#define RING_RX_PENDING ((u32 *)IXP2000_SCRATCH_RING_VIRT_BASE)
#define RING_RX_DONE ((u32 *)(IXP2000_SCRATCH_RING_VIRT_BASE + 4))
#define RING_TX_PENDING ((u32 *)(IXP2000_SCRATCH_RING_VIRT_BASE + 8))
#define RING_TX_DONE ((u32 *)(IXP2000_SCRATCH_RING_VIRT_BASE + 12))
#define SCRATCH_REG(x) ((u32 *)(IXP2000_GLOBAL_REG_VIRT_BASE | 0x0800 | (x)))
#define RING_RX_PENDING_BASE SCRATCH_REG(0x00)
#define RING_RX_PENDING_HEAD SCRATCH_REG(0x04)
#define RING_RX_PENDING_TAIL SCRATCH_REG(0x08)
#define RING_RX_DONE_BASE SCRATCH_REG(0x10)
#define RING_RX_DONE_HEAD SCRATCH_REG(0x14)
#define RING_RX_DONE_TAIL SCRATCH_REG(0x18)
#define RING_TX_PENDING_BASE SCRATCH_REG(0x20)
#define RING_TX_PENDING_HEAD SCRATCH_REG(0x24)
#define RING_TX_PENDING_TAIL SCRATCH_REG(0x28)
#define RING_TX_DONE_BASE SCRATCH_REG(0x30)
#define RING_TX_DONE_HEAD SCRATCH_REG(0x34)
#define RING_TX_DONE_TAIL SCRATCH_REG(0x38)
struct ixpdev_rx_desc
{
u32 buf_addr;
u32 buf_length;
u32 channel;
u32 pkt_length;
};
struct ixpdev_tx_desc
{
u32 buf_addr;
u32 pkt_length;
u32 channel;
u32 unused;
};
#endif