Commit 0e358810 authored by Chas Williams's avatar Chas Williams Committed by Thomas Graf

[ATM]: small atm cleanups (from Adrian Bunk <bunk@stusta.de>)

Signed-off-by: default avatarChas Williams <chas@cmf.nrl.navy.mil>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 61092c83
...@@ -1692,7 +1692,7 @@ static unsigned int command_timeouts [] = { ...@@ -1692,7 +1692,7 @@ static unsigned int command_timeouts [] = {
}; };
unsigned int command_successes [] = { static unsigned int command_successes [] = {
[host_memory_test] = COMMAND_PASSED_TEST, [host_memory_test] = COMMAND_PASSED_TEST,
[read_adapter_memory] = COMMAND_READ_DATA_OK, [read_adapter_memory] = COMMAND_READ_DATA_OK,
[write_adapter_memory] = COMMAND_WRITE_DATA_OK, [write_adapter_memory] = COMMAND_WRITE_DATA_OK,
...@@ -2088,7 +2088,7 @@ static void __init amb_ucode_version (amb_dev * dev) { ...@@ -2088,7 +2088,7 @@ static void __init amb_ucode_version (amb_dev * dev) {
} }
// swap bits within byte to get Ethernet ordering // swap bits within byte to get Ethernet ordering
u8 bit_swap (u8 byte) static u8 bit_swap (u8 byte)
{ {
const u8 swap[] = { const u8 swap[] = {
0x0, 0x8, 0x4, 0xc, 0x0, 0x8, 0x4, 0xc,
......
...@@ -396,7 +396,7 @@ static int atmtcp_create(int itf,int persist,struct atm_dev **result) ...@@ -396,7 +396,7 @@ static int atmtcp_create(int itf,int persist,struct atm_dev **result)
} }
int atmtcp_attach(struct atm_vcc *vcc,int itf) static int atmtcp_attach(struct atm_vcc *vcc,int itf)
{ {
struct atm_dev *dev; struct atm_dev *dev;
...@@ -427,13 +427,13 @@ int atmtcp_attach(struct atm_vcc *vcc,int itf) ...@@ -427,13 +427,13 @@ int atmtcp_attach(struct atm_vcc *vcc,int itf)
} }
int atmtcp_create_persistent(int itf) static int atmtcp_create_persistent(int itf)
{ {
return atmtcp_create(itf,1,NULL); return atmtcp_create(itf,1,NULL);
} }
int atmtcp_remove_persistent(int itf) static int atmtcp_remove_persistent(int itf)
{ {
struct atm_dev *dev; struct atm_dev *dev;
struct atmtcp_dev_data *dev_data; struct atmtcp_dev_data *dev_data;
......
...@@ -82,14 +82,14 @@ static int num=0x5a; ...@@ -82,14 +82,14 @@ static int num=0x5a;
* would be interpreted. -- REW */ * would be interpreted. -- REW */
#define NP FS_NR_FREE_POOLS #define NP FS_NR_FREE_POOLS
int rx_buf_sizes[NP] = {128, 256, 512, 1024, 2048, 4096, 16384, 65520}; static int rx_buf_sizes[NP] = {128, 256, 512, 1024, 2048, 4096, 16384, 65520};
/* log2: 7 8 9 10 11 12 14 16 */ /* log2: 7 8 9 10 11 12 14 16 */
#if 0 #if 0
int rx_pool_sizes[NP] = {1024, 1024, 512, 256, 128, 64, 32, 32}; static int rx_pool_sizes[NP] = {1024, 1024, 512, 256, 128, 64, 32, 32};
#else #else
/* debug */ /* debug */
int rx_pool_sizes[NP] = {128, 128, 128, 64, 64, 64, 32, 32}; static int rx_pool_sizes[NP] = {128, 128, 128, 64, 64, 64, 32, 32};
#endif #endif
/* log2: 10 10 9 8 7 6 5 5 */ /* log2: 10 10 9 8 7 6 5 5 */
/* sumlog2: 17 18 18 18 18 18 19 21 */ /* sumlog2: 17 18 18 18 18 18 19 21 */
...@@ -250,7 +250,7 @@ struct reginit_item { ...@@ -250,7 +250,7 @@ struct reginit_item {
}; };
struct reginit_item PHY_NTC_INIT[] __devinitdata = { static struct reginit_item PHY_NTC_INIT[] __devinitdata = {
{ PHY_CLEARALL, 0x40 }, { PHY_CLEARALL, 0x40 },
{ 0x12, 0x0001 }, { 0x12, 0x0001 },
{ 0x13, 0x7605 }, { 0x13, 0x7605 },
...@@ -334,7 +334,7 @@ module_param(fs_keystream, int, 0); ...@@ -334,7 +334,7 @@ module_param(fs_keystream, int, 0);
#define func_exit() fs_dprintk (FS_DEBUG_FLOW, "fs: exit %s\n", __FUNCTION__) #define func_exit() fs_dprintk (FS_DEBUG_FLOW, "fs: exit %s\n", __FUNCTION__)
struct fs_dev *fs_boards = NULL; static struct fs_dev *fs_boards = NULL;
#ifdef DEBUG #ifdef DEBUG
...@@ -1921,7 +1921,7 @@ static int __devinit firestream_init_one (struct pci_dev *pci_dev, ...@@ -1921,7 +1921,7 @@ static int __devinit firestream_init_one (struct pci_dev *pci_dev,
return -ENODEV; return -ENODEV;
} }
void __devexit firestream_remove_one (struct pci_dev *pdev) static void __devexit firestream_remove_one (struct pci_dev *pdev)
{ {
int i; int i;
struct fs_dev *dev, *nxtdev; struct fs_dev *dev, *nxtdev;
......
...@@ -147,7 +147,7 @@ static u8 read_prom_byte(struct he_dev *he_dev, int addr); ...@@ -147,7 +147,7 @@ static u8 read_prom_byte(struct he_dev *he_dev, int addr);
/* globals */ /* globals */
struct he_dev *he_devs = NULL; static struct he_dev *he_devs = NULL;
static int disable64 = 0; static int disable64 = 0;
static short nvpibits = -1; static short nvpibits = -1;
static short nvcibits = -1; static short nvcibits = -1;
...@@ -155,6 +155,48 @@ static short rx_skb_reserve = 16; ...@@ -155,6 +155,48 @@ static short rx_skb_reserve = 16;
static int irq_coalesce = 1; static int irq_coalesce = 1;
static int sdh = 0; static int sdh = 0;
/* Read from EEPROM = 0000 0011b */
static unsigned int readtab[] = {
CS_HIGH | CLK_HIGH,
CS_LOW | CLK_LOW,
CLK_HIGH, /* 0 */
CLK_LOW,
CLK_HIGH, /* 0 */
CLK_LOW,
CLK_HIGH, /* 0 */
CLK_LOW,
CLK_HIGH, /* 0 */
CLK_LOW,
CLK_HIGH, /* 0 */
CLK_LOW,
CLK_HIGH, /* 0 */
CLK_LOW | SI_HIGH,
CLK_HIGH | SI_HIGH, /* 1 */
CLK_LOW | SI_HIGH,
CLK_HIGH | SI_HIGH /* 1 */
};
/* Clock to read from/write to the EEPROM */
static unsigned int clocktab[] = {
CLK_LOW,
CLK_HIGH,
CLK_LOW,
CLK_HIGH,
CLK_LOW,
CLK_HIGH,
CLK_LOW,
CLK_HIGH,
CLK_LOW,
CLK_HIGH,
CLK_LOW,
CLK_HIGH,
CLK_LOW,
CLK_HIGH,
CLK_LOW,
CLK_HIGH,
CLK_LOW
};
static struct atmdev_ops he_ops = static struct atmdev_ops he_ops =
{ {
.open = he_open, .open = he_open,
......
...@@ -892,47 +892,4 @@ struct he_vcc ...@@ -892,47 +892,4 @@ struct he_vcc
#define SI_HIGH ID_DIN /* HOST_CNTL_ID_PROM_DATA_IN */ #define SI_HIGH ID_DIN /* HOST_CNTL_ID_PROM_DATA_IN */
#define EEPROM_DELAY 400 /* microseconds */ #define EEPROM_DELAY 400 /* microseconds */
/* Read from EEPROM = 0000 0011b */
unsigned int readtab[] = {
CS_HIGH | CLK_HIGH,
CS_LOW | CLK_LOW,
CLK_HIGH, /* 0 */
CLK_LOW,
CLK_HIGH, /* 0 */
CLK_LOW,
CLK_HIGH, /* 0 */
CLK_LOW,
CLK_HIGH, /* 0 */
CLK_LOW,
CLK_HIGH, /* 0 */
CLK_LOW,
CLK_HIGH, /* 0 */
CLK_LOW | SI_HIGH,
CLK_HIGH | SI_HIGH, /* 1 */
CLK_LOW | SI_HIGH,
CLK_HIGH | SI_HIGH /* 1 */
};
/* Clock to read from/write to the EEPROM */
unsigned int clocktab[] = {
CLK_LOW,
CLK_HIGH,
CLK_LOW,
CLK_HIGH,
CLK_LOW,
CLK_HIGH,
CLK_LOW,
CLK_HIGH,
CLK_LOW,
CLK_HIGH,
CLK_LOW,
CLK_HIGH,
CLK_LOW,
CLK_HIGH,
CLK_LOW,
CLK_HIGH,
CLK_LOW
};
#endif /* _HE_H_ */ #endif /* _HE_H_ */
...@@ -323,7 +323,7 @@ static int idt77105_start(struct atm_dev *dev) ...@@ -323,7 +323,7 @@ static int idt77105_start(struct atm_dev *dev)
} }
int idt77105_stop(struct atm_dev *dev) static int idt77105_stop(struct atm_dev *dev)
{ {
struct idt77105_priv *walk, *prev; struct idt77105_priv *walk, *prev;
......
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
int idt77105_init(struct atm_dev *dev) __init; int idt77105_init(struct atm_dev *dev) __init;
int idt77105_stop(struct atm_dev *dev);
#endif #endif
/* /*
......
...@@ -275,7 +275,7 @@ struct rsq_info { ...@@ -275,7 +275,7 @@ struct rsq_info {
struct rsq_entry *next; struct rsq_entry *next;
struct rsq_entry *last; struct rsq_entry *last;
dma_addr_t paddr; dma_addr_t paddr;
} rsq_info; };
/*****************************************************************************/ /*****************************************************************************/
......
...@@ -72,13 +72,13 @@ struct suni_priv { ...@@ -72,13 +72,13 @@ struct suni_priv {
#define PRIV(dev) ((struct suni_priv *) dev->phy_data) #define PRIV(dev) ((struct suni_priv *) dev->phy_data)
static unsigned char ia_phy_get(struct atm_dev *dev, unsigned long addr); static unsigned char ia_phy_get(struct atm_dev *dev, unsigned long addr);
static void desc_dbg(IADEV *iadev);
static IADEV *ia_dev[8]; static IADEV *ia_dev[8];
static struct atm_dev *_ia_dev[8]; static struct atm_dev *_ia_dev[8];
static int iadev_count; static int iadev_count;
static void ia_led_timer(unsigned long arg); static void ia_led_timer(unsigned long arg);
static struct timer_list ia_timer = TIMER_INITIALIZER(ia_led_timer, 0, 0); static struct timer_list ia_timer = TIMER_INITIALIZER(ia_led_timer, 0, 0);
struct atm_vcc *vcc_close_que[100];
static int IA_TX_BUF = DFL_TX_BUFFERS, IA_TX_BUF_SZ = DFL_TX_BUF_SZ; static int IA_TX_BUF = DFL_TX_BUFFERS, IA_TX_BUF_SZ = DFL_TX_BUF_SZ;
static int IA_RX_BUF = DFL_RX_BUFFERS, IA_RX_BUF_SZ = DFL_RX_BUF_SZ; static int IA_RX_BUF = DFL_RX_BUFFERS, IA_RX_BUF_SZ = DFL_RX_BUF_SZ;
static uint IADebugFlag = /* IF_IADBG_ERR | IF_IADBG_CBR| IF_IADBG_INIT_ADAPTER static uint IADebugFlag = /* IF_IADBG_ERR | IF_IADBG_CBR| IF_IADBG_INIT_ADAPTER
...@@ -147,7 +147,6 @@ static void ia_hack_tcq(IADEV *dev) { ...@@ -147,7 +147,6 @@ static void ia_hack_tcq(IADEV *dev) {
u_short desc1; u_short desc1;
u_short tcq_wr; u_short tcq_wr;
struct ia_vcc *iavcc_r = NULL; struct ia_vcc *iavcc_r = NULL;
extern void desc_dbg(IADEV *iadev);
tcq_wr = readl(dev->seg_reg+TCQ_WR_PTR) & 0xffff; tcq_wr = readl(dev->seg_reg+TCQ_WR_PTR) & 0xffff;
while (dev->host_tcq_wr != tcq_wr) { while (dev->host_tcq_wr != tcq_wr) {
...@@ -187,7 +186,6 @@ static u16 get_desc (IADEV *dev, struct ia_vcc *iavcc) { ...@@ -187,7 +186,6 @@ static u16 get_desc (IADEV *dev, struct ia_vcc *iavcc) {
unsigned long delta; unsigned long delta;
static unsigned long timer = 0; static unsigned long timer = 0;
int ltimeout; int ltimeout;
extern void desc_dbg(IADEV *iadev);
ia_hack_tcq (dev); ia_hack_tcq (dev);
if(((jiffies - timer)>50)||((dev->ffL.tcq_rd==dev->host_tcq_wr))){ if(((jiffies - timer)>50)||((dev->ffL.tcq_rd==dev->host_tcq_wr))){
...@@ -644,7 +642,7 @@ static int ia_que_tx (IADEV *iadev) { ...@@ -644,7 +642,7 @@ static int ia_que_tx (IADEV *iadev) {
return 0; return 0;
} }
void ia_tx_poll (IADEV *iadev) { static void ia_tx_poll (IADEV *iadev) {
struct atm_vcc *vcc = NULL; struct atm_vcc *vcc = NULL;
struct sk_buff *skb = NULL, *skb1 = NULL; struct sk_buff *skb = NULL, *skb1 = NULL;
struct ia_vcc *iavcc; struct ia_vcc *iavcc;
...@@ -861,7 +859,7 @@ static void IaFrontEndIntr(IADEV *iadev) { ...@@ -861,7 +859,7 @@ static void IaFrontEndIntr(IADEV *iadev) {
return; return;
} }
void ia_mb25_init (IADEV *iadev) static void ia_mb25_init (IADEV *iadev)
{ {
volatile ia_mb25_t *mb25 = (ia_mb25_t*)iadev->phy; volatile ia_mb25_t *mb25 = (ia_mb25_t*)iadev->phy;
#if 0 #if 0
...@@ -876,7 +874,7 @@ void ia_mb25_init (IADEV *iadev) ...@@ -876,7 +874,7 @@ void ia_mb25_init (IADEV *iadev)
return; return;
} }
void ia_suni_pm7345_init (IADEV *iadev) static void ia_suni_pm7345_init (IADEV *iadev)
{ {
volatile suni_pm7345_t *suni_pm7345 = (suni_pm7345_t *)iadev->phy; volatile suni_pm7345_t *suni_pm7345 = (suni_pm7345_t *)iadev->phy;
if (iadev->phy_type & FE_DS3_PHY) if (iadev->phy_type & FE_DS3_PHY)
...@@ -959,9 +957,8 @@ void ia_suni_pm7345_init (IADEV *iadev) ...@@ -959,9 +957,8 @@ void ia_suni_pm7345_init (IADEV *iadev)
/***************************** IA_LIB END *****************************/ /***************************** IA_LIB END *****************************/
/* pwang_test debug utility */ static int tcnter = 0;
int tcnter = 0, rcnter = 0; static void xdump( u_char* cp, int length, char* prefix )
void xdump( u_char* cp, int length, char* prefix )
{ {
int col, count; int col, count;
u_char prntBuf[120]; u_char prntBuf[120];
...@@ -1008,7 +1005,7 @@ static struct atm_dev *ia_boards = NULL; ...@@ -1008,7 +1005,7 @@ static struct atm_dev *ia_boards = NULL;
/*-- some utilities and memory allocation stuff will come here -------------*/ /*-- some utilities and memory allocation stuff will come here -------------*/
void desc_dbg(IADEV *iadev) { static void desc_dbg(IADEV *iadev) {
u_short tcq_wr_ptr, tcq_st_ptr, tcq_ed_ptr; u_short tcq_wr_ptr, tcq_st_ptr, tcq_ed_ptr;
u32 i; u32 i;
......
...@@ -1126,8 +1126,6 @@ typedef struct { ...@@ -1126,8 +1126,6 @@ typedef struct {
#define FE_DS3_PHY 0x0080 /* DS3 */ #define FE_DS3_PHY 0x0080 /* DS3 */
#define FE_E3_PHY 0x0090 /* E3 */ #define FE_E3_PHY 0x0090 /* E3 */
extern void ia_mb25_init (IADEV *);
/*********************** SUNI_PM7345 PHY DEFINE HERE *********************/ /*********************** SUNI_PM7345 PHY DEFINE HERE *********************/
typedef struct _suni_pm7345_t typedef struct _suni_pm7345_t
{ {
...@@ -1326,8 +1324,6 @@ typedef struct _suni_pm7345_t ...@@ -1326,8 +1324,6 @@ typedef struct _suni_pm7345_t
#define SUNI_DS3_FOVRI 0x02 /* FIFO overrun */ #define SUNI_DS3_FOVRI 0x02 /* FIFO overrun */
#define SUNI_DS3_FUDRI 0x01 /* FIFO underrun */ #define SUNI_DS3_FUDRI 0x01 /* FIFO underrun */
extern void ia_suni_pm7345_init (IADEV *iadev);
///////////////////SUNI_PM7345 PHY DEFINE END ///////////////////////////// ///////////////////SUNI_PM7345 PHY DEFINE END /////////////////////////////
/* ia_eeprom define*/ /* ia_eeprom define*/
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#define SI_LOW 0x0000 /* Serial input data low */ #define SI_LOW 0x0000 /* Serial input data low */
/* Read Status Register = 0000 0101b */ /* Read Status Register = 0000 0101b */
#if 0
static u_int32_t rdsrtab[] = static u_int32_t rdsrtab[] =
{ {
CS_HIGH | CLK_HIGH, CS_HIGH | CLK_HIGH,
...@@ -55,6 +56,7 @@ static u_int32_t rdsrtab[] = ...@@ -55,6 +56,7 @@ static u_int32_t rdsrtab[] =
CLK_LOW | SI_HIGH, CLK_LOW | SI_HIGH,
CLK_HIGH | SI_HIGH /* 1 */ CLK_HIGH | SI_HIGH /* 1 */
}; };
#endif /* 0 */
/* Read from EEPROM = 0000 0011b */ /* Read from EEPROM = 0000 0011b */
...@@ -117,7 +119,7 @@ static u_int32_t clocktab[] = ...@@ -117,7 +119,7 @@ static u_int32_t clocktab[] =
* eeprom, then pull the result from bit 16 of the NicSTaR's General Purpose * eeprom, then pull the result from bit 16 of the NicSTaR's General Purpose
* register. * register.
*/ */
#if 0
u_int32_t u_int32_t
nicstar_read_eprom_status( virt_addr_t base ) nicstar_read_eprom_status( virt_addr_t base )
{ {
...@@ -153,6 +155,7 @@ nicstar_read_eprom_status( virt_addr_t base ) ...@@ -153,6 +155,7 @@ nicstar_read_eprom_status( virt_addr_t base )
osp_MicroDelay( CYCLE_DELAY ); osp_MicroDelay( CYCLE_DELAY );
return rbyte; return rbyte;
} }
#endif /* 0 */
/* /*
......
...@@ -9,6 +9,5 @@ ...@@ -9,6 +9,5 @@
typedef void __iomem *virt_addr_t; typedef void __iomem *virt_addr_t;
u_int32_t nicstar_read_eprom_status( virt_addr_t base );
void nicstar_init_eprom( virt_addr_t base ); void nicstar_init_eprom( virt_addr_t base );
void nicstar_read_eprom( virt_addr_t, u_int8_t, u_int8_t *, u_int32_t); void nicstar_read_eprom( virt_addr_t, u_int8_t, u_int8_t *, u_int32_t);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment