One gotcha with this is I don't know if the if_link_state_change() calls
are correct, so need further review.
Details
- Reviewers
wma zlei mw - Group Reviewers
network - Commits
- rGf46a05b5d3db: al_eth: Finish conversion to IfAPI
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/dev/al_eth/al_eth.c | ||
---|---|---|
341–342 | There's currently no way to just set the link state. I could add the API, but it would be used only by this driver. The initial state is LINK_STATE_UNKNOWN. @wma would it be possible for you to test the driver with the if_link_state setting removed? No other driver explicitly sets the link state. |
Generally looks good to me, except the concurrency of device_detach and miibus_statchg event.
sys/dev/al_eth/al_eth.c | ||
---|---|---|
341–342 | I do not see any logic checking adapter->netdev->if_link_state. So an initial state LINK_STATE_UNKNOWN should be OK. | |
3519 | I'm a little worried about this LINK_STATE_DOWN event. if_link_state_change(struct ifnet *ifp, int link_state) { /* Return if state hasn't changed. */ if (ifp->if_link_state == link_state) return; ifp->if_link_state = link_state; /* XXXGL: reference ifp? */ taskqueue_enqueue(taskqueue_swi, &ifp->if_linktask); } I'm not familiar with MII bus. |
sys/dev/al_eth/al_eth.c | ||
---|---|---|
3519 | I think al_detach() probably needs a bus_generic_detach() to detach its child miibus. This seems common across at least several drivers I've looked at. |