def _generate_wireless_settings_data(settings):
    """Generates a wireless settings data array to push to the
    router from the given wireless settings."""
    settings.ensure_valid()
    data = {'ssid1': settings.ssid, 'channel': settings.channel, 'Save': 'Save'
        }
    if settings.is_enabled:
        data['ap'] = 1
    if settings.is_broadcasting_ssid:
        data['broadcast'] = 2
    for k in ('region', 'mode', 'chanWidth', 'rate'):
        data[k] = settings.get_internal_param(k)
    merge_with = {'brlssid': '', 'brlbssid': '', 'keytype': 1,
        'wepindexauthtype': 1, 'keytext': ''}
    data = dict(data, **merge_with)
    return data
