Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ks8842.c File Reference
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/ks8842.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/scatterlist.h>

Go to the source code of this file.

Data Structures

struct  ks8842_tx_dma_ctl
 
struct  ks8842_rx_dma_ctl
 
struct  ks8842_adapter
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRV_NAME   "ks8842"
 
#define REG_TIMB_RST   0x1c
 
#define REG_TIMB_FIFO   0x20
 
#define REG_TIMB_ISR   0x24
 
#define REG_TIMB_IER   0x28
 
#define REG_TIMB_IAR   0x2C
 
#define REQ_TIMB_DMA_RESUME   0x30
 
#define REG_SELECT_BANK   0x0e
 
#define REG_QRFCR   0x04
 
#define REG_MARL   0x00
 
#define REG_MARM   0x02
 
#define REG_MARH   0x04
 
#define REG_GRR   0x06
 
#define REG_TXCR   0x00
 
#define REG_TXSR   0x02
 
#define REG_RXCR   0x04
 
#define REG_TXMIR   0x08
 
#define REG_RXMIR   0x0A
 
#define REG_TXQCR   0x00
 
#define REG_RXQCR   0x02
 
#define REG_TXFDPR   0x04
 
#define REG_RXFDPR   0x06
 
#define REG_QMU_DATA_LO   0x08
 
#define REG_QMU_DATA_HI   0x0A
 
#define REG_IER   0x00
 
#define IRQ_LINK_CHANGE   0x8000
 
#define IRQ_TX   0x4000
 
#define IRQ_RX   0x2000
 
#define IRQ_RX_OVERRUN   0x0800
 
#define IRQ_TX_STOPPED   0x0200
 
#define IRQ_RX_STOPPED   0x0100
 
#define IRQ_RX_ERROR   0x0080
 
#define ENABLED_IRQS
 
#define ENABLED_IRQS_DMA_IP
 
#define ENABLED_IRQS_DMA   (ENABLED_IRQS_DMA_IP | IRQ_RX)
 
#define REG_ISR   0x02
 
#define REG_RXSR   0x04
 
#define RXSR_VALID   0x8000
 
#define RXSR_BROADCAST   0x80
 
#define RXSR_MULTICAST   0x40
 
#define RXSR_UNICAST   0x20
 
#define RXSR_FRAMETYPE   0x08
 
#define RXSR_TOO_LONG   0x04
 
#define RXSR_RUNT   0x02
 
#define RXSR_CRC_ERROR   0x01
 
#define RXSR_ERROR   (RXSR_TOO_LONG | RXSR_RUNT | RXSR_CRC_ERROR)
 
#define REG_SW_ID_AND_ENABLE   0x00
 
#define REG_SGCR1   0x02
 
#define REG_SGCR2   0x04
 
#define REG_SGCR3   0x06
 
#define REG_MACAR1   0x00
 
#define REG_MACAR2   0x02
 
#define REG_MACAR3   0x04
 
#define REG_P1MBCR   0x00
 
#define REG_P1MBSR   0x02
 
#define REG_P2MBCR   0x00
 
#define REG_P2MBSR   0x02
 
#define REG_P1CR2   0x02
 
#define REG_P1CR4   0x02
 
#define REG_P1SR   0x04
 
#define MICREL_KS884X   0x01 /* 0=Timeberdale(FPGA), 1=Micrel */
 
#define KS884X_16BIT   0x02 /* 1=16bit, 0=32bit */
 
#define DMA_BUFFER_SIZE   2048
 
#define KS8842_USE_DMA(adapter)
 

Functions

void ks8842_handle_rx (struct net_device *netdev, struct ks8842_adapter *adapter)
 
void ks8842_handle_tx (struct net_device *netdev, struct ks8842_adapter *adapter)
 
void ks8842_handle_rx_overrun (struct net_device *netdev, struct ks8842_adapter *adapter)
 
void ks8842_tasklet (unsigned long arg)
 
 module_platform_driver (ks8842_platform_driver)
 
 MODULE_DESCRIPTION ("Timberdale KS8842 ethernet driver")
 
 MODULE_AUTHOR ("Mocean Laboratories <info@mocean-labs.com>")
 
 MODULE_LICENSE ("GPL v2")
 
 MODULE_ALIAS ("platform:ks8842")
 

Macro Definition Documentation

#define DMA_BUFFER_SIZE   2048

Definition at line 140 of file ks8842.c.

#define DRV_NAME   "ks8842"

Definition at line 38 of file ks8842.c.

#define ENABLED_IRQS
Value:

Definition at line 87 of file ks8842.c.

#define ENABLED_IRQS_DMA   (ENABLED_IRQS_DMA_IP | IRQ_RX)

Definition at line 97 of file ks8842.c.

#define ENABLED_IRQS_DMA_IP
Value:

Definition at line 95 of file ks8842.c.

#define IRQ_LINK_CHANGE   0x8000

Definition at line 80 of file ks8842.c.

#define IRQ_RX   0x2000

Definition at line 82 of file ks8842.c.

#define IRQ_RX_ERROR   0x0080

Definition at line 86 of file ks8842.c.

#define IRQ_RX_OVERRUN   0x0800

Definition at line 83 of file ks8842.c.

#define IRQ_RX_STOPPED   0x0100

Definition at line 85 of file ks8842.c.

#define IRQ_TX   0x4000

Definition at line 81 of file ks8842.c.

#define IRQ_TX_STOPPED   0x0200

Definition at line 84 of file ks8842.c.

#define KS8842_USE_DMA (   adapter)
Value:
(((adapter)->dma_tx.channel != -1) && \
((adapter)->dma_rx.channel != -1))

Definition at line 159 of file ks8842.c.

#define KS884X_16BIT   0x02 /* 1=16bit, 0=32bit */

Definition at line 138 of file ks8842.c.

#define MICREL_KS884X   0x01 /* 0=Timeberdale(FPGA), 1=Micrel */

Definition at line 137 of file ks8842.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 24 of file ks8842.c.

#define REG_GRR   0x06

Definition at line 61 of file ks8842.c.

#define REG_IER   0x00

Definition at line 79 of file ks8842.c.

#define REG_ISR   0x02

Definition at line 98 of file ks8842.c.

#define REG_MACAR1   0x00

Definition at line 117 of file ks8842.c.

#define REG_MACAR2   0x02

Definition at line 118 of file ks8842.c.

#define REG_MACAR3   0x04

Definition at line 119 of file ks8842.c.

#define REG_MARH   0x04

Definition at line 58 of file ks8842.c.

#define REG_MARL   0x00

Definition at line 56 of file ks8842.c.

#define REG_MARM   0x02

Definition at line 57 of file ks8842.c.

#define REG_P1CR2   0x02

Definition at line 130 of file ks8842.c.

#define REG_P1CR4   0x02

Definition at line 133 of file ks8842.c.

#define REG_P1MBCR   0x00

Definition at line 122 of file ks8842.c.

#define REG_P1MBSR   0x02

Definition at line 123 of file ks8842.c.

#define REG_P1SR   0x04

Definition at line 134 of file ks8842.c.

#define REG_P2MBCR   0x00

Definition at line 126 of file ks8842.c.

#define REG_P2MBSR   0x02

Definition at line 127 of file ks8842.c.

#define REG_QMU_DATA_HI   0x0A

Definition at line 76 of file ks8842.c.

#define REG_QMU_DATA_LO   0x08

Definition at line 75 of file ks8842.c.

#define REG_QRFCR   0x04

Definition at line 53 of file ks8842.c.

#define REG_RXCR   0x04

Definition at line 66 of file ks8842.c.

#define REG_RXFDPR   0x06

Definition at line 74 of file ks8842.c.

#define REG_RXMIR   0x0A

Definition at line 68 of file ks8842.c.

#define REG_RXQCR   0x02

Definition at line 72 of file ks8842.c.

#define REG_RXSR   0x04

Definition at line 99 of file ks8842.c.

#define REG_SELECT_BANK   0x0e

Definition at line 50 of file ks8842.c.

#define REG_SGCR1   0x02

Definition at line 112 of file ks8842.c.

#define REG_SGCR2   0x04

Definition at line 113 of file ks8842.c.

#define REG_SGCR3   0x06

Definition at line 114 of file ks8842.c.

#define REG_SW_ID_AND_ENABLE   0x00

Definition at line 111 of file ks8842.c.

#define REG_TIMB_FIFO   0x20

Definition at line 42 of file ks8842.c.

#define REG_TIMB_IAR   0x2C

Definition at line 45 of file ks8842.c.

#define REG_TIMB_IER   0x28

Definition at line 44 of file ks8842.c.

#define REG_TIMB_ISR   0x24

Definition at line 43 of file ks8842.c.

#define REG_TIMB_RST   0x1c

Definition at line 41 of file ks8842.c.

#define REG_TXCR   0x00

Definition at line 64 of file ks8842.c.

#define REG_TXFDPR   0x04

Definition at line 73 of file ks8842.c.

#define REG_TXMIR   0x08

Definition at line 67 of file ks8842.c.

#define REG_TXQCR   0x00

Definition at line 71 of file ks8842.c.

#define REG_TXSR   0x02

Definition at line 65 of file ks8842.c.

#define REQ_TIMB_DMA_RESUME   0x30

Definition at line 46 of file ks8842.c.

#define RXSR_BROADCAST   0x80

Definition at line 101 of file ks8842.c.

#define RXSR_CRC_ERROR   0x01

Definition at line 107 of file ks8842.c.

#define RXSR_ERROR   (RXSR_TOO_LONG | RXSR_RUNT | RXSR_CRC_ERROR)

Definition at line 108 of file ks8842.c.

#define RXSR_FRAMETYPE   0x08

Definition at line 104 of file ks8842.c.

#define RXSR_MULTICAST   0x40

Definition at line 102 of file ks8842.c.

#define RXSR_RUNT   0x02

Definition at line 106 of file ks8842.c.

#define RXSR_TOO_LONG   0x04

Definition at line 105 of file ks8842.c.

#define RXSR_UNICAST   0x20

Definition at line 103 of file ks8842.c.

#define RXSR_VALID   0x8000

Definition at line 100 of file ks8842.c.

Function Documentation

void ks8842_handle_rx ( struct net_device netdev,
struct ks8842_adapter adapter 
)

Definition at line 708 of file ks8842.c.

void ks8842_handle_rx_overrun ( struct net_device netdev,
struct ks8842_adapter adapter 
)

Definition at line 727 of file ks8842.c.

void ks8842_handle_tx ( struct net_device netdev,
struct ks8842_adapter adapter 
)

Definition at line 718 of file ks8842.c.

void ks8842_tasklet ( unsigned long  arg)

Definition at line 735 of file ks8842.c.

MODULE_ALIAS ( "platform:ks8842"  )
MODULE_AUTHOR ( "Mocean Laboratories <info@mocean-labs.com>"  )
MODULE_DESCRIPTION ( "Timberdale KS8842 ethernet driver )
MODULE_LICENSE ( "GPL v2 )
module_platform_driver ( ks8842_platform_driver  )