28 |
|
|
29 |
|
extern int16 EtherOpen(uint32 pb, uint32 dce); |
30 |
|
extern int16 EtherControl(uint32 pb, uint32 dce); |
31 |
< |
extern void EtherReadPacket(uint8 **src, uint32 &dest, uint32 &len, uint32 &remaining); |
31 |
> |
extern void EtherReadPacket(uint32 &src, uint32 &dest, uint32 &len, uint32 &remaining); |
32 |
|
|
33 |
|
// System specific and internal functions/data |
34 |
|
extern void EtherReset(void); |
44 |
|
extern int16 ether_write(uint32 wds); |
45 |
|
extern bool ether_start_udp_thread(int socket_fd); |
46 |
|
extern void ether_stop_udp_thread(void); |
47 |
< |
extern void ether_udp_read(uint8 *packet, int length, struct sockaddr_in *from); |
47 |
> |
extern void ether_udp_read(uint32 packet, int length, struct sockaddr_in *from); |
48 |
|
|
49 |
|
extern uint8 ether_addr[6]; // Ethernet address (set by ether_init()) |
50 |
|
|
61 |
|
|
62 |
|
extern uint32 ether_data; // Mac address of driver data in MacOS RAM |
63 |
|
|
64 |
+ |
// Ethernet packet allocator (optimized for 32-bit platforms in real addressing mode) |
65 |
+ |
class EthernetPacket { |
66 |
+ |
#if SIZEOF_VOID_P == 4 && REAL_ADDRESSING |
67 |
+ |
uint8 packet[1516]; |
68 |
+ |
public: |
69 |
+ |
uint32 addr(void) const { return (uint32)packet; } |
70 |
+ |
#else |
71 |
+ |
uint32 packet; |
72 |
+ |
public: |
73 |
+ |
EthernetPacket(); |
74 |
+ |
~EthernetPacket(); |
75 |
+ |
uint32 addr(void) const { return packet; } |
76 |
+ |
#endif |
77 |
+ |
}; |
78 |
+ |
|
79 |
|
// Copy packet data from WDS to linear buffer (must hold at least 1514 bytes), |
80 |
|
// returns packet length |
81 |
|
static inline int ether_wds_to_buffer(uint32 wds, uint8 *p) |