M port/devbit.c => port/devbit.c +2 -0
@@ 1058,6 1058,8 @@ bitcompact(void)
p1 += 2 + p1[0];
}
bit.wfree = p1;
+ if(p1<bit.words || p1>=bit.words+bit.nwords)
+ panic("bitcompact");
qunlock(&bitlock);
}
M power/devhotrod.c => power/devhotrod.c +1 -1
@@ 13,6 13,7 @@
/*
* If defined, ENABMEMTEST causes memory test to be run at device open
*/
+#define ENABMEMTEST
#ifdef ENABMEMTEST
void mem(Hot*, ulong*, ulong);
#define NTESTBUF 256
@@ 21,7 22,6 @@ ulong testbuf[NTESTBUF];
/*
* If defined, ENABBUSTEST causes bus error diagnostic to be run at device open
*/
-#define ENABBUSTEST
/*
* If 1, ENABCKSUM causes data transfers to have checksums
A ss/arp.h => ss/arp.h +40 -0
@@ 0,0 1,40 @@
+typedef struct Arppkt Arppkt;
+typedef struct Arpentry Arpentry;
+typedef struct Arpstats Arpstats;
+
+/* Format of ethernet arp request */
+struct Arppkt {
+ uchar d[6];
+ uchar s[6];
+ uchar type[2];
+ uchar hrd[2];
+ uchar pro[2];
+ uchar hln;
+ uchar pln;
+ uchar op[2];
+ uchar sha[6];
+ uchar spa[4];
+ uchar tha[6];
+ uchar tpa[4];
+ };
+
+/* Format of request from starp to user level arpd */
+struct Arpentry {
+ uchar etaddr[6];
+ uchar ipaddr[4];
+ };
+
+/* Arp cache statistics */
+struct Arpstats {
+ int hit;
+ int miss;
+ int failed;
+ };
+
+#define ET_ARP 0x0806
+#define ET_RARP 0x8035
+
+#define ARP_REQUEST 1
+#define ARP_REPLY 2
+#define RARP_REQUEST 3
+#define RARP_REPLY 4