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