Linux Kernel
3.7.1
|
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/net.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/delay.h>
#include <linux/hdlc.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/gfp.h>
#include <asm/dma.h>
#include <asm/io.h>
#include <linux/spinlock.h>
#include "z85230.h"
Go to the source code of this file.
Macros | |
#define | pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
#define | RT_LOCK |
#define | RT_UNLOCK |
Variables | |
u8 | z8530_dead_port [] |
u8 | z8530_hdlc_kilostream [] |
u8 | z8530_hdlc_kilostream_85230 [] |
struct z8530_irqhandler | z8530_sync |
struct z8530_irqhandler | z8530_nop |
EXPORT_SYMBOL | ( | z8530_dead_port | ) |
EXPORT_SYMBOL | ( | z8530_hdlc_kilostream | ) |
EXPORT_SYMBOL | ( | z8530_hdlc_kilostream_85230 | ) |
EXPORT_SYMBOL | ( | z8530_sync | ) |
EXPORT_SYMBOL | ( | z8530_nop | ) |
EXPORT_SYMBOL | ( | z8530_interrupt | ) |
EXPORT_SYMBOL | ( | z8530_sync_open | ) |
EXPORT_SYMBOL | ( | z8530_sync_close | ) |
EXPORT_SYMBOL | ( | z8530_sync_dma_open | ) |
EXPORT_SYMBOL | ( | z8530_sync_dma_close | ) |
EXPORT_SYMBOL | ( | z8530_sync_txdma_open | ) |
EXPORT_SYMBOL | ( | z8530_sync_txdma_close | ) |
EXPORT_SYMBOL | ( | z8530_describe | ) |
EXPORT_SYMBOL | ( | z8530_init | ) |
EXPORT_SYMBOL | ( | z8530_shutdown | ) |
EXPORT_SYMBOL | ( | z8530_channel_load | ) |
EXPORT_SYMBOL | ( | z8530_null_rx | ) |
EXPORT_SYMBOL | ( | z8530_queue_xmit | ) |
MODULE_AUTHOR | ( | "Red Hat Inc." | ) |
module_exit | ( | z85230_cleanup_driver | ) |
module_init | ( | z85230_init_driver | ) |
MODULE_LICENSE | ( | "GPL" | ) |
int z8530_channel_load | ( | struct z8530_channel * | c, |
u8 * | rtable | ||
) |
z8530_describe - Uniformly describe a Z8530 port : Z8530 device to describe : string holding mapping type (eg "I/O" or "Mem") : the port value in question
Describe a Z8530 in a standard format. We must pass the I/O as the port offset isn't predictable. The main reason for this function is to try and get a common format of report.
z8530_init - Initialise a Z8530 device : Z8530 device to initialise.
Configure up a Z8530/Z85C30 or Z85230 chip. We check the device is present, identify the type and then program it to hopefully keep quite and behave. This matters a lot, a Z8530 in the wrong state will sometimes get into stupid modes generating 10Khz interrupt streams and the like.
We set the interrupt handler up to discard any events, in case we get them during reset or setp.
Return 0 for success, or a negative value indicating the problem in errno form.
irqreturn_t z8530_interrupt | ( | int | irq, |
void * | dev_id | ||
) |
z8530_interrupt - Handle an interrupt from a Z8530 : Interrupt number : The Z8530 device that is interrupting.
A Z85[2]30 device has stuck its hand in the air for attention. We scan both the channels on the chip for events and then call the channel specific call backs for each channel that has events. We have to use callback functions because the two channels can be in different modes.
Locking is done for the handlers. Note that locking is done at the chip level (the 5uS delay issue is per chip not per channel). c->lock for both channels points to dev->lock
void z8530_null_rx | ( | struct z8530_channel * | c, |
struct sk_buff * | skb | ||
) |
netdev_tx_t z8530_queue_xmit | ( | struct z8530_channel * | c, |
struct sk_buff * | skb | ||
) |
z8530_queue_xmit - Queue a packet : The channel to use : The packet to kick down the channel
Queue a packet for transmission. Because we have rather hard to hit interrupt latencies for the Z85230 per packet even in DMA mode we do the flip to DMA buffer if needed here not in the IRQ.
Called from the network code. The lock is not held at this point.
int z8530_sync_close | ( | struct net_device * | dev, |
struct z8530_channel * | c | ||
) |
int z8530_sync_dma_close | ( | struct net_device * | dev, |
struct z8530_channel * | c | ||
) |
int z8530_sync_dma_open | ( | struct net_device * | dev, |
struct z8530_channel * | c | ||
) |
z8530_sync_dma_open - Open a Z8530 for DMA I/O : The network device to attach : The Z8530 channel to configure in sync DMA mode.
Set up a Z85x30 device for synchronous DMA in both directions. Two ISA DMA channels must be available for this to work. We assume ISA DMA driven I/O and PC limits on access.
int z8530_sync_open | ( | struct net_device * | dev, |
struct z8530_channel * | c | ||
) |
int z8530_sync_txdma_close | ( | struct net_device * | dev, |
struct z8530_channel * | c | ||
) |
int z8530_sync_txdma_open | ( | struct net_device * | dev, |
struct z8530_channel * | c | ||
) |
z8530_sync_txdma_open - Open a Z8530 for TX driven DMA : The network device to attach : The Z8530 channel to configure in sync DMA mode.
Set up a Z85x30 device for synchronous DMA tranmission. One ISA DMA channel must be available for this to work. The receive side is run in PIO mode, but then it has the bigger FIFO.
u8 z8530_hdlc_kilostream[] |
u8 z8530_hdlc_kilostream_85230[] |
struct z8530_irqhandler z8530_nop |
struct z8530_irqhandler z8530_sync |