Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16860
b: refs/heads/master
c: 3b68d70
h: refs/heads/master
v: v3
  • Loading branch information
Lennert Buytenhek authored and Linus Torvalds committed Jan 9, 2006
1 parent b5b7b15 commit 4517263
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3eaa5e7dcce0653d2bfd2ab85a623687da49f8d5
refs/heads/master: 3b68d70dffe255e7681d5725d96bc2b92a24bb9d
28 changes: 28 additions & 0 deletions trunk/drivers/net/cs89x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,32 @@ struct net_device * __init cs89x0_probe(int unit)
}
#endif

#if defined(CONFIG_ARCH_IXDP2X01)
static int
readword(unsigned long base_addr, int portno)
{
return (u16)__raw_readl(base_addr + (portno << 1));
}

static void
writeword(unsigned long base_addr, int portno, int value)
{
__raw_writel((u16)value, base_addr + (portno << 1));
}
#else
#if defined(CONFIG_ARCH_PNX0501)
static int
readword(unsigned long base_addr, int portno)
{
return inw(base_addr + (portno << 1));
}

static void
writeword(unsigned long base_addr, int portno, int value)
{
outw(value, base_addr + (portno << 1));
}
#else
static int
readword(unsigned long base_addr, int portno)
{
Expand All @@ -349,6 +375,8 @@ writeword(unsigned long base_addr, int portno, int value)
{
outw(value, base_addr + portno);
}
#endif
#endif

static int
readreg(struct net_device *dev, int regno)
Expand Down
19 changes: 6 additions & 13 deletions trunk/drivers/net/cs89x0.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@

#include <linux/config.h>

#if defined(CONFIG_ARCH_IXDP2X01) || defined(CONFIG_ARCH_PNX0105)
/* IXDP2401/IXDP2801 uses dword-aligned register addressing */
#define CS89x0_PORT(reg) ((reg) * 2)
#else
#define CS89x0_PORT(reg) (reg)
#endif

#define PP_ChipID 0x0000 /* offset 0h -> Corp -ID */
/* offset 2h -> Model/Product Number */
/* offset 3h -> Chip Revision Number */
Expand Down Expand Up @@ -332,16 +325,16 @@
#define RAM_SIZE 0x1000 /* The card has 4k bytes or RAM */
#define PKT_START PP_TxFrame /* Start of packet RAM */

#define RX_FRAME_PORT CS89x0_PORT(0x0000)
#define RX_FRAME_PORT 0x0000
#define TX_FRAME_PORT RX_FRAME_PORT
#define TX_CMD_PORT CS89x0_PORT(0x0004)
#define TX_CMD_PORT 0x0004
#define TX_NOW 0x0000 /* Tx packet after 5 bytes copied */
#define TX_AFTER_381 0x0040 /* Tx packet after 381 bytes copied */
#define TX_AFTER_ALL 0x00c0 /* Tx packet after all bytes copied */
#define TX_LEN_PORT CS89x0_PORT(0x0006)
#define ISQ_PORT CS89x0_PORT(0x0008)
#define ADD_PORT CS89x0_PORT(0x000A)
#define DATA_PORT CS89x0_PORT(0x000C)
#define TX_LEN_PORT 0x0006
#define ISQ_PORT 0x0008
#define ADD_PORT 0x000A
#define DATA_PORT 0x000C

#define EEPROM_WRITE_EN 0x00F0
#define EEPROM_WRITE_DIS 0x0000
Expand Down

0 comments on commit 4517263

Please sign in to comment.