tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Another update for axe(4)

On Sun, 13 Jun 2010, Izumi Tsutsui wrote:

+       memcpy(&sc->init_eaddr, &eaddr, sizeof(sc->init_eaddr));

Do we really have to save MAC address into softc?
Can't we refer it by "CLLADDR(ifp->if_sadl)"?

I'll be totally honest here - I really haven't dived very deeply into
the network interface architecture at all.  So I have no idea if your
suggestion would work or not.  Where does ifp->if_sadl get stored?

I think ifp is initialized once ether_ifattach() is called
and we can always pull ifp in the drive via &sc->ethercom.ec_if.
(USB drivers seem to use GET_IFP(sc) macro)

axe_init() is called only from ioctls so I think it will work.
(otherwise OpenBSD's ac_enaddr won't work either)

OK, I changed it and it still works. (BTW, I need to make it __UNCONST() for passing it as arg to axe_cmd() routine.)

-                       c->axe_buf = usbd_alloc_buffer(c->axe_xfer, AXE_BUFSZ);
+                       c->axe_buf = usbd_alloc_buffer(c->axe_xfer,
+                                                      sc->axe_bufsz);


:)  Fixed (although I still prefer my own format here!)

There are some more similar lines.

I think I have found all of them.

+                       if ((pktlen % 2) != 0)
+                               pktlen++;



Looks wrong arg order.

"pkglen = roundup2(pktlen, sizeof(uint16_t));"
might be better as roundup2(9) man page says :-)

Ooops!  Fixed.

| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at |
| Kernel Developer |                          | pgoyette at  |

Home | Main Index | Thread Index | Old Index