/[grub]/grub/netboot/otulip.c
ViewVC logotype

Diff of /grub/netboot/otulip.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by okuji, Sat Apr 22 01:17:09 2000 UTC revision 1.2 by okuji, Wed Jan 2 21:56:40 2002 UTC
# Line 43  static struct txdesc txd; Line 43  static struct txdesc txd;
43  #define NRXD 4  #define NRXD 4
44  static struct rxdesc rxd[NRXD];  static struct rxdesc rxd[NRXD];
45  static int rxd_tail = 0;  static int rxd_tail = 0;
46  #ifndef USE_INTERNAL_BUFFER  #ifdef  USE_LOWMEM_BUFFER
47  #define rxb ((char *)0x10000 - NRXD * BUFLEN)  #define rxb ((char *)0x10000 - NRXD * BUFLEN)
48  #define txb ((char *)0x10000 - NRXD * BUFLEN - BUFLEN)  #define txb ((char *)0x10000 - NRXD * BUFLEN - BUFLEN)
49  #else  #else
# Line 51  static unsigned char rxb[NRXD * BUFLEN]; Line 51  static unsigned char rxb[NRXD * BUFLEN];
51  static unsigned char txb[BUFLEN];  static unsigned char txb[BUFLEN];
52  #endif  #endif
53    
54  static unsigned char ehdr[ETHER_HDR_SIZE];    /* buffer for ethernet header */  static unsigned char ehdr[ETH_HLEN];    /* buffer for ethernet header */
55    
56  enum tulip_offsets {  enum tulip_offsets {
57          CSR0=0,    CSR1=0x08, CSR2=0x10, CSR3=0x18, CSR4=0x20, CSR5=0x28,          CSR0=0,    CSR1=0x08, CSR2=0x10, CSR3=0x18, CSR4=0x20, CSR5=0x28,
# Line 270  static void tulip_transmit(struct nic *n Line 270  static void tulip_transmit(struct nic *n
270    
271          /* setup ethernet header */          /* setup ethernet header */
272    
273          memcpy(ehdr, d, ETHER_ADDR_SIZE);          memcpy(ehdr, d, ETH_ALEN);
274          memcpy(&ehdr[ETHER_ADDR_SIZE], nic->node_addr, ETHER_ADDR_SIZE);          memcpy(&ehdr[ETH_ALEN], nic->node_addr, ETH_ALEN);
275          ehdr[ETHER_ADDR_SIZE*2] = (t >> 8) & 0xff;          ehdr[ETH_ALEN*2] = (t >> 8) & 0xff;
276          ehdr[ETHER_ADDR_SIZE*2+1] = t & 0xff;          ehdr[ETH_ALEN*2+1] = t & 0xff;
277    
278          /* setup the transmit descriptor */          /* setup the transmit descriptor */
279    
280          memset(&txd, 0, sizeof(struct txdesc));          memset(&txd, 0, sizeof(struct txdesc));
281    
282          txd.buf1addr = &ehdr[0];        /* ethernet header */          txd.buf1addr = &ehdr[0];        /* ethernet header */
283          txd.buf1sz   = ETHER_HDR_SIZE;          txd.buf1sz   = ETH_HLEN;
284    
285          txd.buf2addr = p;               /* packet to transmit */          txd.buf2addr = p;               /* packet to transmit */
286          txd.buf2sz   = s;          txd.buf2sz   = s;
# Line 350  struct nic *otulip_probe(struct nic *nic Line 350  struct nic *otulip_probe(struct nic *nic
350          membase = (unsigned int *)pci->membase;          membase = (unsigned int *)pci->membase;
351    
352          /* wakeup chip */          /* wakeup chip */
353          pcibios_write_config_dword(0,pci->devfn,0x40,0x00000000);          pcibios_write_config_dword(pci->bus,pci->devfn,0x40,0x00000000);
354    
355          /* Stop the chip's Tx and Rx processes. */          /* Stop the chip's Tx and Rx processes. */
356          /* outl(inl(ioaddr + CSR6) & ~0x2002, ioaddr + CSR6); */          /* outl(inl(ioaddr + CSR6) & ~0x2002, ioaddr + CSR6); */
# Line 359  struct nic *otulip_probe(struct nic *nic Line 359  struct nic *otulip_probe(struct nic *nic
359    
360          srom_read();          srom_read();
361    
362          for (i=0; i < 6; i++)          for (i=0; i < ETH_ALEN; i++)
363                  nic->node_addr[i] = srom[20+i];                  nic->node_addr[i] = srom[20+i];
364    
365          printf("Tulip %b:%b:%b:%b:%b:%b at ioaddr 0x%x\n",          printf("Tulip %! at ioaddr %#hX\n", nic->node_addr, ioaddr);
                 srom[20],srom[21],srom[22],srom[23],srom[24],srom[25],  
                 ioaddr);  
366    
367          tulip_reset(nic);          tulip_reset(nic);
368    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26