21 if((n = read(ep->dfd, b->wp, b->lim - b->base)) < 0){
31 cdctransmit(Dev *ep, Block *b)
36 if(write(ep->dfd, b->rp, n) < 0){
43 * this may not work with all CDC devices. the
44 * linux driver sends one more random byte
45 * instead of a zero byte transaction. maybe we
48 if((n % ep->maxpkt) == 0)
49 write(ep->dfd, "", 0);
62 for(i = 0; i < nelem(ud->ddesc); i++)
63 if((dd = ud->ddesc[i]) != nil){
64 b = (uchar*)&dd->data;
65 if(b[1] == Dfunction && b[2] == Fnether){
66 mac = loaddevstr(d, b[3]);
67 if(mac != nil && strlen(mac) != 12){
72 parseether(macaddr, mac);
75 epreceive = cdcreceive;
76 eptransmit = cdctransmit;