Wednesday, July 25, 2012

What is softc in the networking driver?

Softc is a misc state maintained in a device driver. You are likely to come across this term when reading some structure definition. For example: ath_softc is used in the ath9k  wireless driver.

Under the NetBSD model and most Linux systems, a softc based structure should contain the first element as the device for which this state is maintained. For example in the ath_softc structure the first element is the
struct ieee80211_hw *hw for which the state is maintained. Some functions which use this structure:

int ath_startrecv(struct ath_softc *sc);
bool ath_stoprecv(struct ath_softc *sc);
void ath_flushrecv(struct ath_softc *sc);
u32 ath_calcrxfilter(struct ath_softc *sc);
int ath_rx_init(struct ath_softc *sc, int nbufs);
void ath_rx_cleanup(struct ath_softc *sc);
int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp);

What is a MLME? Is it present in a FullMAC driver?

MLME stands for Medium access control (MAC) sublayer management entity. This is the entity where the MAC state machines reside. Examples of states a MLME may assist in reaching:
  • Authenticate
  • Deauthenticate
  • Associate
  • Disassociate
  • Reassociate
  • Beacon
  • Probe
  • Timing Synchronization Function (TSF)
In the ath5k and ath9k drivers, the mac80211's MLME management implementation is currently handled by net/mac80211/ieee80211_sta.c. This handles only the STA MLME