lan91c96.c (6a40ef62c4300e9f606deef0a4618cbc4b514a51) lan91c96.c (1b769881750030f10743808b9d6013e11f559350)
1/*------------------------------------------------------------------------
2 * lan91c96.c
3 * This is a driver for SMSC's LAN91C96 single-chip Ethernet device, based
4 * on the SMC91111 driver from U-boot.
5 *
6 * (C) Copyright 2002
7 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
8 * Rolf Offermanns <rof@sysgo.de>

--- 22 unchanged lines hidden (view full) ---

31 *
32 *
33 * "Features" of the SMC chip:
34 * 6144 byte packet memory. ( for the 91C96 )
35 * EEPROM for configuration
36 * AUI/TP selection ( mine has 10Base2/10BaseT select )
37 *
38 * Arguments:
1/*------------------------------------------------------------------------
2 * lan91c96.c
3 * This is a driver for SMSC's LAN91C96 single-chip Ethernet device, based
4 * on the SMC91111 driver from U-boot.
5 *
6 * (C) Copyright 2002
7 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
8 * Rolf Offermanns <rof@sysgo.de>

--- 22 unchanged lines hidden (view full) ---

31 *
32 *
33 * "Features" of the SMC chip:
34 * 6144 byte packet memory. ( for the 91C96 )
35 * EEPROM for configuration
36 * AUI/TP selection ( mine has 10Base2/10BaseT select )
37 *
38 * Arguments:
39 * io = for the base address
39 * io = for the base address
40 * irq = for the IRQ
41 *
42 * author:
40 * irq = for the IRQ
41 *
42 * author:
43 * Erik Stahlman ( erik@vt.edu )
44 * Daris A Nevil ( dnevil@snmc.com )
43 * Erik Stahlman ( erik@vt.edu )
44 * Daris A Nevil ( dnevil@snmc.com )
45 *
46 *
47 * Hardware multicast code from Peter Cammaert ( pc@denkart.be )
48 *
49 * Sources:
50 * o SMSC LAN91C96 databook (www.smsc.com)
51 * o smc91111.c (u-boot driver)
52 * o smc9194.c (linux kernel driver)
53 * o lan91c96.c (Intel Diagnostic Manager driver)
54 *
55 * History:
45 *
46 *
47 * Hardware multicast code from Peter Cammaert ( pc@denkart.be )
48 *
49 * Sources:
50 * o SMSC LAN91C96 databook (www.smsc.com)
51 * o smc91111.c (u-boot driver)
52 * o smc9194.c (linux kernel driver)
53 * o lan91c96.c (Intel Diagnostic Manager driver)
54 *
55 * History:
56 * 04/30/03 Mathijs Haarman Modified smc91111.c (u-boot version)
56 * 04/30/03 Mathijs Haarman Modified smc91111.c (u-boot version)
57 * for lan91c96
58 *---------------------------------------------------------------------------
59 */
60
61#include <common.h>
62#include <command.h>
63#include "lan91c96.h"
64#include <net.h>

--- 226 unchanged lines hidden (view full) ---

291 return 1;
292 else
293 return 0;
294}
295
296/*
297 * Function: smc_reset( void )
298 * Purpose:
57 * for lan91c96
58 *---------------------------------------------------------------------------
59 */
60
61#include <common.h>
62#include <command.h>
63#include "lan91c96.h"
64#include <net.h>

--- 226 unchanged lines hidden (view full) ---

291 return 1;
292 else
293 return 0;
294}
295
296/*
297 * Function: smc_reset( void )
298 * Purpose:
299 * This sets the SMC91111 chip to its normal state, hopefully from whatever
300 * mess that any other DOS driver has put it in.
299 * This sets the SMC91111 chip to its normal state, hopefully from whatever
300 * mess that any other DOS driver has put it in.
301 *
302 * Maybe I should reset more registers to defaults in here? SOFTRST should
303 * do that for me.
304 *
305 * Method:
306 * 1. send a SOFT RESET
307 * 2. wait for it to finish
308 * 3. enable autorelease mode

--- 83 unchanged lines hidden (view full) ---

392
393
394/*
395 * Function: smc_hardware_send_packet(struct net_device * )
396 * Purpose:
397 * This sends the actual packet to the SMC9xxx chip.
398 *
399 * Algorithm:
301 *
302 * Maybe I should reset more registers to defaults in here? SOFTRST should
303 * do that for me.
304 *
305 * Method:
306 * 1. send a SOFT RESET
307 * 2. wait for it to finish
308 * 3. enable autorelease mode

--- 83 unchanged lines hidden (view full) ---

392
393
394/*
395 * Function: smc_hardware_send_packet(struct net_device * )
396 * Purpose:
397 * This sends the actual packet to the SMC9xxx chip.
398 *
399 * Algorithm:
400 * First, see if a saved_skb is available.
400 * First, see if a saved_skb is available.
401 * ( this should NOT be called if there is no 'saved_skb'
402 * Now, find the packet number that the chip allocated
403 * Point the data pointers at it in memory
404 * Set the length word in the chip's memory
405 * Dump the packet to chip memory
406 * Check if a last byte is needed ( odd length packet )
407 * if so, set the control flag right
401 * ( this should NOT be called if there is no 'saved_skb'
402 * Now, find the packet number that the chip allocated
403 * Point the data pointers at it in memory
404 * Set the length word in the chip's memory
405 * Dump the packet to chip memory
406 * Check if a last byte is needed ( odd length packet )
407 * if so, set the control flag right
408 * Tell the card to send it
408 * Tell the card to send it
409 * Enable the transmit interrupt, so I know if it failed
409 * Enable the transmit interrupt, so I know if it failed
410 * Free the kernel data if I actually sent it.
410 * Free the kernel data if I actually sent it.
411 */
412static int smc_send_packet (volatile void *packet, int packet_length)
413{
414 byte packet_no;
415 unsigned long ioaddr;
416 byte *buf;
417 int length;
418 int numPages;

--- 441 unchanged lines hidden (view full) ---

860 if ((status_test & 0xFF00) != 0x3300) {
861 printf ("Failed to initialize ethernetchip\n");
862 return 1;
863 }
864 return 0;
865}
866#endif /* 0 */
867
411 */
412static int smc_send_packet (volatile void *packet, int packet_length)
413{
414 byte packet_no;
415 unsigned long ioaddr;
416 byte *buf;
417 int length;
418 int numPages;

--- 441 unchanged lines hidden (view full) ---

860 if ((status_test & 0xFF00) != 0x3300) {
861 printf ("Failed to initialize ethernetchip\n");
862 return 1;
863 }
864 return 0;
865}
866#endif /* 0 */
867
868#endif /* COMMANDS & CFG_NET */
868#endif /* CONFIG_CMD_NET */
869
870
871/* smc_get_ethaddr (bd_t * bd)
872 *
873 * This checks both the environment and the ROM for an ethernet address. If
874 * found, the environment takes precedence.
875 */
876

--- 91 unchanged lines hidden ---
869
870
871/* smc_get_ethaddr (bd_t * bd)
872 *
873 * This checks both the environment and the ROM for an ethernet address. If
874 * found, the environment takes precedence.
875 */
876

--- 91 unchanged lines hidden ---