NOTE: this page is for archival only, see the note at the end of the page.

TableOfContents()

mainline issues

mac80211

  • hide (or get rid of) master dev to have stable userland interface
  • compat: handle reassociation when the sta is out of range for a moment and then comes back

mac80211

Most important issues

  • Need to stop TX/RX when a radar is detected for the duration of scan for a new channel. (Partially solved by PRISM2_PARAM_RADIO_ENABLED.) [reported by Jouni Malinen]

Other issues

  • Add a ieee80211_resume(hw) function that drivers can call when they resume. It should

    • call set_key for each key that was uploaded to hardware
    • reconfigure hardware (channel etc)
    • ...?

scanning

core

misc

  • Export information about softmac/fullmac type of the hardware to userspace. [suggested by Jouni Malinen] (maybe export capabilities instead?)
  • Easier handling of configuration requests (ieee80211_hw->config()). In the current implementation, driver has no way to find out which parameter is being set; setting all parameters on every call to config() is obviously not a good idea.

  • struct ieee80211_tx_queue_stats is strange (why not to use ieee80211_tx_queue_stats_data directly?)
  • Kicking DMA on the last fragment only (?) [suggested by Ivo van Doorn]
  • Why there is a beacon_update() handler? Maybe it would be easier for the driver to be allowed to call ieee80211_beacon_get() even in IBSS mode.
  • Add functions that will tell the driver which rates and modulations are allowed. Some cards need to tell their firmware about it.
  • Move ETH_P_PAE from ieee80211_i.h to linux/if_ether.h.
  • Make IEEE80211_FRAGMENT_MAX configurable (preferably at run-time).
  • Alter LL_MAX_HEADER constant.
  • Fix the race in PS status update (see TODO in ieee80211_tx_status()).
  • Sort out function definitions in ieee80211_i.h (they are at two different places in the file now).
  • ieee80211_if_conf should be a part of ieee80211_sub_if_data
  • In case of STA or IBSS, after a change of SSID or generic_element, ieee80211_if_conf should be called.
  • #ifdef out wpa_test variable (but do not add #ifdefs into ifs).
  • Try to switch from sw crypto to hw when there was no more room for STA keys in the hardware and one STA disassociates (so there is possibly a room now). [suggested by Johannes and Michael]

qdisc bugs

  • can't put the ieee80211 qdisc back on while the device is running

From Patrick McHardy:

  • classify_1d doesn't care about tc_classify return values. tc_classify may decide to steal packets, drop them, etc. In case of stolen packets this causes use-after-free, otherwise just malfunctions.
  • classify_1d returns res.class if it is != -1, which can never happen (except with an empty classifier list because of the explicit initialization, but you should check the return code) since ->get() and ->bind_tcf() both return 0 for invalid classes and the classid otherwise. There's also an off-by-one, classids start at one, so it should return res.class - 1 (or better res.classid - 1, which is meant to be a numerical identifier).

Considering that it is possibly and may be desirable to attach a different qdisc than the built-in multiband qdisc, it might also make sense to split the 80211 specific classification in a seperate classifier module to allow simple classification of management traffic with other qdiscs.

Library functions we should add

  • PLCP Length calculation
  • Functions to fill modes/rates for B, BG, and ABG.
  • TKIP key mixing functions (work in progress by mbuesch)

Optimizations

  • ieee80211_get_hdrlen and ieee80211_is_eapol are called very often.
  • Recognition of device incoming frame belongs to can be made much smarter and faster.
  • When one packet is dumped through several interfaces, some operations can be performed just once (e.g. searching for the key, sometimes decrypting, defragmentation etc.).
  • Move fragmentation etc. into 802.11 qdisc. [suggested by Simon Barber]
  • dynamically registered tx/rx handlers
  • think about handling probe responses in firmware like b43 can. This requires telling hostapd that it shouldn't be replying to probe requests and having it give the appropriate info to the kernel [Johannes/Michael]

possibly in the future

  • Add #ifdef's for not compiling AP stuff. [suggested by Jouni Malinen]

Coding style

  • remove forward declarations

userspace mlme

Goal

The end goal is to have a communication path as follows:

Legend:

nm:        Network Manager               - GUI based utility
iw:        Wireless-tool replacement     - Console based utility
           (these are prototypical, there will be more tools)
nl80211:   netlink-based wire-format for wireless configuration
umlme:     Userspace MLME (wpa_supplicant)
fullmac:   non-mac80211 full-mac hardware driver
cfg80211:  kernel wireless config agent speaking to drivers/mac80211 and userspace
---

Communication with userspace

  Hardware and kernel/hardware MLME configuration:
                           nl80211
    { nm | iw | umlme } -------------> { cfg80211 }


  Userspace MLME configuration (alternative 1)
                   nl80211                     nl80211
    { nm | iw } -------------> { cfg80211 } -------------> { umlme }

  Userspace MLME configuration (alternative 2)
                   nl80211
    { nm | iw } -------------> { umlme }

  Userspace MLME configuration (alternative 3)
                  socket (*)
    { nm | iw } -------------> { umlme }

    (*) Unix socket is just one alternative, could be a FIFO too
        or a TCP socket or a d-bus based protocol or ...

Communication inside the kernel

                 cfg80211_ops
    { cfg80211 } -------------> { fullmac | mac80211 }

Current status

wpa_supplicant has a current userspace MLME (umlme). The umlme uses prism2 private wireless-extension ioctls to indicate to mac8021 to create a management interface for the driver. This should be moved to using nl80211. After that is done it creates a socket and binds it to the management interface. Finally it registers wpa_driver_wext_mlme_read() for events. This is all done in src/drivers/driver_wext.c in wpa_driver_wext_open_mlme() shown below. MLME frames are sent to the management interface this way.

{{{#FORMAT c static int wpa_driver_wext_open_mlme(struct wpa_driver_wext_data *drv) {

  • int flags, ifindex, s; struct sockaddr_ll addr; struct ifreq ifr;

    if (wpa_driver_prism2_param_set(drv, PRISM2_PARAM_USER_SPACE_MLME, 1) <

    • 0) {
      • wpa_printf(MSG_ERROR, "WEXT: Failed to configure driver to "
        • "use user space MLME");
        return -1;
    }

    if (wpa_driver_prism2_param_set(drv, PRISM2_PARAM_MGMT_IF, 1) < 0) {

    • wpa_printf(MSG_ERROR, "WEXT: Failed to add management "
      • "interface for user space MLME");
      return -1;
    } ifindex = wpa_driver_prism2_param_get(drv, PRISM2_PARAM_MGMT_IF);

    if (ifindex <= 0) {

    • wpa_printf(MSG_ERROR, "WEXT: MLME management device not "
      • "found");
      return -1;
    }

    os_memset(&ifr, 0, sizeof(ifr)); ifr.ifr_ifindex = ifindex; if (ioctl(drv->ioctl_sock, SIOCGIFNAME, &ifr) != 0) {

    • perror("ioctl(SIOCGIFNAME)"); return -1;
    }

    os_strlcpy(drv->mlmedev, ifr.ifr_name, sizeof(drv->mlmedev)); wpa_printf(MSG_DEBUG, "WEXT: MLME management device '%s'",

    • drv->mlmedev);

    if (wpa_driver_wext_get_ifflags_ifname(drv, drv->mlmedev, &flags) != 0

    • ||

      wpa_driver_wext_set_ifflags_ifname(drv, drv->mlmedev,

      • flags | IFF_UP) != 0) {
      • wpa_printf(MSG_ERROR, "WEXT: Could not set interface "
        • "'%s' UP", drv->mlmedev);

        return -1;
    } s = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));

    if (s < 0) {

    • perror("socket[PF_PACKET,SOCK_RAW]"); return -1;
    }

    os_memset(&addr, 0, sizeof(addr)); addr.sll_family = AF_PACKET; addr.sll_ifindex = ifindex;

    if (bind(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) {

    • perror("bind(MLME)"); return -1;
    } if (eloop_register_read_sock(s, wpa_driver_wext_mlme_read, drv, NULL)) {
    • wpa_printf(MSG_ERROR, "WEXT: Could not register MLME read "
      • "socket");
      close(s); return -1;
    } return s;

} }}}


This is a static dump of the wiki, taken after locking it in January 2015. The new wiki is at https://wireless.wiki.kernel.org/.
versions of this page: last, v359, v358, v357, v356, v355, v354, v353, v352, v351, v350, v349, v348, v347, v346, v345, v344, v343, v342, v341, v340, v339, v338, v337, v336, v335, v334, v333, v332, v331, v330, v329, v328, v327, v326, v325, v324, v323, v322, v321, v320, v319, v318, v317, v316, v315, v314, v313, v312, v311, v310, v309, v308, v307, v306, v305, v304, v303, v302, v301, v300, v299, v298, v297, v296, v295, v294, v293, v292, v291, v290, v289, v288, v287, v286, v285, v284, v283, v282, v281, v280, v279, v278, v277, v276, v275, v274, v273, v272, v271, v270, v269, v268, v267, v266, v265, v264, v263, v262, v261, v260, v259, v258, v257, v256, v255, v254, v253, v252, v251, v250, v249, v248, v247, v246, v245, v244, v243, v242, v241, v240, v239, v238, v237, v236, v235, v234, v233, v232, v231, v230, v229, v228, v227, v226, v225, v224, v223, v222, v221, v220, v219, v218, v217, v216, v215, v214, v213, v212, v211, v210, v209, v208, v207, v206, v205, v204, v203, v202, v201, v200, v199, v198, v197, v196, v195, v194, v193, v192, v191, v190, v189, v188, v187, v186, v185, v184, v183, v182, v181, v180, v179, v178, v177, v176, v175, v174, v173, v172, v171, v170, v169, v168, v167, v166, v165, v164, v163, v162, v161, v160, v159, v158, v157, v156, v155, v154, v153, v152, v151, v150, v149, v148, v147, v146, v145, v144, v143, v142, v141, v140, v139, v138, v137, v136, v135, v134, v133, v132, v131, v130, v129, v128, v127, v126, v125, v124, v123, v122, v121, v120, v119, v118, v117, v116, v115, v114, v113, v112, v111, v110, v109, v108, v107, v106, v105, v104, v103, v102, v101, v100, v99, v98, v97, v96, v95, v94, v93, v92, v91, v90, v89, v88, v87, v86, v85, v84, v83, v82, v81, v80, v79, v78, v77, v76, v75, v74, v73, v72, v71, v70, v69, v68, v67, v66, v65, v64, v63, v62, v61, v60, v59, v58, v57, v56, v55, v54, v53, v52, v51, v50, v49, v48, v47, v46, v45, v44, v43, v42, v41, v40, v39, v38, v37, v36, v35, v34, v33, v32, v31, v30, v29, v28, v27, v26, v25, v24, v23, v22, v21, v20, v19, v18, v17, v16, v15, v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1