ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/include/ether.h
(Generate patch)

Comparing SheepShaver/src/include/ether.h (file contents):
Revision 1.1.1.1 by cebix, 2002-02-04T16:58:13Z vs.
Revision 1.5 by gbeauche, 2008-01-01T09:47:39Z

# Line 1 | Line 1
1   /*
2   *  ether.h - SheepShaver Ethernet Device Driver
3   *
4 < *  SheepShaver (C) 1997-2002 Marc Hellwig and Christian Bauer
4 > *  SheepShaver (C) 1997-2008 Marc Hellwig and Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 39 | Line 39 | extern void EtherExit(void);
39  
40   extern void EtherIRQ(void);
41  
42 < extern void AO_get_ethernet_address(uint8 *addr);
43 < extern void AO_enable_multicast(uint8 *addr);
44 < extern void AO_disable_multicast(uint8 *addr);
45 < extern void AO_transmit_packet(mblk_t *mp);
42 > extern void AO_get_ethernet_address(uint32 addr);
43 > extern void AO_enable_multicast(uint32 addr);
44 > extern void AO_disable_multicast(uint32 addr);
45 > extern void AO_transmit_packet(uint32 mp);
46  
47   extern mblk_t *allocb(size_t size, int pri);
48   extern void OTEnterInterrupt(void);
49   extern void OTLeaveInterrupt(void);
50  
51 + extern void ether_dispatch_packet(uint32 p, uint32 length);
52   extern void ether_packet_received(mblk_t *mp);
53  
54   extern bool ether_driver_opened;
55  
56 + // Ethernet packet allocator (optimized for 32-bit platforms in real addressing mode)
57 + class EthernetPacket {
58 + #if SIZEOF_VOID_P == 4 && REAL_ADDRESSING
59 +        uint8 packet[1516];
60 + public:
61 +        uint32 addr(void) const { return (uint32)packet; }
62 + #else
63 +        uint32 packet;
64 + public:
65 +        EthernetPacket();
66 +        ~EthernetPacket();
67 +        uint32 addr(void) const { return packet; }
68 + #endif
69 + };
70 +
71 + // Copy packet data from message block to linear buffer (must hold at
72 + // least 1514 bytes), returns packet length
73 + static inline int ether_msgb_to_buffer(uint32 mp, uint8 *p)
74 + {
75 +        int len = 0;
76 +        while (mp) {
77 +                uint32 size = ReadMacInt32(mp + 16) - ReadMacInt32(mp + 12);
78 +                Mac2Host_memcpy(p, ReadMacInt32(mp + 12), size);
79 +                len += size;
80 +                p += size;
81 +                mp = ReadMacInt32(mp + 8);
82 +        }
83 +        return len;
84 + }
85 +
86   extern int32 num_wput;
87   extern int32 num_error_acks;
88   extern int32 num_tx_packets;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines