summaryrefslogtreecommitdiff
path: root/drivers/net/ax88796.h
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2008-04-24 07:57:17 +0200
committerBen Warren <biggerbadderben@gmail.com>2008-04-28 22:26:36 -0700
commit2ef7503a593c77a80c2a054011970227c4b62774 (patch)
treecdfe8216b34d41da37332efe6a816d5c0a281fce /drivers/net/ax88796.h
parent40cb90ee2b97db1f697e1b54f19a548ffc96d71b (diff)
downloadu-boot-imx-2ef7503a593c77a80c2a054011970227c4b62774.zip
u-boot-imx-2ef7503a593c77a80c2a054011970227c4b62774.tar.gz
u-boot-imx-2ef7503a593c77a80c2a054011970227c4b62774.tar.bz2
NE2000: Fix regresssion introduced by e710185aae90 on non AX88796
Move non-inlied functions into specific drivers file Set get_prom as weak Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Vlad Lungu <vlad@comsys.ro> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'drivers/net/ax88796.h')
-rw-r--r--drivers/net/ax88796.h136
1 files changed, 0 insertions, 136 deletions
diff --git a/drivers/net/ax88796.h b/drivers/net/ax88796.h
index 0e6f8a2..43a1639 100644
--- a/drivers/net/ax88796.h
+++ b/drivers/net/ax88796.h
@@ -78,140 +78,4 @@
#define DP_OUT_DATA(_b_, _d_) *( (vu_short *) ((_b_)+ISA_OFFSET)) = (_d_)
#endif
-
-/*
- * Set 1 bit data
- */
-static void ax88796_bitset(u32 bit)
-{
- /* DATA1 */
- if( bit )
- EEDI_HIGH;
- else
- EEDI_LOW;
-
- EECLK_LOW;
- udelay(1000);
- EECLK_HIGH;
- udelay(1000);
- EEDI_LOW;
-}
-
-/*
- * Get 1 bit data
- */
-static u8 ax88796_bitget(void)
-{
- u8 bit;
-
- EECLK_LOW;
- udelay(1000);
- /* DATA */
- bit = EEDO;
- EECLK_HIGH;
- udelay(1000);
-
- return bit;
-}
-
-/*
- * Send COMMAND to EEPROM
- */
-static void ax88796_eep_cmd(u8 cmd)
-{
- ax88796_bitset(BIT_DUMMY);
- switch(cmd){
- case MAC_EEP_READ:
- ax88796_bitset(1);
- ax88796_bitset(1);
- ax88796_bitset(0);
- break;
-
- case MAC_EEP_WRITE:
- ax88796_bitset(1);
- ax88796_bitset(0);
- ax88796_bitset(1);
- break;
-
- case MAC_EEP_ERACE:
- ax88796_bitset(1);
- ax88796_bitset(1);
- ax88796_bitset(1);
- break;
-
- case MAC_EEP_EWEN:
- ax88796_bitset(1);
- ax88796_bitset(0);
- ax88796_bitset(0);
- break;
-
- case MAC_EEP_EWDS:
- ax88796_bitset(1);
- ax88796_bitset(0);
- ax88796_bitset(0);
- break;
- default:
- break;
- }
-}
-
-static void ax88796_eep_setaddr(u16 addr)
-{
- int i ;
- for( i = 7 ; i >= 0 ; i-- )
- ax88796_bitset(addr & (1 << i));
-}
-
-/*
- * Get data from EEPROM
- */
-static u16 ax88796_eep_getdata(void)
-{
- ushort data = 0;
- int i;
-
- ax88796_bitget(); /* DUMMY */
- for( i = 0 ; i < 16 ; i++ ){
- data <<= 1;
- data |= ax88796_bitget();
- }
- return data;
-}
-
-static void ax88796_mac_read(u8 *buff)
-{
- int i ;
- u16 data, addr = 0;
-
- for( i = 0 ; i < 3; i++ )
- {
- EECS_HIGH;
- EEDI_LOW;
- udelay(1000);
- /* READ COMMAND */
- ax88796_eep_cmd(MAC_EEP_READ);
- /* ADDRESS */
- ax88796_eep_setaddr(addr++);
- /* GET DATA */
- data = ax88796_eep_getdata();
- *buff++ = (uchar)(data & 0xff);
- *buff++ = (uchar)((data >> 8) & 0xff);
- EECLK_LOW;
- EEDI_LOW;
- EECS_LOW;
- }
-}
-
-int get_prom(u8* mac_addr)
-{
- u8 prom[32];
- int i;
-
- ax88796_mac_read(prom);
- for (i = 0; i < 6; i++){
- mac_addr[i] = prom[i];
- }
- return 1;
-}
-
#endif /* __DRIVERS_AX88796L_H__ */