18 cdcread(Dev *ep, uchar *p, int n)
20 return read(ep->dfd, p, n);
24 cdcwrite(Dev *ep, uchar *p, int n)
26 if(write(ep->dfd, p, n) < 0){
27 fprint(2, "cdcwrite: %r\n");
30 * this may not work with all CDC devices. the
31 * linux driver sends one more random byte
32 * instead of a zero byte transaction. maybe we
35 if(n % ep->maxpkt == 0)
36 write(ep->dfd, "", 0);
49 for(i = 0; i < nelem(ud->ddesc); i++)
50 if((dd = ud->ddesc[i]) != nil){
51 b = (uchar*)&dd->data;
52 if(b[1] == Dfunction && b[2] == Fnether){
53 mac = loaddevstr(d, b[3]);
54 if(mac != nil && strlen(mac) != 12){
59 parseether(macaddr, mac);