def getOSWirelessConfig(update):
    """
    Read settings from networkInterfaces for wireless interfaces.
    Store wireless configuration settings in osWirelessConfig.
    """
    interfaces = update.cache_get('networkInterfaces')
    if interfaces is None:
        return
    wifiIfaces = list()
    for iface in interfaces:
        if not iface['type'].startswith('wifi'):
            continue
        config = {'type': 'wifi-iface'}
        options = {'device': iface['device'], 'network': iface[
            'externalIntf'], 'mode': iface.get('mode', 'ap')}
        options.update(iface['wireless'])
        if 'ssid' in iface:
            options['ssid'] = iface['ssid']
        if 'encryption' in iface:
            options['encryption'] = iface['encryption']
        if 'key' in iface:
            options['key'] = iface['key']
        wifiIfaces.append((config, options))
    update.cache_set('osWirelessConfig', wifiIfaces)
