From b1426a23c685ce07995988682b5421556f104367 Mon Sep 17 00:00:00 2001 From: RISCi_ATOM Date: Thu, 23 Mar 2017 18:03:15 -0400 Subject: [PATCH] Fresh pull from upstream 17.01 branch --- Makefile | 2 +- config/Config-build.in | 14 +- config/Config-devel.in | 2 +- config/Config-images.in | 1 - config/Config-kernel.in | 2 +- include/autotools.mk | 4 +- include/cmake.mk | 4 + include/download.mk | 3 - include/feeds.mk | 2 +- include/host-build.mk | 9 +- include/image-commands.mk | 2 +- include/image.mk | 16 +- include/kernel-build.mk | 2 +- include/kernel-version.mk | 6 +- include/package-ipkg.mk | 2 + include/rootfs.mk | 10 +- include/target.mk | 11 +- package/base-files/Makefile | 5 +- package/base-files/files/etc/init.d/system | 2 +- .../base-files/files/etc/iproute2/rt_protos | 18 + package/base-files/files/etc/openwrt_release | 1 + .../files/etc/uci-defaults/13_fix_group_user | 2 +- .../base-files/files/lib/preinit/10_sysinfo | 2 +- package/base-files/files/sbin/wifi | 12 +- package/base-files/files/usr/lib/os-release | 1 + package/base-files/image-config.in | 6 +- package/boot/apex/Makefile | 62 + .../boot/apex/patches/001-compile_fix.patch | 20 + .../100-openwrt_nslu2_armeb_config.patch | 23 + .../120-openwrt_nslu2_16mb_armeb_config.patch | 23 + .../140-openwrt_fsg3_armeb_config.patch | 23 + .../apex/patches/150-limit_ram_to_64mb.patch | 22 + .../160-openwrt_nas100d_armeb_config.patch | 20 + package/boot/fconfig/Makefile | 2 +- package/boot/grub2/Makefile | 14 +- .../grub2/patches/100-grub_setup_root.patch | 16 +- .../boot/grub2/patches/100-musl-compat.patch | 26 - ...-disable-gettext-check-macro-version.patch | 13 + .../grub2/patches/210-fix_serial_rtscts.patch | 14 - package/boot/kexec-tools/Config.in | 10 - package/boot/kexec-tools/Makefile | 11 +- .../0001-Fix-zlib-lzma-decompression.patch | 171 -- ...ly-necessary-quotes-to-result-of-mac.patch | 52 - ...r-warning-on-printing-64-bit-integer.patch | 35 - .../0004-mips-remove-unused-variable.patch | 30 - ...rning-about-implicit-type-conversion.patch | 30 - .../patches/100-format_string_fix.patch | 20 + ...10-fix-vmcore-dmsg-compilation-error.patch | 11 + package/boot/kobs-ng/Makefile | 46 + .../boot/kobs-ng/patches/001-compile.patch | 23 + .../patches/002-add-init-size-param.patch | 45 + .../boot/kobs-ng/patches/003-raw-mode.patch | 45 + .../patches/004-fix-cal_nfc_geometry.patch | 27 + package/boot/rbcfg/Makefile | 47 + package/boot/rbcfg/src/Makefile | 14 + package/boot/rbcfg/src/cyg_crc.h | 109 + package/boot/rbcfg/src/cyg_crc32.c | 172 ++ package/boot/rbcfg/src/main.c | 791 +++++++ package/boot/rbcfg/src/rbcfg.h | 75 + package/boot/yamonenv/Makefile | 4 +- package/kernel/avila-wdt/Makefile | 35 - package/kernel/avila-wdt/src/Makefile | 1 - package/kernel/avila-wdt/src/avila-wdt.c | 231 -- package/kernel/kmod-sched-cake/Makefile | 8 +- package/kernel/linux/modules/can.mk | 2 +- package/kernel/linux/modules/netfilter.mk | 2 +- package/kernel/linux/modules/netsupport.mk | 6 +- package/kernel/linux/modules/nls.mk | 32 + package/kernel/mac80211/Makefile | 6 +- .../files/lib/netifd/wireless/mac80211.sh | 2 +- .../mac80211/files/lib/wifi/mac80211.sh | 2 +- .../patches/002-change_allconfig.patch | 6 +- .../004-fix_duplicate_skcipher_backport.patch | 11 - .../patches/004-kconfig_backport_fix.patch | 28 + .../005-backport_skb_get_hash_perturb.patch | 22 - .../patches/005-revert-devcoredump.patch | 152 ++ .../patches/006-revert-ktime-changes.patch | 20 + .../007-revert-genetlink-changes.patch | 266 +++ .../008-revert-ndo_stats64-cleanup.patch | 20 + .../patches/009-revert-mtu-changes.patch | 338 +++ .../patches/011-backport_strscpy.patch | 43 + .../mac80211/patches/030-rt2x00_options.patch | 47 + .../patches/040-brcmutil_option.patch | 9 + .../patches/060-no_local_ssb_bcma.patch | 4 +- .../mac80211/patches/090-remove-cred.patch | 15 + .../100-remove-cryptoapi-dependencies.patch | 330 ++- .../110-mac80211_keep_keys_on_stop_ap.patch | 2 +- .../130-mac80211-hwsim-hrtimer-clock.patch | 2 +- .../patches/150-disable_addr_notifier.patch | 6 +- .../kernel/mac80211/patches/210-ap_scan.patch | 2 +- ...using-mac80211-intermediate-software.patch | 953 -------- ...-reset-AHB-WMAC-interface-on-AR91xx.patch} | 0 ...hw-issue-external-reset-for-QCA955x.patch} | 51 +- ...tral-scan-enable-bit-on-trigger-for.patch} | 0 ...eriodic-and-nf-calibation-at-the-sa.patch} | 3 +- ...9k-force-rx_clear-when-disabling-rx.patch} | 2 +- ...tries-for-powersave-response-frames.patch} | 14 +- ...rpret-requested-txpower-in-EIRP-dom.patch} | 4 +- ...211-add-hdrlen-to-ieee80211_tx_data.patch} | 22 +- ...0211-add-NEED_ALIGNED4_SKBS-hw-flag.patch} | 36 +- ...-Enable-STBC-and-LDPC-for-VHT-Rates.patch} | 11 +- ...ta-bit-in-PS-buffered-frame-release.patch} | 6 +- ...tially-stale-EOSP-status-bit-in-int.patch} | 2 +- ... 312-ath9k-report-tx-status-on-EOSP.patch} | 0 ...1-Use-rhltable-instead-of-rhashtable.patch | 275 --- ...ix-block-ack-window-tracking-issues.patch} | 16 +- ...equence-number-allocation-regression.patch | 37 - ...me-tx_complete_work-to-hw_check_work.patch | 175 ++ ...-check-if-the-chip-failed-to-wake-up.patch | 30 + ...condition-in-enabling-disabling-IRQs.patch | 197 ++ ...implement-temperature-compensation-s.patch | 101 - ...roducing-a-USB-dependency-in-the-rt2.patch | 73 + ...rcmf_bus_get_memdump-result-for-erro.patch | 52 + ...-up-mismerge-of-ieee80211_tx_dequeue.patch | 35 - ...re-verbose-when-PSM-s-watchdog-fires.patch | 38 + ...hy_read_of_freq_limits-to-respect-li.patch | 44 + ...-merge-two-brcmf_err-macros-into-one.patch | 43 + ...to-C-function-__brcmf_err-for-printi.patch | 69 + ...merge-two-remaining-brcmf_err-macros.patch | 46 + ...extra-memcpy-in-A-MSDU-head-creation.patch | 55 - ...lean-up-and-fix-ath_tx_count_airtime.patch | 107 + .../320-mac80211-fix-A-MSDU-outer-SA-DA.patch | 73 - ...allow-using-AP_LINK_PS-with-mac80211.patch | 28 - .../321-mac80211-fix-CSA-in-IBSS-mode.patch | 34 + ...andle-filtered-frames-within-a-BA-se.patch | 28 + ...211-update-A-MPDU-flag-on-tx-dequeue.patch | 30 - ...0211-remove-bogus-skb-vif-assignment.patch | 29 - ...-MSDU-aggregation-with-fast-xmit-txq.patch | 34 - ...hw_gpio_get-to-return-0-or-1-on-succ.patch | 29 - ...-net-add-ath9k-wireless-device-bindi.patch | 67 - ...er-to-get-the-string-representation-.patch | 42 - ...device-configuration-from-an-OF-node.patch | 85 - ...unlock-rcu-read-when-returning-early.patch | 65 - ...l_ht-move-supported-bitrate-mask-out.patch | 196 -- ...l_ht-move-short-preamble-check-out-o.patch | 70 - ...l_ht-make-att_hist-and-succ_hist-u32.patch | 22 - ...or-MCS-in-ieee80211_duration-before-.patch | 34 - ...instrel-remove-cur_prob-from-debugfs.patch | 192 -- ...80211-minstrel-reduce-MINSTREL_SCALE.patch | 22 - ...l-store-probability-variance-instead.patch | 186 -- ...el-make-prob_ewma-u16-instead-of-u32.patch | 20 - ...l_ht-remove-obsolete-if-for-3-stream.patch | 80 - ...g80211-limit-scan-results-cache-size.patch | 150 -- ...-warning-on-drv_set_key-with-unsuppo.patch | 23 - ...unction-checking-range-fit-to-util.c.patch | 101 - ...ort-ieee80211-freq-limit-DT-property.patch | 211 -- .../patches/400-ath_move_debug_code.patch | 2 +- .../patches/402-ath_regd_optional.patch | 4 +- .../patches/404-regd_no_assoc_hints.patch | 4 +- .../patches/406-ath_relax_default_regd.patch | 2 +- .../410-ath9k_allow_adhoc_and_ap.patch | 4 +- .../440-ath5k_channel_bw_debugfs.patch | 4 +- .../mac80211/patches/501-ath9k_ahb_init.patch | 2 +- .../patches/513-ath9k_add_pci_ids.patch | 2 +- .../522-mac80211_configure_antenna_gain.patch | 38 +- .../patches/530-ath9k_extra_leds.patch | 24 +- .../patches/542-ath9k_debugfs_diag.patch | 6 +- .../patches/543-ath9k_entropy_from_adc.patch | 6 +- ...544-ath9k-ar933x-usb-hang-workaround.patch | 4 +- .../patches/548-ath9k_enable_gpio_chip.patch | 6 +- .../549-ath9k_enable_gpio_buttons.patch | 2 +- ...ne-for-the-EEPROM-eepmisc-endianness.patch | 95 - .../550-ath9k-disable-bands-via-dt.patch | 15 + ...hat-the-AR9003-EEPROM-template-value.patch | 78 - ...atch => 551-ath9k_ubnt_uap_plus_hsr.patch} | 6 +- ...rom_ops-callback-for-retrieving-the-.patch | 117 - ...prom_param-EEP_MINOR_REV-with-get_ee.patch | 117 - ...k-consistently-use-get_eeprom_rev-ah.patch | 342 --- ...EPROM-swapping-check-use-the-eepmisc.patch | 128 -- ...-EEPROM-fields-in-Little-Endian-form.patch | 849 ------- .../557-ath9k-disable-bands-via-dt.patch | 32 - ...to-build-rt2800soc-module-for-RT3883.patch | 30 + ...-rt2800lib-enable-support-for-RT3883.patch | 20 + ...x00-rt2800lib-add-rf_vals-for-RF3853.patch | 112 + ...ib-enable-VCO-calibration-for-RF3853.patch | 28 + ...-add-channel-configuration-function-.patch | 235 ++ ...2x00-rt2800lib-enable-RF3853-support.patch | 20 + ...-add-MAC-register-initialization-for.patch | 62 + ...-fix-rt2800soc_disable_radio-for-RT3.patch | 30 + ...-add-BBP-register-initialization-for.patch | 71 + ...-add-RFCSR-initialization-for-RT3883.patch | 178 ++ ...-use-the-extended-EEPROM-map-for-RT3.patch | 22 + ...ib-force-rf-type-to-RF3853-on-RT3883.patch | 21 + ...-add-channel-configuration-code-for-.patch | 136 ++ ...-fix-txpower_to_dev-function-for-RT3.patch | 30 + ...-use-correct-txpower-calculation-fun.patch | 23 + ...-hardcode-txmixer-gain-values-to-zer.patch | 33 + ...b-use-correct-RT-XWI-size-for-RT3883.patch | 20 + ...-fix-antenna-configuration-for-RT388.patch | 22 + ...-fix-LNA-gain-configuration-for-RT38.patch | 32 + ...0-rt2800lib-fix-VGC-setup-for-RT3883.patch | 44 + ...-fix-EEPROM-LNA-validation-for-RT388.patch | 42 + ...-fix-txpower-compensation-for-RT3883.patch | 22 + ...o-add-a-workaround-for-spurious-TX_F.patch | 136 ++ ...1-rt2x00-introduce-rt2x00_platform_h.patch | 32 + .../602-rt2x00-introduce-rt2x00eeprom.patch | 295 +++ .../603-rt2x00-of_load_eeprom_filename.patch | 33 + ...om-on-SoC-from-a-mtd-device-defines-.patch | 108 + ...isabling_bands_through_platform_data.patch | 47 + ...07-rt2x00-add_platform_data_mac_addr.patch | 26 + ...00-allow_disabling_bands_through_dts.patch | 19 + ...c-loadable-via-OF-on-rt288x-305x-SoC.patch | 33 + ...0-rt2x00-change-led-polarity-from-OF.patch | 40 + .../611-rt2x00-add-AP+STA-support.patch | 11 + ...0-rt2x00-enable-rt2800soc-for-mt7620.patch | 20 + .../621-rt2x00-add-support-for-mt7620.patch | 1200 ++++++++++ ...700-mwl8k-missing-pci-id-for-WNR854T.patch | 10 - .../801-libertas-configure-sysfs-links.patch | 21 + .../802-libertas-set-wireless-macaddr.patch | 11 + ...-remove-extra-regulation-restriction.patch | 27 + ...-register-wiphy-s-during-module_init.patch | 97 + ...und-bug-with-some-inconsistent-BSSes.patch | 50 + ...62-brcmfmac-Disable-power-management.patch | 27 + ...-in-driver-tables-with-country-codes.patch | 60 + ...e-internal-roaming-engine-by-default.patch | 23 + .../kernel/om-watchdog/files/om-watchdog.init | 6 +- package/libs/libpcap/Config.in | 6 +- package/libs/libpcap/Makefile | 7 +- package/libs/libtool/Makefile | 14 +- package/libs/libubox/Makefile | 6 +- package/libs/mbedtls/Makefile | 9 +- package/libs/mbedtls/patches/200-config.patch | 2 +- package/libs/ncurses/Makefile | 2 +- package/libs/openssl/Makefile | 4 +- .../patches/110-optimize-for-size.patch | 2 +- .../libs/openssl/patches/150-no_engines.patch | 2 +- .../patches/160-disable_doc_tests.patch | 6 +- .../patches/190-remove_timestamp_check.patch | 2 +- .../openssl/patches/200-parallel_build.patch | 10 +- package/libs/polarssl/Makefile | 74 - .../polarssl/patches/200-reduce_config.patch | 242 -- ...-erase-on-derived-__base_associative.patch | 40 + package/libs/zlib/Makefile | 6 +- package/luci/.buildpath | 5 - package/luci/.cproject | 221 -- package/luci/.gitignore | 8 - package/luci/.project | 78 - .../luasrc/model/cbi/adblock.lua | 6 +- .../luci-app-adblock/po/pt-br/adblock.po | 92 + .../luci-app-ahcp/po/pt-br/ahcp.po | 10 +- .../luci-app-aria2/po/pt-br/aria2.po | 236 ++ .../luci-app-commands/po/pt-br/commands.po | 27 +- .../luci-app-ddns/po/pt-br/ddns.po | 20 +- .../applications/luci-app-dynapoint/Makefile | 20 + .../luasrc/controller/dynapoint.lua | 9 + .../luasrc/model/cbi/dynapoint.lua | 99 + .../luasrc/view/dynapoint/cbi_checkbox.htm | 6 + .../luasrc/view/dynapoint/cbi_color.htm | 18 + .../luci-app-dynapoint/po/de/dynapoint.po | 106 + .../luci-app-dynapoint/po/ja/dynapoint.po | 108 + .../luci-app-dynapoint/po/pt-br/dynapoint.po | 107 + .../po/templates/dynapoint.pot | 92 + .../root/etc/uci-defaults/40_luci-dynapoint | 13 + .../model/cbi/firewall/forward-details.lua | 6 +- .../model/cbi/firewall/rule-details.lua | 8 +- .../model/cbi/firewall/zone-details.lua | 4 +- .../luasrc/model/cbi/firewall/zones.lua | 1 - .../luci-app-firewall/po/ko/firewall.po | 505 +++++ .../luci-app-firewall/po/pt-br/firewall.po | 41 +- .../luci-app-fwknopd/po/pt-br/fwknopd.po | 116 + .../po/pt-br/meshwizard.po | 11 +- .../po/pt-br/mjpg-streamer.po | 172 ++ .../luci-app-olsr/po/pt-br/olsr.po | 17 +- .../luci-app-openvpn/po/pt-br/openvpn.po | 18 +- .../luci-app-privoxy/po/pt-br/privoxy.po | 516 +++++ .../luci-app-radicale/po/pt-br/radicale.po | 432 ++++ .../po/pt-br/shadowsocks-libev.po | 97 + .../luci-app-shairplay/po/pt-br/shairplay.po | 54 + .../po/pt-br/statistics.po | 93 +- .../luasrc/model/cbi/travelmate.lua | 16 +- .../luci-app-travelmate/po/ja/travelmate.po | 43 +- .../po/pt-br/travelmate.po | 78 + .../po/templates/travelmate.pot | 22 +- .../luci-app-uhttpd/po/pt-br/uhttpd.po | 208 ++ .../luasrc/model/cbi/unbound.lua | 162 +- .../root/etc/uci-defaults/60_luci-unbound | 25 + .../luci-app-vpnbypass/po/pt-br/vpnbypass.po | 55 + .../luci-app-watchcat/po/pt-br/watchcat.po | 13 +- .../po/pt-br/wifischedule.po | 114 + .../applications/luci-app-wol/po/pt-br/wol.po | 16 +- .../collections/luci-ssl-openssl/Makefile | 8 +- package/luci/collections/luci-ssl/Makefile | 2 +- .../contrib/package/freifunk-common/Makefile | 2 +- package/luci/luci.mk | 3 +- .../htdocs/luci-static/resources/cbi.js | 58 +- .../luci-base/luasrc/cbi/datatypes.lua | 110 +- .../luci-base/luasrc/model/network.lua | 7 + .../luci-base/luasrc/view/cbi/mvalue.htm | 2 +- package/luci/modules/luci-base/po/ca/base.po | 109 + package/luci/modules/luci-base/po/cs/base.po | 109 + package/luci/modules/luci-base/po/de/base.po | 109 + package/luci/modules/luci-base/po/el/base.po | 109 + package/luci/modules/luci-base/po/en/base.po | 109 + package/luci/modules/luci-base/po/es/base.po | 109 + package/luci/modules/luci-base/po/fr/base.po | 109 + package/luci/modules/luci-base/po/he/base.po | 109 + package/luci/modules/luci-base/po/hu/base.po | 109 + package/luci/modules/luci-base/po/it/base.po | 109 + package/luci/modules/luci-base/po/ja/base.po | 109 + package/luci/modules/luci-base/po/ko/base.po | 117 +- package/luci/modules/luci-base/po/ms/base.po | 109 + package/luci/modules/luci-base/po/no/base.po | 109 + package/luci/modules/luci-base/po/pl/base.po | 109 + .../luci/modules/luci-base/po/pt-br/base.po | 793 ++++--- package/luci/modules/luci-base/po/pt/base.po | 109 + package/luci/modules/luci-base/po/ro/base.po | 109 + package/luci/modules/luci-base/po/ru/base.po | 109 + package/luci/modules/luci-base/po/sk/base.po | 109 + package/luci/modules/luci-base/po/sv/base.po | 109 + .../modules/luci-base/po/templates/base.pot | 109 + package/luci/modules/luci-base/po/tr/base.po | 109 + package/luci/modules/luci-base/po/uk/base.po | 109 + package/luci/modules/luci-base/po/vi/base.po | 109 + .../luci/modules/luci-base/po/zh-cn/base.po | 109 + .../luci/modules/luci-base/po/zh-tw/base.po | 109 + .../luci/modules/luci-base/src/mkversion.sh | 2 +- .../luasrc/controller/admin/network.lua | 1 + .../luasrc/controller/admin/status.lua | 6 +- .../luasrc/controller/admin/system.lua | 1 + .../luasrc/model/cbi/admin_network/wifi.lua | 138 +- .../model/cbi/admin_network/wifi_add.lua | 2 +- .../luasrc/model/cbi/admin_system/admin.lua | 4 +- .../model/cbi/admin_system/fstab/mount.lua | 10 +- .../luasrc/model/cbi/admin_system/leds.lua | 40 +- .../view/admin_network/iface_overview.htm | 5 + .../view/admin_network/iface_status.htm | 5 + .../luasrc/view/admin_status/connections.htm | 3 +- .../luasrc/view/admin_status/index.htm | 43 +- .../luci-mod-admin-full/src/luci-bwc.c | 4 +- .../cbi/admin_network/proto_wireguard.lua | 12 +- package/network/config/firewall/Makefile | 6 +- package/network/config/netifd/Makefile | 6 +- .../config/netifd/files/etc/init.d/network | 13 +- .../qos-scripts/files/usr/lib/qos/generate.sh | 3 +- package/network/config/swconfig/src/uci.c | 4 +- package/network/ipv6/6in4/files/6in4.sh | 2 +- package/network/ipv6/map/Makefile | 4 +- package/network/ipv6/map/files/map.sh | 12 +- package/network/ipv6/odhcp6c/Makefile | 10 +- package/network/services/dnsmasq/Makefile | 2 +- .../services/dnsmasq/files/dnsmasq.init | 52 +- .../services/dnsmasq/files/dnsmasqsec.hotplug | 6 +- .../patches/000-fix-servfail-handling.patch | 130 ++ package/network/services/dropbear/Makefile | 2 +- .../patches/120-openwrt_options.patch | 5 +- package/network/services/hostapd/Makefile | 12 +- .../hostapd/files/hostapd-full.config | 3 + .../hostapd/files/hostapd-mini.config | 3 + .../hostapd/files/{netifd.sh => hostapd.sh} | 13 +- ...on-between-AssocResp-callback-and-4a.patch | 83 + ...Reassociation-Request-frame-dropping.patch | 36 + ...-clearing-on-Authentication-frame-RX.patch | 40 + ...ibility-to-send-debug-messages-to-sy.patch | 145 ++ .../hostapd/patches/200-multicall.patch | 10 +- .../patches/410-limit_debug_messages.patch | 16 +- .../patches/420-indicate-features.patch | 8 +- .../hostapd/patches/450-scan_wait.patch | 10 +- .../hostapd/patches/600-ubus_support.patch | 4 +- .../hostapd/src/src/utils/build_features.h | 16 +- package/network/services/odhcpd/Makefile | 12 +- package/network/services/openvpn/Makefile | 7 +- .../services/openvpn/files/openvpn.init | 43 +- package/network/services/ppp/Makefile | 21 +- .../services/ppp/files/lib/netifd/ppp6-up | 2 + package/network/services/ppp/files/ppp.sh | 4 +- package/network/services/relayd/Makefile | 2 +- .../network/services/relayd/files/relay.init | 34 +- package/network/services/samba36/Makefile | 8 +- .../network/services/uhttpd/files/uhttpd.init | 2 +- .../network/services/{mdns => umdns}/Makefile | 26 +- .../mdns.config => umdns/files/umdns.config} | 2 +- .../mdns.init => umdns/files/umdns.init} | 20 +- .../mdns.json => umdns/files/umdns.json} | 0 package/network/utils/comgt/Makefile | 2 + package/network/utils/curl/Makefile | 2 +- .../patches/001-curl-https-openssl-fix.patch | 34 + .../curl/patches/100-CVE-2017-2629.patch | 33 + package/network/utils/ebtables/Makefile | 12 +- .../utils/ebtables/patches/100-musl_fix.patch | 175 +- .../patches/200-fix-extension-init.patch | 8 +- package/network/utils/iftop/Makefile | 14 +- .../iftop/patches/110-fix-mac-display.patch | 67 - package/network/utils/iproute2/Makefile | 2 +- .../iproute2/patches/950-add-cake-to-tc.patch | 57 +- ...-monitor-can-t-work-when-NET_NS-is-n.patch | 40 + .../utils/iw/patches/001-nl80211_h_sync.patch | 294 ++- package/network/utils/tcpdump/Makefile | 4 +- .../patches/001-remove_pcap_debug.patch | 2 +- .../002-remove_static_libpcap_check.patch | 4 +- .../tcpdump/patches/100-tcpdump_mini.patch | 152 +- package/network/utils/umbim/Makefile | 2 + package/network/utils/uqmi/Makefile | 2 + package/network/utils/wireless-tools/Makefile | 2 +- package/system/lede-keyring/Makefile | 6 +- package/system/mountd/Makefile | 2 +- package/system/opkg/Makefile | 3 +- .../patches/290-clarify-download-errors.patch | 61 + package/system/procd/Makefile | 6 +- package/system/procd/files/procd.sh | 12 +- package/system/ubox/Makefile | 16 +- package/system/ubus/Makefile | 6 +- package/utils/ct-bugcheck/src/bugcheck.sh | 2 +- package/utils/osafeloader/Makefile | 2 + package/utils/px5g-standalone/Makefile | 37 - package/utils/px5g-standalone/src/Makefile | 14 - .../px5g-standalone/src/library/base64.c | 264 --- .../px5g-standalone/src/library/bignum.c | 2010 ----------------- .../utils/px5g-standalone/src/library/rsa.c | 750 ------ .../utils/px5g-standalone/src/library/sha1.c | 622 ----- .../px5g-standalone/src/library/timing.c | 265 --- .../px5g-standalone/src/library/x509write.c | 1162 ---------- .../px5g-standalone/src/polarssl/base64.h | 93 - .../px5g-standalone/src/polarssl/bignum.h | 437 ---- .../px5g-standalone/src/polarssl/bn_mul.h | 731 ------ .../px5g-standalone/src/polarssl/config.h | 329 --- .../utils/px5g-standalone/src/polarssl/rsa.h | 309 --- .../utils/px5g-standalone/src/polarssl/sha1.h | 150 -- .../px5g-standalone/src/polarssl/timing.h | 81 - .../utils/px5g-standalone/src/polarssl/x509.h | 549 ----- package/utils/px5g-standalone/src/px5g.c | 213 -- package/utils/px5g/Makefile | 24 +- package/utils/ugps/Makefile | 2 +- package/utils/ugps/files/gps.config | 2 +- scripts/download.pl | 4 +- scripts/feeds | 3 +- scripts/gen-dependencies.sh | 2 +- scripts/get_source_date_epoch.sh | 9 +- scripts/getver.sh | 5 +- scripts/om-fwupgradecfg-gen.sh | 4 +- scripts/package-metadata.pl | 2 + scripts/rstrip.sh | 2 +- scripts/target-metadata.pl | 5 +- target/imagebuilder/Config.in | 5 +- target/imagebuilder/Makefile | 2 + target/imagebuilder/files/Makefile | 2 +- target/linux/ar71xx/Makefile | 2 +- .../ar71xx/base-files/etc/board.d/01_leds | 13 + .../ar71xx/base-files/etc/board.d/02_network | 26 +- .../base-files/etc/board.d/03_gpio_switches | 2 +- target/linux/ar71xx/base-files/etc/diag.sh | 10 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 2 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 15 + .../ar71xx/base-files/lib/upgrade/openmesh.sh | 10 +- .../ar71xx/base-files/lib/upgrade/platform.sh | 69 +- target/linux/ar71xx/base-files/sbin/wget2nand | 85 - target/linux/ar71xx/config-4.4 | 2 + .../files/arch/mips/ath79/Kconfig.openwrt | 21 + .../ar71xx/files/arch/mips/ath79/Makefile | 2 + .../ar71xx/files/arch/mips/ath79/dev-eth.c | 2 +- .../ar71xx/files/arch/mips/ath79/mach-a60.c | 181 ++ .../ar71xx/files/arch/mips/ath79/mach-om2p.c | 94 + .../files/arch/mips/ath79/mach-rb2011.c | 2 +- .../ar71xx/files/arch/mips/ath79/mach-rb750.c | 3 + .../ar71xx/files/arch/mips/ath79/mach-rb922.c | 2 +- .../ar71xx/files/arch/mips/ath79/mach-rb941.c | 173 ++ .../ar71xx/files/arch/mips/ath79/mach-rb95x.c | 2 +- .../files/arch/mips/ath79/mach-rbsxtlite.c | 2 +- .../ar71xx/files/arch/mips/ath79/machtypes.h | 5 + .../files/drivers/mtd/nand/rb4xx_nand.c | 2 +- .../files/drivers/mtd/nand/rb750_nand.c | 2 +- .../files/drivers/mtd/nand/rb91x_nand.c | 2 +- target/linux/ar71xx/image/Makefile | 3 + target/linux/ar71xx/image/generic.mk | 6 +- target/linux/ar71xx/image/legacy-devices.mk | 17 +- target/linux/ar71xx/image/legacy.mk | 1 + target/linux/ar71xx/image/mikrotik.mk | 44 + target/linux/ar71xx/image/nand.mk | 2 +- target/linux/ar71xx/mikrotik/config-default | 98 +- .../ar71xx/mikrotik/profiles/00-default.mk | 18 + .../ar71xx/mikrotik/profiles/01-minimal.mk | 17 - .../ar71xx/mikrotik/profiles/02-ath5k.mk | 17 - target/linux/ar71xx/mikrotik/target.mk | 2 +- .../patches-4.4/500-MIPS-fw-myloader.patch | 2 +- ...MIPS-ath79-add-routerboard-detection.patch | 4 +- .../910-unaligned_access_hacks.patch | 26 +- target/linux/arm64/Makefile | 28 + target/linux/arm64/README | 13 + .../xen_domu => arm64}/base-files/etc/inittab | 4 +- target/linux/arm64/config-4.4 | 350 +++ target/linux/arm64/image/Makefile | 46 + .../linux/arm64/image/boot-wrapper/Makefile | 37 + target/linux/armvirt/Makefile | 28 + target/linux/armvirt/README | 34 + .../armvirt/base-files/etc/board.d/00_model | 14 + target/linux/armvirt/base-files/etc/inittab | 5 + target/linux/armvirt/config-default | 259 +++ target/linux/armvirt/image/Makefile | 24 + .../files/drivers/leds/ledtrig-netdev.c | 36 +- .../generic/files/drivers/net/phy/ar8216.c | 1 + .../generic/files/drivers/net/phy/mvsw61xx.c | 4 + .../generic/files/drivers/net/phy/mvsw61xx.h | 3 + .../patches-3.18/305-mips_module_reloc.patch | 5 +- .../patches-4.4/023-bcma-from-4.9.patch | 26 + .../patches-4.4/025-bcma-from-4.11.patch | 105 + ...flash-use-platform_-set-get-_drvdata.patch | 63 + ...h-support-reading-flash-out-of-mappi.patch | 81 + ...ove-TRX-parsing-code-to-separated-f.patch} | 7 +- ...upport-layouts-with-multiple-TRX-pa.patch} | 6 +- .../062-01-MIPS-Introduce-irq_stack.patch | 70 + ...S-Stack-unwinding-while-on-IRQ-stack.patch | 42 + ...-28-to-thread_info-if-coming-from-us.patch | 48 + ...witch-to-the-irq_stack-in-interrupts.patch | 116 + ...PS-Select-HAVE_IRQ_EXIT_ON_IRQ_STACK.patch | 21 + ...ix-erroneous-jal-to-plat_irq_dispatc.patch | 35 + ...c-fix-a-missing-check-for-build_skb.patch} | 0 ...rsed-test-of-build_skb-return-value.patch} | 0 ...gmac-clarify-CONFIG_BCMA-dependency.patch} | 0 ...checking-for-BCM4707-BCM53018-chip-.patch} | 0 ...ort-Ethernet-device-on-BCM47094-SoC.patch} | 0 ...nable-Ethernet-core-before-using-it.patch} | 0 ...ix-MAC-soft-reset-bit-for-corerev-4.patch} | 0 ...evice-with-backing-device-structure.patch} | 0 ...-Add-support-for-ethtool-statistics.patch} | 0 ...mac-Maintain-some-netdev-statistics.patch} | 0 ...c-use-phydev-from-struct-net_device.patch} | 0 ...0001-net-bgmac-Fix-SOF-bit-checking.patch} | 0 ...-Start-transmit-queue-in-bgmac_open.patch} | 0 ...-Remove-superflous-netif_carrier_on.patch} | 0 ...c-change-bgmac_-prints-to-dev_-prin.patch} | 0 ...-ethernet-bgmac-add-dma_dev-pointer.patch} | 0 ...c-move-BCMA-MDIO-Phy-code-into-a-se.patch} | 0 ...rnet-bgmac-convert-to-feature-flags.patch} | 0 ...t-bgmac-Add-platform-device-support.patch} | 0 ...c-Fix-return-value-check-in-bgmac_p.patch} | 0 ...c-Remove-redundant-dev_err-call-in-.patch} | 0 ...ersed-check-for-MII-registration-er.patch} | 0 ...port-Ethernet-core-on-BCM53573-SoCs.patch} | 0 ...-clear-when-setting-interface-type-.patch} | 0 ...bgmac-Fix-errant-feature-flag-check.patch} | 0 ...elling-mistake-connecton-connection.patch} | 0 ...ersed-checks-for-clock-control-flag.patch} | 5 +- ...rsion-of-alloc_etherdev_mqs-function.patch | 70 + ...te-struct-bgmac-just-once-don-t-copy.patch | 139 ++ ...truct-bcma_mdio-we-don-t-need-anymor.patch | 274 +++ ...e-PHY-subsystem-for-initializing-PHY.patch | 53 + ...ick-Broadcom-drivers-updates-from-v4.patch | 278 +++ ...adcom-drivers-updates-from-net-next-.patch | 159 ++ ...appended-dtb-to-the-end-of-the-kerne.patch | 4 +- .../patches-4.4/132-mips_inline_dma_ops.patch | 4 +- ...-serial-console-directly-from-ChipCo.patch | 92 + .../300-mips_expose_boot_raw.patch | 4 +- .../301-mips_image_cmdline_hack.patch | 2 +- .../patches-4.4/304-mips_disable_fpu.patch | 2 +- .../patches-4.4/305-mips_module_reloc.patch | 5 +- .../patches-4.4/630-packet_socket_type.patch | 16 +- ...Add-support-for-MAP-E-FMRs-mesh-mode.patch | 26 +- ...ng-with-source-address-failed-policy.patch | 10 +- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 12 +- .../generic/patches-4.4/721-phy_packets.patch | 6 +- .../773-bgmac-add-srab-switch.patch | 8 +- target/linux/ramips/Makefile | 2 +- .../ramips/base-files/etc/board.d/01_leds | 6 +- .../ramips/base-files/etc/board.d/02_network | 22 +- target/linux/ramips/base-files/etc/diag.sh | 8 +- target/linux/ramips/base-files/lib/ramips.sh | 12 +- .../ramips/base-files/lib/upgrade/platform.sh | 4 +- target/linux/ramips/dts/GB-PC1.dts | 135 -- target/linux/ramips/dts/OMEGA2.dts | 20 + target/linux/ramips/dts/OMEGA2.dtsi | 170 ++ target/linux/ramips/dts/OMEGA2P.dts | 20 + target/linux/ramips/dts/VOCORE2.dts | 123 + target/linux/ramips/dts/WLI-TX4-AG300N.dts | 13 +- target/linux/ramips/dts/WSR-600.dts | 21 + target/linux/ramips/image/mt7620.mk | 464 ++++ target/linux/ramips/image/mt7621.mk | 199 +- target/linux/ramips/image/mt7628.mk | 9 + target/linux/ramips/image/mt7688.mk | 16 + target/linux/ramips/image/rt288x.mk | 11 +- target/linux/ramips/image/rt305x.mk | 1 + target/linux/ramips/modules.mk | 10 +- target/linux/ramips/mt7620/config-4.4 | 211 ++ .../ramips/mt7620/profiles/00-default.mk | 17 + target/linux/ramips/mt7620/target.mk | 15 + target/linux/ramips/mt7621/target.mk | 2 +- target/linux/ramips/mt7628/config-4.4 | 206 ++ .../ramips/mt7628/profiles/00-default.mk | 17 + target/linux/ramips/mt7628/target.mk | 15 + target/linux/ramips/mt7688/config-4.4 | 211 ++ .../ramips/mt7688/profiles/00-default.mk | 17 + target/linux/ramips/mt7688/target.mk | 15 + ...25-pinctrl-ralink-add-pinctrl-driver.patch | 2 +- ...IO-ralink-add-mt7621-gpio-controller.patch | 2 +- ...tek-support-MTK-xHCI-host-controller.patch | 12 +- ...IPS-ralink-add-sdhci-for-mt7620a-SoC.patch | 2 +- .../ramips/patches-4.4/0519-gsw_mt7621.patch | 6 +- .../0902-mediatek-4-byte-spi-reset.patch | 43 - .../200-rt3883-fix-pinctrl-typo.patch | 21 + target/linux/ramips/rt288x/target.mk | 2 +- target/linux/uml/Makefile | 2 +- target/linux/x86/64/config-default | 9 + target/linux/x86/64/target.mk | 2 +- target/linux/x86/Makefile | 2 +- .../linux/x86/base-files/etc/board.d/01_leds | 26 + .../x86/base-files/etc/board.d/02_network | 27 + target/linux/x86/base-files/etc/diag.sh | 78 + target/linux/x86/base-files/etc/inittab | 1 + .../x86/base-files/lib/upgrade/platform.sh | 11 +- target/linux/x86/config-4.4 | 9 +- .../base-files/lib/preinit/45_mount_xenfs | 9 + target/linux/x86/generic/config-default | 61 +- .../linux/x86/generic/profiles/000-Generic.mk | 2 +- .../linux/x86/geode/profiles/000-Generic.mk | 20 + target/linux/x86/geode/profiles/100-Geos.mk | 19 + target/linux/x86/geode/target.mk | 7 +- target/linux/x86/image/grub-iso.cfg | 2 +- target/linux/x86/image/grub.cfg | 4 +- .../linux/x86/legacy/profiles/000-Generic.mk | 2 +- target/linux/x86/modules.mk | 15 + ...tco-Add-AMD-Mullins-platform-support.patch | 26 + ...tco-Add-AMD-Carrizo-platform-support.patch | 27 + ...e-check-for-SB800-and-later-chipsets.patch | 76 + ...tco-properly-check-for-new-register-.patch | 72 + .../base-files/lib/preinit/45_mount_xenfs | 11 - target/linux/x86/xen_domu/config-default | 100 - .../x86/xen_domu/profiles/000-Generic.mk | 15 - target/linux/x86/xen_domu/target.mk | 3 - target/linux/xburst/Makefile | 2 +- target/linux/xburst/image/Makefile | 7 +- target/sdk/Config.in | 1 + target/sdk/Makefile | 21 +- target/sdk/files/README.SDK | 4 +- toolchain/musl/Config.version | 2 +- toolchain/musl/common.mk | 9 +- ...ay-month-names-not-to-vary-by-locale.patch | 41 - ...ssion-in-tcsetattr-on-all-mips-archs.patch | 67 - ...ite-syscall-calling-convention-on-sh.patch | 71 - ...me-refers-to-the-same-file-as-the-fd.patch | 49 - ...5-fix-ffsync-by-changing-it-to-osync.patch | 25 - ...form-octal-zero-flag-and-field-width.patch | 31 - ..._data-and-ifcu_buf-types-in-net-if.h.patch | 35 - .../030-fix-if_indextoname-error-case.patch | 36 - ...csftime_l-prototypes-to-wchar-header.patch | 38 - ...-behavior-in-sched.h-cpu_set_t-usage.patch | 43 - ...rvby_r-result-pointer-value-on-error.patch | 41 - ...-fix-strftime-y-for-negative-tm_year.patch | 23 - ...-in-regexec-buffer-size-computations.patch | 72 - ...haystack-strings-longer-than-int_max.patch | 189 -- ...-printf-needed-precision-computation.patch | 35 - ...nd-uncaught-eoverflow-in-printf-core.patch | 390 ---- .../048-math-fix-pow-signed-shift-ub.patch | 38 - .../049-fix-clock_nanosleep-error-case.patch | 30 - .../patches/050-add-pthread_setname_np.patch | 58 - ...rmatting-of-some-exact-halfway-cases.patch | 30 - ...ng_only-misinterpreting-as-an-option.patch | 24 - ...itous-undefined-behavior-in-strptime.patch | 33 - ...of-rounding-with-many-trailing-zeros.patch | 36 - ...ization-in-non-nearest-rounding-mode.patch | 38 - ...-overflow-of-tm_year-in-__secs_to_tm.patch | 39 - ...rnal-buffer-state-and-error-handling.patch | 36 - ...ion-on-archs-with-variable-page-size.patch | 32 - ...ibute-to-some-function-declarations.patch} | 0 .../patches/400-fix_quoted_timezone.patch | 11 - tools/Makefile | 1 + tools/ccache/Makefile | 3 +- tools/cmake/Makefile | 12 +- .../150-bootstrap_parallel_make_flag.patch | 14 + tools/kernel2minor/Makefile | 8 +- .../patches/100-portability.patch | 13 - .../patches/110-fix_endian_conv.patch | 33 - .../patches/120-fix_create_mode.patch | 11 - tools/patch-image/src/patch-dtb.c | 4 - tools/qemu/Makefile | 26 +- 662 files changed, 22240 insertions(+), 18162 deletions(-) create mode 100644 package/base-files/files/etc/iproute2/rt_protos create mode 100644 package/boot/apex/Makefile create mode 100644 package/boot/apex/patches/001-compile_fix.patch create mode 100644 package/boot/apex/patches/100-openwrt_nslu2_armeb_config.patch create mode 100644 package/boot/apex/patches/120-openwrt_nslu2_16mb_armeb_config.patch create mode 100644 package/boot/apex/patches/140-openwrt_fsg3_armeb_config.patch create mode 100644 package/boot/apex/patches/150-limit_ram_to_64mb.patch create mode 100644 package/boot/apex/patches/160-openwrt_nas100d_armeb_config.patch delete mode 100644 package/boot/grub2/patches/100-musl-compat.patch create mode 100644 package/boot/grub2/patches/101-disable-gettext-check-macro-version.patch delete mode 100644 package/boot/grub2/patches/210-fix_serial_rtscts.patch delete mode 100644 package/boot/kexec-tools/patches/0001-Fix-zlib-lzma-decompression.patch delete mode 100644 package/boot/kexec-tools/patches/0002-configure.ac-apply-necessary-quotes-to-result-of-mac.patch delete mode 100644 package/boot/kexec-tools/patches/0003-mips-fix-compiler-warning-on-printing-64-bit-integer.patch delete mode 100644 package/boot/kexec-tools/patches/0004-mips-remove-unused-variable.patch delete mode 100644 package/boot/kexec-tools/patches/0005-mips-fix-warning-about-implicit-type-conversion.patch create mode 100644 package/boot/kexec-tools/patches/100-format_string_fix.patch create mode 100644 package/boot/kexec-tools/patches/110-fix-vmcore-dmsg-compilation-error.patch create mode 100644 package/boot/kobs-ng/Makefile create mode 100644 package/boot/kobs-ng/patches/001-compile.patch create mode 100644 package/boot/kobs-ng/patches/002-add-init-size-param.patch create mode 100644 package/boot/kobs-ng/patches/003-raw-mode.patch create mode 100644 package/boot/kobs-ng/patches/004-fix-cal_nfc_geometry.patch create mode 100644 package/boot/rbcfg/Makefile create mode 100644 package/boot/rbcfg/src/Makefile create mode 100644 package/boot/rbcfg/src/cyg_crc.h create mode 100644 package/boot/rbcfg/src/cyg_crc32.c create mode 100644 package/boot/rbcfg/src/main.c create mode 100644 package/boot/rbcfg/src/rbcfg.h delete mode 100644 package/kernel/avila-wdt/Makefile delete mode 100644 package/kernel/avila-wdt/src/Makefile delete mode 100644 package/kernel/avila-wdt/src/avila-wdt.c delete mode 100644 package/kernel/mac80211/patches/004-fix_duplicate_skcipher_backport.patch create mode 100644 package/kernel/mac80211/patches/004-kconfig_backport_fix.patch delete mode 100644 package/kernel/mac80211/patches/005-backport_skb_get_hash_perturb.patch create mode 100644 package/kernel/mac80211/patches/005-revert-devcoredump.patch create mode 100644 package/kernel/mac80211/patches/006-revert-ktime-changes.patch create mode 100644 package/kernel/mac80211/patches/007-revert-genetlink-changes.patch create mode 100644 package/kernel/mac80211/patches/008-revert-ndo_stats64-cleanup.patch create mode 100644 package/kernel/mac80211/patches/009-revert-mtu-changes.patch create mode 100644 package/kernel/mac80211/patches/011-backport_strscpy.patch create mode 100644 package/kernel/mac80211/patches/030-rt2x00_options.patch create mode 100644 package/kernel/mac80211/patches/040-brcmutil_option.patch create mode 100644 package/kernel/mac80211/patches/090-remove-cred.patch delete mode 100644 package/kernel/mac80211/patches/300-ath9k-Switch-to-using-mac80211-intermediate-software.patch rename package/kernel/mac80211/patches/{314-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch => 300-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch} (100%) rename package/kernel/mac80211/patches/{315-ath9k_hw-issue-external-reset-for-QCA955x.patch => 301-ath9k_hw-issue-external-reset-for-QCA955x.patch} (99%) rename package/kernel/mac80211/patches/{316-ath9k_hw-set-spectral-scan-enable-bit-on-trigger-for.patch => 302-ath9k_hw-set-spectral-scan-enable-bit-on-trigger-for.patch} (100%) rename package/kernel/mac80211/patches/{347-ath9k-don-t-run-periodic-and-nf-calibation-at-the-sa.patch => 303-ath9k-don-t-run-periodic-and-nf-calibation-at-the-sa.patch} (98%) rename package/kernel/mac80211/patches/{301-ath9k-force-rx_clear-when-disabling-rx.patch => 304-ath9k-force-rx_clear-when-disabling-rx.patch} (96%) rename package/kernel/mac80211/patches/{302-ath9k-limit-retries-for-powersave-response-frames.patch => 305-ath9k-limit-retries-for-powersave-response-frames.patch} (84%) rename package/kernel/mac80211/patches/{303-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch => 306-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch} (89%) rename package/kernel/mac80211/patches/{304-mac80211-add-hdrlen-to-ieee80211_tx_data.patch => 307-mac80211-add-hdrlen-to-ieee80211_tx_data.patch} (91%) rename package/kernel/mac80211/patches/{305-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch => 308-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch} (87%) rename package/kernel/mac80211/patches/{306-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch => 309-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch} (86%) rename package/kernel/mac80211/patches/{307-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch => 310-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch} (86%) rename package/kernel/mac80211/patches/{308-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch => 311-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch} (90%) rename package/kernel/mac80211/patches/{309-ath9k-report-tx-status-on-EOSP.patch => 312-ath9k-report-tx-status-on-EOSP.patch} (100%) delete mode 100644 package/kernel/mac80211/patches/312-mac80211-Use-rhltable-instead-of-rhashtable.patch rename package/kernel/mac80211/patches/{310-ath9k-fix-block-ack-window-tracking-issues.patch => 313-ath9k-fix-block-ack-window-tracking-issues.patch} (85%) delete mode 100644 package/kernel/mac80211/patches/313-mac80211-fix-sequence-number-allocation-regression.patch create mode 100644 package/kernel/mac80211/patches/314-ath9k-rename-tx_complete_work-to-hw_check_work.patch create mode 100644 package/kernel/mac80211/patches/315-ath9k_hw-check-if-the-chip-failed-to-wake-up.patch create mode 100644 package/kernel/mac80211/patches/316-ath9k-fix-race-condition-in-enabling-disabling-IRQs.patch delete mode 100644 package/kernel/mac80211/patches/317-Revert-ath9k_hw-implement-temperature-compensation-s.patch create mode 100644 package/kernel/mac80211/patches/317-rt2x00-avoid-introducing-a-USB-dependency-in-the-rt2.patch create mode 100644 package/kernel/mac80211/patches/318-0001-brcmfmac-check-brcmf_bus_get_memdump-result-for-erro.patch delete mode 100644 package/kernel/mac80211/patches/318-mac80211-fix-up-mismerge-of-ieee80211_tx_dequeue.patch create mode 100644 package/kernel/mac80211/patches/319-0002-brcmfmac-be-more-verbose-when-PSM-s-watchdog-fires.patch create mode 100644 package/kernel/mac80211/patches/319-0003-brcmfmac-use-wiphy_read_of_freq_limits-to-respect-li.patch create mode 100644 package/kernel/mac80211/patches/319-0004-brcmfmac-merge-two-brcmf_err-macros-into-one.patch create mode 100644 package/kernel/mac80211/patches/319-0005-brcmfmac-switch-to-C-function-__brcmf_err-for-printi.patch create mode 100644 package/kernel/mac80211/patches/319-0006-brcmfmac-merge-two-remaining-brcmf_err-macros.patch delete mode 100644 package/kernel/mac80211/patches/319-mac80211-avoid-extra-memcpy-in-A-MSDU-head-creation.patch create mode 100644 package/kernel/mac80211/patches/320-ath9k-clean-up-and-fix-ath_tx_count_airtime.patch delete mode 100644 package/kernel/mac80211/patches/320-mac80211-fix-A-MSDU-outer-SA-DA.patch delete mode 100644 package/kernel/mac80211/patches/321-Revert-mac80211-allow-using-AP_LINK_PS-with-mac80211.patch create mode 100644 package/kernel/mac80211/patches/321-mac80211-fix-CSA-in-IBSS-mode.patch create mode 100644 package/kernel/mac80211/patches/322-mac80211-don-t-handle-filtered-frames-within-a-BA-se.patch delete mode 100644 package/kernel/mac80211/patches/322-mac80211-update-A-MPDU-flag-on-tx-dequeue.patch delete mode 100644 package/kernel/mac80211/patches/323-mac80211-remove-bogus-skb-vif-assignment.patch delete mode 100644 package/kernel/mac80211/patches/324-mac80211-fix-A-MSDU-aggregation-with-fast-xmit-txq.patch delete mode 100644 package/kernel/mac80211/patches/325-ath9k-fix-ath9k_hw_gpio_get-to-return-0-or-1-on-succ.patch delete mode 100644 package/kernel/mac80211/patches/326-Documentation-dt-net-add-ath9k-wireless-device-bindi.patch delete mode 100644 package/kernel/mac80211/patches/327-ath9k-add-a-helper-to-get-the-string-representation-.patch delete mode 100644 package/kernel/mac80211/patches/328-ath9k-parse-the-device-configuration-from-an-OF-node.patch delete mode 100644 package/kernel/mac80211/patches/329-ath9k-unlock-rcu-read-when-returning-early.patch delete mode 100644 package/kernel/mac80211/patches/334-mac80211-minstrel_ht-move-supported-bitrate-mask-out.patch delete mode 100644 package/kernel/mac80211/patches/335-mac80211-minstrel_ht-move-short-preamble-check-out-o.patch delete mode 100644 package/kernel/mac80211/patches/336-mac80211-minstrel_ht-make-att_hist-and-succ_hist-u32.patch delete mode 100644 package/kernel/mac80211/patches/337-mac80211-check-for-MCS-in-ieee80211_duration-before-.patch delete mode 100644 package/kernel/mac80211/patches/338-mac80211-minstrel-remove-cur_prob-from-debugfs.patch delete mode 100644 package/kernel/mac80211/patches/339-mac80211-minstrel-reduce-MINSTREL_SCALE.patch delete mode 100644 package/kernel/mac80211/patches/340-mac80211-minstrel-store-probability-variance-instead.patch delete mode 100644 package/kernel/mac80211/patches/341-mac80211-minstrel-make-prob_ewma-u16-instead-of-u32.patch delete mode 100644 package/kernel/mac80211/patches/342-mac80211-minstrel_ht-remove-obsolete-if-for-3-stream.patch delete mode 100644 package/kernel/mac80211/patches/343-cfg80211-limit-scan-results-cache-size.patch delete mode 100644 package/kernel/mac80211/patches/346-ath5k-drop-bogus-warning-on-drv_set_key-with-unsuppo.patch delete mode 100644 package/kernel/mac80211/patches/347-0001-cfg80211-move-function-checking-range-fit-to-util.c.patch delete mode 100644 package/kernel/mac80211/patches/347-0002-cfg80211-support-ieee80211-freq-limit-DT-property.patch delete mode 100644 package/kernel/mac80211/patches/550-ath9k-Add-a-define-for-the-EEPROM-eepmisc-endianness.patch create mode 100644 package/kernel/mac80211/patches/550-ath9k-disable-bands-via-dt.patch delete mode 100644 package/kernel/mac80211/patches/551-ath9k-indicate-that-the-AR9003-EEPROM-template-value.patch rename package/kernel/mac80211/patches/{560-ath9k_ubnt_uap_plus_hsr.patch => 551-ath9k_ubnt_uap_plus_hsr.patch} (98%) delete mode 100644 package/kernel/mac80211/patches/552-ath9k-Add-an-eeprom_ops-callback-for-retrieving-the-.patch delete mode 100644 package/kernel/mac80211/patches/553-ath9k-replace-eeprom_param-EEP_MINOR_REV-with-get_ee.patch delete mode 100644 package/kernel/mac80211/patches/554-ath9k-consistently-use-get_eeprom_rev-ah.patch delete mode 100644 package/kernel/mac80211/patches/555-ath9k-Make-the-EEPROM-swapping-check-use-the-eepmisc.patch delete mode 100644 package/kernel/mac80211/patches/556-ath9k-define-all-EEPROM-fields-in-Little-Endian-form.patch delete mode 100644 package/kernel/mac80211/patches/557-ath9k-disable-bands-via-dt.patch create mode 100644 package/kernel/mac80211/patches/600-01-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch create mode 100644 package/kernel/mac80211/patches/600-02-rt2x00-rt2800lib-enable-support-for-RT3883.patch create mode 100644 package/kernel/mac80211/patches/600-03-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch create mode 100644 package/kernel/mac80211/patches/600-04-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch create mode 100644 package/kernel/mac80211/patches/600-05-rt2x00-rt2800lib-add-channel-configuration-function-.patch create mode 100644 package/kernel/mac80211/patches/600-06-rt2x00-rt2800lib-enable-RF3853-support.patch create mode 100644 package/kernel/mac80211/patches/600-07-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch create mode 100644 package/kernel/mac80211/patches/600-08-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch create mode 100644 package/kernel/mac80211/patches/600-09-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch create mode 100644 package/kernel/mac80211/patches/600-10-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch create mode 100644 package/kernel/mac80211/patches/600-11-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch create mode 100644 package/kernel/mac80211/patches/600-12-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch create mode 100644 package/kernel/mac80211/patches/600-13-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch create mode 100644 package/kernel/mac80211/patches/600-14-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch create mode 100644 package/kernel/mac80211/patches/600-15-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch create mode 100644 package/kernel/mac80211/patches/600-16-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch create mode 100644 package/kernel/mac80211/patches/600-17-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch create mode 100644 package/kernel/mac80211/patches/600-18-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch create mode 100644 package/kernel/mac80211/patches/600-19-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch create mode 100644 package/kernel/mac80211/patches/600-20-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch create mode 100644 package/kernel/mac80211/patches/600-21-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch create mode 100644 package/kernel/mac80211/patches/600-22-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch create mode 100644 package/kernel/mac80211/patches/600-23-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch create mode 100644 package/kernel/mac80211/patches/601-rt2x00-introduce-rt2x00_platform_h.patch create mode 100644 package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch create mode 100644 package/kernel/mac80211/patches/603-rt2x00-of_load_eeprom_filename.patch create mode 100644 package/kernel/mac80211/patches/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch create mode 100644 package/kernel/mac80211/patches/606-rt2x00-allow_disabling_bands_through_platform_data.patch create mode 100644 package/kernel/mac80211/patches/607-rt2x00-add_platform_data_mac_addr.patch create mode 100644 package/kernel/mac80211/patches/608-rt2x00-allow_disabling_bands_through_dts.patch create mode 100644 package/kernel/mac80211/patches/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch create mode 100644 package/kernel/mac80211/patches/610-rt2x00-change-led-polarity-from-OF.patch create mode 100644 package/kernel/mac80211/patches/611-rt2x00-add-AP+STA-support.patch create mode 100644 package/kernel/mac80211/patches/620-rt2x00-enable-rt2800soc-for-mt7620.patch create mode 100644 package/kernel/mac80211/patches/621-rt2x00-add-support-for-mt7620.patch delete mode 100644 package/kernel/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch create mode 100644 package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch create mode 100644 package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch create mode 100644 package/kernel/mac80211/patches/850-brcmsmac-remove-extra-regulation-restriction.patch create mode 100644 package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch create mode 100644 package/kernel/mac80211/patches/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch create mode 100644 package/kernel/mac80211/patches/862-brcmfmac-Disable-power-management.patch create mode 100644 package/kernel/mac80211/patches/863-brcmfmac-add-in-driver-tables-with-country-codes.patch create mode 100644 package/kernel/mac80211/patches/864-brcmfmac-do-not-use-internal-roaming-engine-by-default.patch delete mode 100644 package/libs/polarssl/Makefile delete mode 100644 package/libs/polarssl/patches/200-reduce_config.patch create mode 100644 package/libs/uclibc++/patches/050-Bugfix-erase-on-derived-__base_associative.patch delete mode 100644 package/luci/.buildpath delete mode 100644 package/luci/.cproject delete mode 100644 package/luci/.gitignore delete mode 100644 package/luci/.project create mode 100644 package/luci/applications/luci-app-adblock/po/pt-br/adblock.po create mode 100644 package/luci/applications/luci-app-aria2/po/pt-br/aria2.po create mode 100644 package/luci/applications/luci-app-dynapoint/Makefile create mode 100644 package/luci/applications/luci-app-dynapoint/luasrc/controller/dynapoint.lua create mode 100644 package/luci/applications/luci-app-dynapoint/luasrc/model/cbi/dynapoint.lua create mode 100644 package/luci/applications/luci-app-dynapoint/luasrc/view/dynapoint/cbi_checkbox.htm create mode 100644 package/luci/applications/luci-app-dynapoint/luasrc/view/dynapoint/cbi_color.htm create mode 100644 package/luci/applications/luci-app-dynapoint/po/de/dynapoint.po create mode 100644 package/luci/applications/luci-app-dynapoint/po/ja/dynapoint.po create mode 100644 package/luci/applications/luci-app-dynapoint/po/pt-br/dynapoint.po create mode 100644 package/luci/applications/luci-app-dynapoint/po/templates/dynapoint.pot create mode 100644 package/luci/applications/luci-app-dynapoint/root/etc/uci-defaults/40_luci-dynapoint create mode 100644 package/luci/applications/luci-app-firewall/po/ko/firewall.po create mode 100644 package/luci/applications/luci-app-fwknopd/po/pt-br/fwknopd.po create mode 100644 package/luci/applications/luci-app-mjpg-streamer/po/pt-br/mjpg-streamer.po create mode 100644 package/luci/applications/luci-app-privoxy/po/pt-br/privoxy.po create mode 100644 package/luci/applications/luci-app-radicale/po/pt-br/radicale.po create mode 100644 package/luci/applications/luci-app-shadowsocks-libev/po/pt-br/shadowsocks-libev.po create mode 100644 package/luci/applications/luci-app-shairplay/po/pt-br/shairplay.po create mode 100644 package/luci/applications/luci-app-travelmate/po/pt-br/travelmate.po create mode 100644 package/luci/applications/luci-app-uhttpd/po/pt-br/uhttpd.po create mode 100644 package/luci/applications/luci-app-unbound/root/etc/uci-defaults/60_luci-unbound create mode 100644 package/luci/applications/luci-app-vpnbypass/po/pt-br/vpnbypass.po create mode 100644 package/luci/applications/luci-app-wifischedule/po/pt-br/wifischedule.po create mode 100644 package/network/services/dnsmasq/patches/000-fix-servfail-handling.patch rename package/network/services/hostapd/files/{netifd.sh => hostapd.sh} (97%) create mode 100644 package/network/services/hostapd/patches/001-Fix-race-condition-between-AssocResp-callback-and-4a.patch create mode 100644 package/network/services/hostapd/patches/002-Fix-duplicate-Reassociation-Request-frame-dropping.patch create mode 100644 package/network/services/hostapd/patches/003-RSN-IBSS-Fix-TK-clearing-on-Authentication-frame-RX.patch create mode 100644 package/network/services/hostapd/patches/004-hostapd-Add-possibility-to-send-debug-messages-to-sy.patch mode change 100644 => 100755 package/network/services/ppp/files/lib/netifd/ppp6-up rename package/network/services/{mdns => umdns}/Makefile (56%) rename package/network/services/{mdns/files/mdns.config => umdns/files/umdns.config} (71%) rename package/network/services/{mdns/files/mdns.init => umdns/files/umdns.init} (59%) rename package/network/services/{mdns/files/mdns.json => umdns/files/umdns.json} (100%) create mode 100644 package/network/utils/curl/patches/001-curl-https-openssl-fix.patch create mode 100644 package/network/utils/curl/patches/100-CVE-2017-2629.patch delete mode 100644 package/network/utils/iftop/patches/110-fix-mac-display.patch create mode 100644 package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch create mode 100644 package/system/opkg/patches/290-clarify-download-errors.patch delete mode 100644 package/utils/px5g-standalone/Makefile delete mode 100644 package/utils/px5g-standalone/src/Makefile delete mode 100644 package/utils/px5g-standalone/src/library/base64.c delete mode 100644 package/utils/px5g-standalone/src/library/bignum.c delete mode 100644 package/utils/px5g-standalone/src/library/rsa.c delete mode 100644 package/utils/px5g-standalone/src/library/sha1.c delete mode 100644 package/utils/px5g-standalone/src/library/timing.c delete mode 100644 package/utils/px5g-standalone/src/library/x509write.c delete mode 100644 package/utils/px5g-standalone/src/polarssl/base64.h delete mode 100644 package/utils/px5g-standalone/src/polarssl/bignum.h delete mode 100644 package/utils/px5g-standalone/src/polarssl/bn_mul.h delete mode 100644 package/utils/px5g-standalone/src/polarssl/config.h delete mode 100644 package/utils/px5g-standalone/src/polarssl/rsa.h delete mode 100644 package/utils/px5g-standalone/src/polarssl/sha1.h delete mode 100644 package/utils/px5g-standalone/src/polarssl/timing.h delete mode 100644 package/utils/px5g-standalone/src/polarssl/x509.h delete mode 100644 package/utils/px5g-standalone/src/px5g.c delete mode 100755 target/linux/ar71xx/base-files/sbin/wget2nand create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-a60.c create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-rb941.c create mode 100644 target/linux/ar71xx/image/mikrotik.mk create mode 100644 target/linux/ar71xx/mikrotik/profiles/00-default.mk delete mode 100644 target/linux/ar71xx/mikrotik/profiles/01-minimal.mk delete mode 100644 target/linux/ar71xx/mikrotik/profiles/02-ath5k.mk create mode 100644 target/linux/arm64/Makefile create mode 100644 target/linux/arm64/README rename target/linux/{x86/xen_domu => arm64}/base-files/etc/inittab (58%) create mode 100644 target/linux/arm64/config-4.4 create mode 100644 target/linux/arm64/image/Makefile create mode 100644 target/linux/arm64/image/boot-wrapper/Makefile create mode 100644 target/linux/armvirt/Makefile create mode 100644 target/linux/armvirt/README create mode 100755 target/linux/armvirt/base-files/etc/board.d/00_model create mode 100644 target/linux/armvirt/base-files/etc/inittab create mode 100644 target/linux/armvirt/config-default create mode 100644 target/linux/armvirt/image/Makefile create mode 100644 target/linux/generic/patches-4.4/025-bcma-from-4.11.patch create mode 100644 target/linux/generic/patches-4.4/042-0005-mtd-bcm47xxsflash-use-platform_-set-get-_drvdata.patch create mode 100644 target/linux/generic/patches-4.4/042-0006-mtd-bcm47xxsflash-support-reading-flash-out-of-mappi.patch rename target/linux/generic/patches-4.4/{141-0001-mtd-bcm47xxpart-move-TRX-parsing-code-to-separated-f.patch => 042-0007-mtd-bcm47xxpart-move-TRX-parsing-code-to-separated-f.patch} (94%) rename target/linux/generic/patches-4.4/{141-0002-mtd-bcm47xxpart-support-layouts-with-multiple-TRX-pa.patch => 042-0008-mtd-bcm47xxpart-support-layouts-with-multiple-TRX-pa.patch} (91%) create mode 100644 target/linux/generic/patches-4.4/062-01-MIPS-Introduce-irq_stack.patch create mode 100644 target/linux/generic/patches-4.4/062-02-MIPS-Stack-unwinding-while-on-IRQ-stack.patch create mode 100644 target/linux/generic/patches-4.4/062-03-MIPS-Only-change-28-to-thread_info-if-coming-from-us.patch create mode 100644 target/linux/generic/patches-4.4/062-04-MIPS-Switch-to-the-irq_stack-in-interrupts.patch create mode 100644 target/linux/generic/patches-4.4/062-05-MIPS-Select-HAVE_IRQ_EXIT_ON_IRQ_STACK.patch create mode 100644 target/linux/generic/patches-4.4/062-06-MIPS-IRQ-Stack-Fix-erroneous-jal-to-plat_irq_dispatc.patch rename target/linux/generic/patches-4.4/{070-0001-bgmac-fix-a-missing-check-for-build_skb.patch => 070-v4.5-0001-bgmac-fix-a-missing-check-for-build_skb.patch} (100%) rename target/linux/generic/patches-4.4/{070-0002-bgmac-Fix-reversed-test-of-build_skb-return-value.patch => 070-v4.5-0002-bgmac-Fix-reversed-test-of-build_skb-return-value.patch} (100%) rename target/linux/generic/patches-4.4/{071-0000-net-bgmac-clarify-CONFIG_BCMA-dependency.patch => 070-v4.5-0003-net-bgmac-clarify-CONFIG_BCMA-dependency.patch} (100%) rename target/linux/generic/patches-4.4/{071-0001-bgmac-add-helper-checking-for-BCM4707-BCM53018-chip-.patch => 070-v4.6-0001-bgmac-add-helper-checking-for-BCM4707-BCM53018-chip-.patch} (100%) rename target/linux/generic/patches-4.4/{071-0002-bgmac-support-Ethernet-device-on-BCM47094-SoC.patch => 070-v4.6-0002-bgmac-support-Ethernet-device-on-BCM47094-SoC.patch} (100%) rename target/linux/generic/patches-4.4/{071-0003-bgmac-reset-enable-Ethernet-core-before-using-it.patch => 070-v4.6-0003-bgmac-reset-enable-Ethernet-core-before-using-it.patch} (100%) rename target/linux/generic/patches-4.4/{071-0004-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch => 070-v4.6-0004-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch} (100%) rename target/linux/generic/patches-4.4/{072-0001-bgmac-Bind-net_device-with-backing-device-structure.patch => 070-v4.8-0001-bgmac-Bind-net_device-with-backing-device-structure.patch} (100%) rename target/linux/generic/patches-4.4/{072-0002-bgmac-Add-support-for-ethtool-statistics.patch => 070-v4.8-0002-bgmac-Add-support-for-ethtool-statistics.patch} (100%) rename target/linux/generic/patches-4.4/{072-0003-bgmac-Maintain-some-netdev-statistics.patch => 070-v4.8-0003-bgmac-Maintain-some-netdev-statistics.patch} (100%) rename target/linux/generic/patches-4.4/{073-0001-net-ethernet-bgmac-use-phydev-from-struct-net_device.patch => 070-v4.8-0004-net-ethernet-bgmac-use-phydev-from-struct-net_device.patch} (100%) rename target/linux/generic/patches-4.4/{074-0001-net-bgmac-Fix-SOF-bit-checking.patch => 071-v4.7-0001-net-bgmac-Fix-SOF-bit-checking.patch} (100%) rename target/linux/generic/patches-4.4/{074-0002-net-bgmac-Start-transmit-queue-in-bgmac_open.patch => 071-v4.7-0002-net-bgmac-Start-transmit-queue-in-bgmac_open.patch} (100%) rename target/linux/generic/patches-4.4/{074-0003-net-bgmac-Remove-superflous-netif_carrier_on.patch => 071-v4.7-0003-net-bgmac-Remove-superflous-netif_carrier_on.patch} (100%) rename target/linux/generic/patches-4.4/{075-0001-net-ethernet-bgmac-change-bgmac_-prints-to-dev_-prin.patch => 071-v4.8-0001-net-ethernet-bgmac-change-bgmac_-prints-to-dev_-prin.patch} (100%) rename target/linux/generic/patches-4.4/{075-0002-net-ethernet-bgmac-add-dma_dev-pointer.patch => 071-v4.8-0002-net-ethernet-bgmac-add-dma_dev-pointer.patch} (100%) rename target/linux/generic/patches-4.4/{075-0003-net-ethernet-bgmac-move-BCMA-MDIO-Phy-code-into-a-se.patch => 071-v4.8-0003-net-ethernet-bgmac-move-BCMA-MDIO-Phy-code-into-a-se.patch} (100%) rename target/linux/generic/patches-4.4/{075-0004-net-ethernet-bgmac-convert-to-feature-flags.patch => 071-v4.8-0004-net-ethernet-bgmac-convert-to-feature-flags.patch} (100%) rename target/linux/generic/patches-4.4/{075-0005-net-ethernet-bgmac-Add-platform-device-support.patch => 071-v4.8-0005-net-ethernet-bgmac-Add-platform-device-support.patch} (100%) rename target/linux/generic/patches-4.4/{076-0001-net-ethernet-bgmac-Fix-return-value-check-in-bgmac_p.patch => 071-v4.8-0006-net-ethernet-bgmac-Fix-return-value-check-in-bgmac_p.patch} (100%) rename target/linux/generic/patches-4.4/{076-0002-net-ethernet-bgmac-Remove-redundant-dev_err-call-in-.patch => 071-v4.8-0007-net-ethernet-bgmac-Remove-redundant-dev_err-call-in-.patch} (100%) rename target/linux/generic/patches-4.4/{076-0004-net-bgmac-fix-reversed-check-for-MII-registration-er.patch => 071-v4.8-0009-net-bgmac-fix-reversed-check-for-MII-registration-er.patch} (100%) rename target/linux/generic/patches-4.4/{077-0001-net-bgmac-support-Ethernet-core-on-BCM53573-SoCs.patch => 071-v4.9-0001-net-bgmac-support-Ethernet-core-on-BCM53573-SoCs.patch} (100%) rename target/linux/generic/patches-4.4/{077-0002-net-bgmac-make-it-clear-when-setting-interface-type-.patch => 071-v4.9-0002-net-bgmac-make-it-clear-when-setting-interface-type-.patch} (100%) rename target/linux/generic/patches-4.4/{077-0003-net-bgmac-Fix-errant-feature-flag-check.patch => 071-v4.9-0003-net-bgmac-Fix-errant-feature-flag-check.patch} (100%) rename target/linux/generic/patches-4.4/{077-0004-net-bgmac-fix-spelling-mistake-connecton-connection.patch => 071-v4.9-0004-net-bgmac-fix-spelling-mistake-connecton-connection.patch} (100%) rename target/linux/generic/patches-4.4/{170-net-bgmac-fix-reversed-checks-for-clock-control-flag.patch => 071-v4.9-0005-net-bgmac-fix-reversed-checks-for-clock-control-flag.patch} (86%) create mode 100644 target/linux/generic/patches-4.4/072-net-add-devm-version-of-alloc_etherdev_mqs-function.patch create mode 100644 target/linux/generic/patches-4.4/073-v4.10-0001-net-bgmac-allocate-struct-bgmac-just-once-don-t-copy.patch create mode 100644 target/linux/generic/patches-4.4/073-v4.10-0002-net-bgmac-drop-struct-bcma_mdio-we-don-t-need-anymor.patch create mode 100644 target/linux/generic/patches-4.4/073-v4.10-0003-net-bgmac-use-PHY-subsystem-for-initializing-PHY.patch create mode 100644 target/linux/generic/patches-4.4/078-0003-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch create mode 100644 target/linux/generic/patches-4.4/078-0004-net-phy-pick-Broadcom-drivers-updates-from-net-next-.patch create mode 100644 target/linux/generic/patches-4.4/180-Revert-bcma-init-serial-console-directly-from-ChipCo.patch delete mode 100644 target/linux/ramips/dts/GB-PC1.dts create mode 100644 target/linux/ramips/dts/OMEGA2.dts create mode 100644 target/linux/ramips/dts/OMEGA2.dtsi create mode 100644 target/linux/ramips/dts/OMEGA2P.dts create mode 100644 target/linux/ramips/dts/VOCORE2.dts create mode 100644 target/linux/ramips/image/mt7620.mk create mode 100644 target/linux/ramips/mt7620/config-4.4 create mode 100644 target/linux/ramips/mt7620/profiles/00-default.mk create mode 100644 target/linux/ramips/mt7620/target.mk create mode 100644 target/linux/ramips/mt7628/config-4.4 create mode 100644 target/linux/ramips/mt7628/profiles/00-default.mk create mode 100644 target/linux/ramips/mt7628/target.mk create mode 100644 target/linux/ramips/mt7688/config-4.4 create mode 100644 target/linux/ramips/mt7688/profiles/00-default.mk create mode 100644 target/linux/ramips/mt7688/target.mk delete mode 100644 target/linux/ramips/patches-4.4/0902-mediatek-4-byte-spi-reset.patch create mode 100644 target/linux/ramips/patches-4.4/200-rt3883-fix-pinctrl-typo.patch create mode 100755 target/linux/x86/base-files/etc/board.d/01_leds create mode 100755 target/linux/x86/base-files/etc/board.d/02_network create mode 100644 target/linux/x86/base-files/etc/diag.sh create mode 100644 target/linux/x86/generic/base-files/lib/preinit/45_mount_xenfs create mode 100644 target/linux/x86/geode/profiles/000-Generic.mk create mode 100644 target/linux/x86/geode/profiles/100-Geos.mk create mode 100644 target/linux/x86/patches-4.4/097-0001-sp5100_tco-Add-AMD-Mullins-platform-support.patch create mode 100644 target/linux/x86/patches-4.4/097-0002-sp5100_tco-Add-AMD-Carrizo-platform-support.patch create mode 100644 target/linux/x86/patches-4.4/097-0003-sp5100_tco-fix-the-device-check-for-SB800-and-later-chipsets.patch create mode 100644 target/linux/x86/patches-4.4/097-0004-watchdog-sp5100_tco-properly-check-for-new-register-.patch delete mode 100644 target/linux/x86/xen_domu/base-files/lib/preinit/45_mount_xenfs delete mode 100644 target/linux/x86/xen_domu/config-default delete mode 100644 target/linux/x86/xen_domu/profiles/000-Generic.mk delete mode 100644 target/linux/x86/xen_domu/target.mk delete mode 100644 toolchain/musl/patches/005-fix-asctime-day-month-names-not-to-vary-by-locale.patch delete mode 100644 toolchain/musl/patches/010-fix-regression-in-tcsetattr-on-all-mips-archs.patch delete mode 100644 toolchain/musl/patches/015-fix-pread-pwrite-syscall-calling-convention-on-sh.patch delete mode 100644 toolchain/musl/patches/020-verify-that-ttyname-refers-to-the-same-file-as-the-fd.patch delete mode 100644 toolchain/musl/patches/025-fix-ffsync-by-changing-it-to-osync.patch delete mode 100644 toolchain/musl/patches/028-fix-printf-regression-with-alt-form-octal-zero-flag-and-field-width.patch delete mode 100644 toolchain/musl/patches/029-fix-ifru_data-and-ifcu_buf-types-in-net-if.h.patch delete mode 100644 toolchain/musl/patches/030-fix-if_indextoname-error-case.patch delete mode 100644 toolchain/musl/patches/031-add-missing-unlocked-and-wcsftime_l-prototypes-to-wchar-header.patch delete mode 100644 toolchain/musl/patches/033-fix-undefined-behavior-in-sched.h-cpu_set_t-usage.patch delete mode 100644 toolchain/musl/patches/035-fix-getservby_r-result-pointer-value-on-error.patch delete mode 100644 toolchain/musl/patches/036-fix-strftime-y-for-negative-tm_year.patch delete mode 100644 toolchain/musl/patches/037-fix-missing-integer-overflow-checks-in-regexec-buffer-size-computations.patch delete mode 100644 toolchain/musl/patches/038-fix-regexec-with-haystack-strings-longer-than-int_max.patch delete mode 100644 toolchain/musl/patches/039-fix-integer-overflow-in-float-printf-needed-precision-computation.patch delete mode 100644 toolchain/musl/patches/040-fix-integer-overflows-and-uncaught-eoverflow-in-printf-core.patch delete mode 100644 toolchain/musl/patches/048-math-fix-pow-signed-shift-ub.patch delete mode 100644 toolchain/musl/patches/049-fix-clock_nanosleep-error-case.patch delete mode 100644 toolchain/musl/patches/050-add-pthread_setname_np.patch delete mode 100644 toolchain/musl/patches/051-fix-float-formatting-of-some-exact-halfway-cases.patch delete mode 100644 toolchain/musl/patches/052-fix-getopt_long_only-misinterpreting-as-an-option.patch delete mode 100644 toolchain/musl/patches/053-fix-gratuitous-undefined-behavior-in-strptime.patch delete mode 100644 toolchain/musl/patches/054-fix-strtod-and-strtof-rounding-with-many-trailing-zeros.patch delete mode 100644 toolchain/musl/patches/055-fix-strtod-int-optimization-in-non-nearest-rounding-mode.patch delete mode 100644 toolchain/musl/patches/065-fix-integer-overflow-of-tm_year-in-__secs_to_tm.patch delete mode 100644 toolchain/musl/patches/066-fix-swprintf-internal-buffer-state-and-error-handling.patch delete mode 100644 toolchain/musl/patches/071-fix-build-regression-on-archs-with-variable-page-size.patch rename toolchain/musl/patches/{099-Add-format-attribute-to-some-function-declarations.patch => 400-Add-format-attribute-to-some-function-declarations.patch} (100%) delete mode 100644 toolchain/musl/patches/400-fix_quoted_timezone.patch create mode 100644 tools/cmake/patches/150-bootstrap_parallel_make_flag.patch delete mode 100644 tools/kernel2minor/patches/100-portability.patch delete mode 100644 tools/kernel2minor/patches/110-fix_endian_conv.patch delete mode 100644 tools/kernel2minor/patches/120-fix_create_mode.patch diff --git a/Makefile b/Makefile index 5b7fdc963f..b220dfd3c5 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ export TOPDIR LC_ALL LANG TZ empty:= space:= $(empty) $(empty) -$(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the libreCMC directory must not include any spaces)) +$(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the LEDE directory must not include any spaces)) world: diff --git a/config/Config-build.in b/config/Config-build.in index 9b8e4b2283..e0889fcccf 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -9,7 +9,7 @@ menu "Global build settings" config ALL_NONSHARED bool "Select all target specific packages by default" - default ALL + default ALL || BUILDBOT config ALL_KMODS bool "Select all kernel module packages by default" @@ -19,6 +19,16 @@ menu "Global build settings" bool "Select all userspace packages by default" default n + config BUILDBOT + bool "Set build defaults for automatic builds (e.g. via buildbot)" + default n + help + This option changes several defaults to be more suitable for + automatic builds. This includes the following changes: + - Deleting build directories after compiling (to save space) + - Enabling per-device rootfs support + ... + config SIGNED_PACKAGES bool "Cryptographically signed package lists" default y @@ -61,7 +71,7 @@ menu "Global build settings" bool prompt "Collect kernel debug information" select KERNEL_DEBUG_INFO - default n + default BUILDBOT help This collects debugging symbols from the kernel and all compiled modules. Useful for release builds, so that kernel issues can be debugged offline diff --git a/config/Config-devel.in b/config/Config-devel.in index 938f0b3c9c..1ea66720b8 100644 --- a/config/Config-devel.in +++ b/config/Config-devel.in @@ -59,7 +59,7 @@ menuconfig DEVEL bool "Use ccache" if DEVEL default n help - Compiler cache; see http://ccache.samba.org/. + Compiler cache; see https://ccache.samba.org/ config EXTERNAL_KERNEL_TREE string "Use external kernel tree" if DEVEL diff --git a/config/Config-images.in b/config/Config-images.in index 8e295939d9..f59a33613d 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -201,7 +201,6 @@ menu "Target Images" int "Serial port baud rate" depends on GRUB_IMAGES default 38400 if TARGET_x86_generic - default 38400 if TARGET_x86_geode default 115200 config GRUB_BOOTOPTS diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 3f30013845..a4c46f55ae 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -26,7 +26,7 @@ config KERNEL_PRINTK config KERNEL_CRASHLOG bool "Crash logging" - depends on !(arm || powerpc || sparc || TARGET_uml) + depends on !(arm || powerpc || sparc || TARGET_uml || i386 || x86_64) default y config KERNEL_SWAP diff --git a/include/autotools.mk b/include/autotools.mk index 63edd5bddd..c6aa47e0be 100644 --- a/include/autotools.mk +++ b/include/autotools.mk @@ -85,11 +85,11 @@ endef define gettext_version_target (cd $(PKG_BUILD_DIR) && \ - GETTEXT_VERSION=$(shell $(STAGING_DIR)/host/bin/gettext -V | $(STAGING_DIR_HOST)/bin/sed -ne '1s/.*\([0-9]\.[0-9]\{2\}\.[0-9]\).*/\1/p' ) && \ + GETTEXT_VERSION=$(shell $(STAGING_DIR_HOSTPKG)/bin/gettext -V | $(STAGING_DIR_HOST)/bin/sed -ne '1s/.*\([0-9]\.[0-9]\{2\}\.[0-9]\).*/\1/p' ) && \ $(STAGING_DIR_HOST)/bin/sed \ -i $(PKG_BUILD_DIR)/configure.ac \ -e "s/AM_GNU_GETTEXT_VERSION(.*)/AM_GNU_GETTEXT_VERSION(\[$$$$GETTEXT_VERSION\])/g" && \ - $(STAGING_DIR)/host/bin/autopoint --force \ + $(STAGING_DIR_HOSTPKG)/bin/autopoint --force \ ); endef diff --git a/include/cmake.mk b/include/cmake.mk index 5f572e9d74..5a403cbf41 100644 --- a/include/cmake.mk +++ b/include/cmake.mk @@ -107,3 +107,7 @@ define Host/Configure/Default $(HOST_CMAKE_SOURCE_DIR) \ ) endef + +MAKE_FLAGS += \ + CMAKE_COMMAND='$$(if $$(CMAKE_DISABLE_$$@),:,$(STAGING_DIR_HOST)/bin/cmake)' \ + CMAKE_DISABLE_cmake_check_build_system=1 diff --git a/include/download.mk b/include/download.mk index 1b981f14b1..ae3167091e 100644 --- a/include/download.mk +++ b/include/download.mk @@ -94,13 +94,10 @@ endif C_md5_deprecated = Use of $(2) is deprecated, switch to $(3) -# Skip MD5SUM check in feeds until OpenWrt is updated -ifneq ($(filter $(foreach dir,package tools toolchain, $(TOPDIR)/$(dir)/%),$(CURDIR)),) check_md5 = \ $(if $(filter-out x,$(1)), \ $(call check_warn,md5_deprecated,$(1),$(2),$(3)) \ ) -endif hash_var = $(if $(filter-out x,$(1)),MD5SUM,HASH) endif diff --git a/include/feeds.mk b/include/feeds.mk index 2ff57e5762..054b5aa796 100644 --- a/include/feeds.mk +++ b/include/feeds.mk @@ -10,7 +10,7 @@ FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*)) FEEDS_AVAILABLE:=$(sort $(FEEDS_INSTALLED) $(shell $(SCRIPT_DIR)/feeds list -n)) -FEEDS_ENABLED:=$(foreach feed,$(FEEDS_INSTALLED),$(if $(CONFIG_FEED_$(feed)),$(feed))) +FEEDS_ENABLED:=$(foreach feed,$(FEEDS_AVAILABLE),$(if $(CONFIG_FEED_$(feed)),$(feed))) FEEDS_DISABLED:=$(filter-out $(FEEDS_ENABLED),$(FEEDS_AVAILABLE)) PACKAGE_SUBDIRS=$(PACKAGE_DIR) diff --git a/include/host-build.mk b/include/host-build.mk index 5cfbdeba51..70bf6e5a39 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -67,6 +67,12 @@ HOST_CONFIGURE_ARGS = \ --localstatedir=$(HOST_BUILD_PREFIX)/var \ --sbindir=$(HOST_BUILD_PREFIX)/bin +HOST_MAKE_VARS = \ + CFLAGS="$(HOST_CFLAGS)" \ + CPPFLAGS="$(HOST_CPPFLAGS)" \ + CXXFLAGS="$(HOST_CXXFLAGS)" \ + LDFLAGS="$(HOST_LDFLAGS)" + HOST_MAKE_FLAGS = HOST_CONFIGURE_CMD = $(BASH) ./configure @@ -89,7 +95,8 @@ define Host/Configure endef define Host/Compile/Default - +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ + +$(HOST_MAKE_VARS) \ + $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ $(HOST_MAKE_FLAGS) \ $(1) endef diff --git a/include/image-commands.mk b/include/image-commands.mk index a7acd0ee67..04fa853fbb 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -59,7 +59,7 @@ define Build/fit -D $(DEVICE_NAME) -o $@.its -k $@ \ $(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \ -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ - -A $(ARCH) -v $(LINUX_VERSION) + -A $(LINUX_KARCH) -v $(LINUX_VERSION) PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new @mv $@.new $@ endef diff --git a/include/image.mk b/include/image.mk index 3daee35c48..81519cd183 100644 --- a/include/image.mk +++ b/include/image.mk @@ -143,10 +143,17 @@ endef define Image/BuildKernel/MkFIT $(TOPDIR)/scripts/mkits.sh \ -D $(1) -o $(KDIR)/fit-$(1).its -k $(2) $(if $(3),-d $(3)) -C $(4) -a $(5) -e $(6) \ - -A $(ARCH) -v $(LINUX_VERSION) + -A $(LINUX_KARCH) -v $(LINUX_VERSION) PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/fit-$(1).its $(KDIR)/fit-$(1)$(7).itb endef +ifdef CONFIG_TARGET_IMAGES_GZIP + define Image/Gzip + rm -f $(1).gz + gzip -9n $(1) + endef +endif + # $(1) source dts file # $(2) target dtb file # $(3) extra CPP flags @@ -445,7 +452,8 @@ define Device/Build/kernel endef define Device/Build/image - $$(_TARGET): $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)) + GZ_SUFFIX := $(if $(filter %dtb %gz,$(2)),,$(if $(and $(findstring ext4,$(1)),$(CONFIG_TARGET_IMAGES_GZIP)),.gz)) + $$(_TARGET): $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))$$(GZ_SUFFIX) $(eval $(call Device/Export,$(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)),$(1))) ROOTFS/$(1)/$(3) := \ $(KDIR)/root.$(1)$$(strip \ @@ -462,6 +470,10 @@ define Device/Build/image $$(call concat_cmd,$(if $(IMAGE/$(2)/$(1)),$(IMAGE/$(2)/$(1)),$(IMAGE/$(2)))) .IGNORE: $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)) + + $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)).gz: $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)) + gzip -c -9n $$^ > $$@ + $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)): $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)) cp $$^ $$@ diff --git a/include/kernel-build.mk b/include/kernel-build.mk index 2bf47b17e4..32da94babc 100644 --- a/include/kernel-build.mk +++ b/include/kernel-build.mk @@ -60,7 +60,7 @@ define Download/git-kernel PROTO:=git VERSION:=$(CONFIG_KERNEL_GIT_BRANCH) FILE:=$(LINUX_SOURCE) - SUBDIR:=linux-$(KERNEL_PATCHVER) + SUBDIR:=linux-$(LINUX_VERSION) OPTS:=$(KERNEL_GIT_OPTS) endef diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 7520ce388b..db34f43a41 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .43 -LINUX_VERSION-4.4 = .40 +LINUX_VERSION-4.4 = .52 -LINUX_KERNEL_HASH-3.18.43 = 648a61fb3b1d09a14f50a9ced13977302d57b32e2826877950071dc70541f918 -LINUX_KERNEL_HASH-4.4.40 = a3c006893966ec9bee23edb41eebbe2cf0481efe205bf037ee0cc43ce427fc22 +LINUX_KERNEL_HASH-3.18.43 = +LINUX_KERNEL_HASH-4.4.52 = 0f1faafdae47da5f29e740ff655f91c2eb13c8cdfc4d039d903176bd56c2ecbb ifdef KERNEL_PATCHVER LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER))) diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index e168eb390f..d9b6f77cc4 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -209,11 +209,13 @@ $(_endef) ( \ echo "#!/bin/sh"; \ echo "[ \"\$$$${IPKG_NO_SCRIPT}\" = \"1\" ] && exit 0"; \ + echo "[ -x "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \ echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \ echo "default_postinst \$$$$0 \$$$$@"; \ ) > postinst; \ ( \ echo "#!/bin/sh"; \ + echo "[ -x "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \ echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \ echo "default_prerm \$$$$0 \$$$$@"; \ ) > prerm; \ diff --git a/include/rootfs.mk b/include/rootfs.mk index 90d70a11f2..c014b1d14a 100644 --- a/include/rootfs.mk +++ b/include/rootfs.mk @@ -47,6 +47,14 @@ opkg = \ TARGET_DIR_ORIG := $(TARGET_ROOTFS_DIR)/root.orig-$(BOARD) +ifdef CONFIG_CLEAN_IPKG + define clean_ipkg + -find $(1)/usr/lib/opkg -type f -and -not -name '*.control' | $(XARGS) rm -rf + -sed -i -ne '/^Require-User: /p' $(1)/usr/lib/opkg/info/*.control + -find $(1)/usr/lib/opkg -empty | $(XARGS) rm -rf + endef +endif + define prepare_rootfs @if [ -d $(TOPDIR)/files ]; then \ $(call file_copy,$(TOPDIR)/files/.,$(1)); \ @@ -75,6 +83,6 @@ define prepare_rootfs rm -f $(1)/usr/lib/opkg/lists/* rm -f $(1)/usr/lib/opkg/info/*.postinst* rm -f $(1)/usr/lib/opkg/info/*.prerm* - $(if $(CONFIG_CLEAN_IPKG),rm -rf $(1)/usr/lib/opkg) + $(call clean_ipkg,$(1)) $(call mklibs,$(1)) endef diff --git a/include/target.mk b/include/target.mk index a8d3b2b249..30994485e1 100644 --- a/include/target.mk +++ b/include/target.mk @@ -13,7 +13,7 @@ __target_inc=1 DEVICE_TYPE?=router # Default packages - the really basic set -DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch +DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd # For nas targets DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm # For router targets @@ -164,17 +164,15 @@ ifeq ($(DUMP),1) endif CPU_CFLAGS += -mno-branch-likely CPU_CFLAGS_mips32 = -mips32 -mtune=mips32 - CPU_CFLAGS_mips32r2 = -mips32r2 -mtune=mips32r2 CPU_CFLAGS_mips64 = -mips64 -mtune=mips64 -mabi=64 CPU_CFLAGS_24kc = -mips32r2 -mtune=24kc CPU_CFLAGS_74kc = -mips32r2 -mtune=74kc CPU_CFLAGS_octeon = -march=octeon -mabi=64 endif ifeq ($(ARCH),i386) - CPU_TYPE ?= i486 - CPU_CFLAGS_i486 = -march=i486 + CPU_TYPE ?= pentium + CPU_CFLAGS_pentium = -march=pentium-mmx CPU_CFLAGS_pentium4 = -march=pentium4 - CPU_CFLAGS_geode = -march=geode -mmmx -m3dnow endif ifneq ($(findstring arm,$(ARCH)),) CPU_TYPE ?= xscale @@ -259,6 +257,9 @@ ifeq ($(DUMP),1) ifneq ($(CONFIG_VIRTIO),) FEATURES += virtio endif + ifneq ($(CONFIG_CPU_MIPS32_R2),) + FEATURES += mips16 + endif FEATURES += $(foreach v,6 7,$(if $(CONFIG_CPU_V$(v)),arm_v$(v))) # remove duplicates diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 2c81287bad..58bc7d4b3c 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/version.mk PKG_NAME:=base-files -PKG_RELEASE:=171 +PKG_RELEASE:=172 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ @@ -31,7 +31,7 @@ define Package/base-files SECTION:=base CATEGORY:=Base system DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:lede-keyring +fstools +fwtool - TITLE:=Base filesystem for Lede + TITLE:=Base filesystem for libreCMC URL:=http://openwrt.org/ VERSION:=$(PKG_RELEASE)-$(REVISION) endef @@ -57,6 +57,7 @@ define Package/base-files/conffiles /etc/sysctl.d/local.conf /etc/sysctl.d/ /etc/iproute2/rt_tables +/etc/iproute2/rt_protos $(call $(TARGET)/conffiles) endef diff --git a/package/base-files/files/etc/init.d/system b/package/base-files/files/etc/init.d/system index 0d243a8a99..8c5f677299 100755 --- a/package/base-files/files/etc/init.d/system +++ b/package/base-files/files/etc/init.d/system @@ -7,7 +7,7 @@ USE_PROCD=1 validate_system_section() { uci_validate_section system system "${1}" \ - 'hostname:string:libreCMC' \ + 'hostname:string:lede' \ 'conloglevel:uinteger' \ 'buffersize:uinteger' \ 'timezone:string:UTC' \ diff --git a/package/base-files/files/etc/iproute2/rt_protos b/package/base-files/files/etc/iproute2/rt_protos new file mode 100644 index 0000000000..5b61798aec --- /dev/null +++ b/package/base-files/files/etc/iproute2/rt_protos @@ -0,0 +1,18 @@ +# +# Reserved protocols. +# +0 unspec +1 redirect +2 kernel +3 boot +4 static +8 gated +9 ra +10 mrt +11 zebra +12 bird +13 dnrouted +14 xorp +15 ntk +16 dhcp +42 babel diff --git a/package/base-files/files/etc/openwrt_release b/package/base-files/files/etc/openwrt_release index 46ad63209f..da86208f7f 100644 --- a/package/base-files/files/etc/openwrt_release +++ b/package/base-files/files/etc/openwrt_release @@ -3,5 +3,6 @@ DISTRIB_RELEASE='%V' DISTRIB_REVISION='%R' DISTRIB_CODENAME='%n' DISTRIB_TARGET='%S' +DISTRIB_ARCH='%A' DISTRIB_DESCRIPTION='%D %N %V %C' DISTRIB_TAINTS='%t' diff --git a/package/base-files/files/etc/uci-defaults/13_fix_group_user b/package/base-files/files/etc/uci-defaults/13_fix_group_user index deade5bbd1..e6dae2419f 100644 --- a/package/base-files/files/etc/uci-defaults/13_fix_group_user +++ b/package/base-files/files/etc/uci-defaults/13_fix_group_user @@ -2,7 +2,7 @@ . /lib/functions.sh -for file in `grep Require-User /usr/lib/opkg/info/*.control | cut -d: -f1`; do +for file in `grep -sl Require-User /usr/lib/opkg/info/*.control`; do file="${file##*/}" file="${file%.control}" add_group_and_user "${file}" diff --git a/package/base-files/files/lib/preinit/10_sysinfo b/package/base-files/files/lib/preinit/10_sysinfo index be1e6aeca9..65b50968e2 100644 --- a/package/base-files/files/lib/preinit/10_sysinfo +++ b/package/base-files/files/lib/preinit/10_sysinfo @@ -3,7 +3,7 @@ do_sysinfo_generic() { mkdir -p /tmp/sysinfo [ -e /tmp/sysinfo/board_name ] || \ echo "$(strings /proc/device-tree/compatible | head -1)" > /tmp/sysinfo/board_name - [ -n /tmp/sysinfo/model -a -e /proc/device-tree/model ] && \ + [ ! -e /tmp/sysinfo/model -a -e /proc/device-tree/model ] && \ echo "$(cat /proc/device-tree/model)" > /tmp/sysinfo/model } diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index f2845c82f6..83befc0d6f 100755 --- a/package/base-files/files/sbin/wifi +++ b/package/base-files/files/sbin/wifi @@ -6,8 +6,8 @@ usage() { cat <&2 echo "WARNING: Wifi detect is deprecated. Use wifi config instead" + >&2 echo "For more information, see commit 5f8f8a366136a07df661e31decce2458357c167a" + exit 1 +} + wifi_config() { [ ! -f /etc/config/wireless ] && touch /etc/config/wireless @@ -229,7 +235,7 @@ scan_wifi case "$1" in down) wifi_updown "disable" "$2";; - detect) ;; + detect) wifi_detect_notice ;; config) wifi_config ;; status) ubus_wifi_cmd "status" "$2";; reload) wifi_reload "$2";; diff --git a/package/base-files/files/usr/lib/os-release b/package/base-files/files/usr/lib/os-release index 79b08d16cf..21abf969e1 100644 --- a/package/base-files/files/usr/lib/os-release +++ b/package/base-files/files/usr/lib/os-release @@ -9,6 +9,7 @@ BUG_URL="%b" SUPPORT_URL="%s" BUILD_ID="%R" LEDE_BOARD="%S" +LEDE_ARCH="%A" LEDE_TAINTS="%t" LEDE_DEVICE_MANUFACTURER="%M" LEDE_DEVICE_MANUFACTURER_URL="%m" diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index abcc5a0108..3cdb6df0c2 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -92,7 +92,7 @@ config TARGET_PREINIT_NETMASK config TARGET_PREINIT_BROADCAST string prompt "Broadcast address for preinit network messages" if PREINITOPT - default "192.168.10.255" + default "192.168.1.255" help Broadcast address to which to send preinit network messages, as as failsafe messages @@ -190,7 +190,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "http://downloads.lede-project.org/snapshots" + default "http://downloads.lede-project.org/releases/17.01-SNAPSHOT" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: @@ -286,7 +286,7 @@ menuconfig PER_FEED_REPO config PER_FEED_REPO_ADD_COMMENTED bool "Comment out not enabled feeds" - default y + default !BUILDBOT depends on PER_FEED_REPO && PER_FEED_REPO_ADD_DISABLED help Add not enabled feeds as commented out source lines to opkg.conf. diff --git a/package/boot/apex/Makefile b/package/boot/apex/Makefile new file mode 100644 index 0000000000..fb3c77c37c --- /dev/null +++ b/package/boot/apex/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2006-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=apex +PKG_VERSION:=1.6.9 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/ +PKG_HASH:=1d2bc04c2c6bb3d2d6c1916b6dc559cda2b1ecb045d7801fd49af6af4234abeb +PKG_TARGETS:=bin + +include $(INCLUDE_DIR)/package.mk + +export GCC_HONOUR_COPTS=s + +define Package/apex + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_ixp4xx + DEFAULT:=y + TITLE:=Boot loader for NSLU2, FSG3, NAS100D and others + URL:=http://wiki.buici.com/wiki/Apex_Bootloader +endef + +define build_apex + $(MAKE) -C $(PKG_BUILD_DIR) \ + ARCH=arm \ + $(1)_config + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + KBUILD_HAVE_NLS=no \ + ARCH=arm \ + clean all + $(INSTALL_BIN) $(PKG_BUILD_DIR)/apex.bin $(PKG_BUILD_DIR)/out/apex-$(2).bin +endef + +define Build/Compile + $(INSTALL_DIR) $(PKG_BUILD_DIR)/out + $(call build_apex,slugos-nslu2-armeb,nslu2-armeb) + $(call build_apex,slugos-nslu2-16mb-armeb,nslu2-16mb-armeb) + $(call build_apex,slugos-fsg3-armeb,fsg3-armeb) + $(call build_apex,slugos-nas100d-armeb,nas100d-armeb) +endef + +define Package/apex/install + $(INSTALL_DIR) $(STAGING_DIR)/apex + $(CP) $(PKG_BUILD_DIR)/out/*.bin $(1)/ +endef + +define Build/InstallDev + $(CP) $(PKG_BUILD_DIR)/out/*.bin $(KERNEL_BUILD_DIR) +endef + +$(eval $(call BuildPackage,apex)) diff --git a/package/boot/apex/patches/001-compile_fix.patch b/package/boot/apex/patches/001-compile_fix.patch new file mode 100644 index 0000000000..8a25de6570 --- /dev/null +++ b/package/boot/apex/patches/001-compile_fix.patch @@ -0,0 +1,20 @@ +--- a/Makefile ++++ b/Makefile +@@ -444,7 +444,7 @@ ifeq ($(config-targets),1) + include $(srctree)/src/arch-$(SRCARCH)/Makefile + export KBUILD_DEFCONFIG + +-config %config: scripts_basic outputmakefile FORCE ++%config: scripts_basic outputmakefile FORCE + $(Q)mkdir -p include/linux include/config + $(Q)$(MAKE) $(build)=scripts/kconfig $@ + +@@ -1585,7 +1585,7 @@ endif + $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) + + # Modules +-/ %/: prepare scripts FORCE ++%/: prepare scripts FORCE + $(cmd_crmodverdir) + $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ + $(build)=$(build-dir) diff --git a/package/boot/apex/patches/100-openwrt_nslu2_armeb_config.patch b/package/boot/apex/patches/100-openwrt_nslu2_armeb_config.patch new file mode 100644 index 0000000000..d598ff3287 --- /dev/null +++ b/package/boot/apex/patches/100-openwrt_nslu2_armeb_config.patch @@ -0,0 +1,23 @@ +--- a/src/mach-ixp42x/slugos-nslu2-armeb_config ++++ b/src/mach-ixp42x/slugos-nslu2-armeb_config +@@ -19,7 +19,7 @@ CONFIG_EXPERIMENTAL=y + # + # General Setup + # +-CONFIG_TARGET_DESCRIPTION="SlugOS NSLU2 (bigendian)" ++CONFIG_TARGET_DESCRIPTION="OpenWrt NSLU2 (8MiB Flash)" + CONFIG_CROSS_COMPILE="" + CONFIG_AEABI=y + # CONFIG_DRIVER_LONG_LONG_SIZE is not set +@@ -163,9 +163,9 @@ CONFIG_ENV_REGION_KERNEL_ALT="fis://kern + # Overrides + # + CONFIG_ENV_DEFAULT_CMDLINE_OVERRIDE=y +-CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/mtdblock4 rootfstype=jffs2 console=ttyS0,115200 init=/linuxrc" ++CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/mtdblock4 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd" + CONFIG_ENV_DEFAULT_CMDLINE_ALT_P=y +-CONFIG_ENV_DEFAULT_CMDLINE_ALT="root=/dev/mtdblock4 rootfstype=jffs2 console=ttyS0,115200 init=/linuxrc" ++CONFIG_ENV_DEFAULT_CMDLINE_ALT="root=/dev/mtdblock4 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd" + # CONFIG_ENV_DEFAULT_STARTUP_OVERRIDE is not set + # CONFIG_ENV_DEFAULT_STARTUP_ALT_P is not set + CONFIG_USES_NOR_BOOTFLASH=y diff --git a/package/boot/apex/patches/120-openwrt_nslu2_16mb_armeb_config.patch b/package/boot/apex/patches/120-openwrt_nslu2_16mb_armeb_config.patch new file mode 100644 index 0000000000..5e7ecee27c --- /dev/null +++ b/package/boot/apex/patches/120-openwrt_nslu2_16mb_armeb_config.patch @@ -0,0 +1,23 @@ +--- a/src/mach-ixp42x/slugos-nslu2-16mb-armeb_config ++++ b/src/mach-ixp42x/slugos-nslu2-16mb-armeb_config +@@ -19,7 +19,7 @@ CONFIG_EXPERIMENTAL=y + # + # General Setup + # +-CONFIG_TARGET_DESCRIPTION="SlugOS NSLU2/BE (16MiB Flash)" ++CONFIG_TARGET_DESCRIPTION="OpenWrt NSLU2 (16MiB Flash)" + CONFIG_CROSS_COMPILE="" + CONFIG_AEABI=y + # CONFIG_DRIVER_LONG_LONG_SIZE is not set +@@ -163,9 +163,9 @@ CONFIG_ENV_REGION_KERNEL_ALT="fis://kern + # Overrides + # + CONFIG_ENV_DEFAULT_CMDLINE_OVERRIDE=y +-CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/mtdblock4 rootfstype=jffs2 console=ttyS0,115200 init=/linuxrc" ++CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/mtdblock4 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd" + CONFIG_ENV_DEFAULT_CMDLINE_ALT_P=y +-CONFIG_ENV_DEFAULT_CMDLINE_ALT="root=/dev/mtdblock4 rootfstype=jffs2 console=ttyS0,115200 init=/linuxrc" ++CONFIG_ENV_DEFAULT_CMDLINE_ALT="root=/dev/mtdblock4 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd" + # CONFIG_ENV_DEFAULT_STARTUP_OVERRIDE is not set + # CONFIG_ENV_DEFAULT_STARTUP_ALT_P is not set + CONFIG_USES_NOR_BOOTFLASH=y diff --git a/package/boot/apex/patches/140-openwrt_fsg3_armeb_config.patch b/package/boot/apex/patches/140-openwrt_fsg3_armeb_config.patch new file mode 100644 index 0000000000..fc0e8b9f3d --- /dev/null +++ b/package/boot/apex/patches/140-openwrt_fsg3_armeb_config.patch @@ -0,0 +1,23 @@ +--- a/src/mach-ixp42x/slugos-fsg3-armeb_config ++++ b/src/mach-ixp42x/slugos-fsg3-armeb_config +@@ -17,7 +17,7 @@ CONFIG_EXPERIMENTAL=y + # + # General Setup + # +-CONFIG_TARGET_DESCRIPTION="SlugOS FSG3/BE" ++CONFIG_TARGET_DESCRIPTION="OpenWrt FSG3" + CONFIG_CROSS_COMPILE="" + CONFIG_AEABI=y + CONFIG_CC_OPTIMIZE_FOR_SIZE=y +@@ -148,9 +148,9 @@ CONFIG_ENV_REGION_KERNEL_ALT="fis://kern + # Overrides + # + CONFIG_ENV_DEFAULT_CMDLINE_OVERRIDE=y +-CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/sda1 rootdelay=10 console=ttyS0,115200" ++CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/sda1 rootdelay=10 console=ttyS0,115200 init=/etc/preinit noinitrd" + CONFIG_ENV_DEFAULT_CMDLINE_ALT_P=y +-CONFIG_ENV_DEFAULT_CMDLINE_ALT="root=/dev/sda2 rootdelay=10 console=ttyS0,115200" ++CONFIG_ENV_DEFAULT_CMDLINE_ALT="root=/dev/mtdblock2 rootfstype=squashfs console=ttyS0,115200 init=/etc/preinit noinitrd" + # CONFIG_ENV_DEFAULT_STARTUP_OVERRIDE is not set + # CONFIG_ENV_DEFAULT_STARTUP_ALT_P is not set + CONFIG_USES_NOR_BOOTFLASH=y diff --git a/package/boot/apex/patches/150-limit_ram_to_64mb.patch b/package/boot/apex/patches/150-limit_ram_to_64mb.patch new file mode 100644 index 0000000000..3e178166e1 --- /dev/null +++ b/package/boot/apex/patches/150-limit_ram_to_64mb.patch @@ -0,0 +1,22 @@ +--- a/src/mach-ixp42x/slugos-nslu2-armeb_config ++++ b/src/mach-ixp42x/slugos-nslu2-armeb_config +@@ -137,7 +137,7 @@ CONFIG_AUTOBOOT_DELAY=10 + CONFIG_ENV_STARTUP_KERNEL_COPY=y + # CONFIG_ENV_REGION_KERNEL_SWAP is not set + CONFIG_ENV_STARTUP_PREFIX_P=y +-CONFIG_ENV_STARTUP_PREFIX="sdram-init; memscan -u 0+256m" ++CONFIG_ENV_STARTUP_PREFIX="sdram-init; memscan -u 0+64m" + + # + # Regions +--- a/src/mach-ixp42x/slugos-nslu2-16mb-armeb_config ++++ b/src/mach-ixp42x/slugos-nslu2-16mb-armeb_config +@@ -137,7 +137,7 @@ CONFIG_AUTOBOOT_DELAY=10 + CONFIG_ENV_STARTUP_KERNEL_COPY=y + # CONFIG_ENV_REGION_KERNEL_SWAP is not set + CONFIG_ENV_STARTUP_PREFIX_P=y +-CONFIG_ENV_STARTUP_PREFIX="sdram-init; memscan -u 0+256m" ++CONFIG_ENV_STARTUP_PREFIX="sdram-init; memscan -u 0+64m" + + # + # Regions diff --git a/package/boot/apex/patches/160-openwrt_nas100d_armeb_config.patch b/package/boot/apex/patches/160-openwrt_nas100d_armeb_config.patch new file mode 100644 index 0000000000..e190964857 --- /dev/null +++ b/package/boot/apex/patches/160-openwrt_nas100d_armeb_config.patch @@ -0,0 +1,20 @@ +--- a/src/mach-ixp42x/slugos-nas100d-armeb_config ++++ b/src/mach-ixp42x/slugos-nas100d-armeb_config +@@ -19,7 +19,7 @@ CONFIG_EXPERIMENTAL=y + # + # General Setup + # +-CONFIG_TARGET_DESCRIPTION="SlugOS NAS100D/BE" ++CONFIG_TARGET_DESCRIPTION="OpenWrt NAS100D" + CONFIG_CROSS_COMPILE="" + CONFIG_AEABI=y + # CONFIG_DRIVER_LONG_LONG_SIZE is not set +@@ -158,7 +158,7 @@ CONFIG_ENV_REGION_KERNEL="fis://kernel" + # Overrides + # + CONFIG_ENV_DEFAULT_CMDLINE_OVERRIDE=y +-CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/mtdblock2 rootfstype=jffs2 console=ttyS0,115200 init=/linuxrc" ++CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd" + # CONFIG_ENV_DEFAULT_STARTUP_OVERRIDE is not set + CONFIG_USES_NOR_BOOTFLASH=y + CONFIG_RELOCATE_SIMPLE=y diff --git a/package/boot/fconfig/Makefile b/package/boot/fconfig/Makefile index 077c6e4889..3c33d73c69 100644 --- a/package/boot/fconfig/Makefile +++ b/package/boot/fconfig/Makefile @@ -13,7 +13,7 @@ PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://andrzejekiert.ovh.org/software/fconfig/ -PKG_MD5SUM:=dac355e9f2a0f48c414c52e2034b6346 +PKG_HASH:=4ff0e8f07e35e46b705c0dbe9d9544ede01ea092a69e3f7db03e55a3f2bb8eb7 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) diff --git a/package/boot/grub2/Makefile b/package/boot/grub2/Makefile index 02e6637c32..fde4b1276d 100644 --- a/package/boot/grub2/Makefile +++ b/package/boot/grub2/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=grub -PKG_VERSION:=2.02~beta2 +PKG_VERSION:=2.02~rc1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz @@ -17,13 +17,16 @@ PKG_SOURCE_URL:=http://alpha.gnu.org/gnu/grub \ http://gnualpha.uib.no/grub/ \ http://mirrors.fe.up.pt/pub/gnu-alpha/grub/ \ http://www.nic.funet.fi/pub/gnu/alpha/gnu/grub/ -PKG_MD5SUM:=be62932eade308a364ea4bbc91295930 +PKG_HASH:=445239e9b96d1143c194c1d37851cf4196b83701c60172e49665e9d453d80278 +PKG_FIXUP:=autoreconf HOST_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=grub2/host PKG_SSP:=0 +PKG_FLAGS:=nonshared + include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk @@ -50,6 +53,9 @@ endef HOST_BUILD_PREFIX := $(STAGING_DIR_HOST) +CONFIGURE_VARS += \ + grub_build_mkfont_excuse="don't want fonts" + CONFIGURE_ARGS += \ --target=$(REAL_GNU_TARGET_NAME) \ --disable-werror \ @@ -58,7 +64,11 @@ CONFIGURE_ARGS += \ --disable-libzfs \ --disable-grub-mkfont +HOST_CONFIGURE_VARS += \ + grub_build_mkfont_excuse="don't want fonts" + HOST_CONFIGURE_ARGS += \ + --disable-grub-mkfont \ --target=$(REAL_GNU_TARGET_NAME) \ --sbindir="$(STAGING_DIR_HOST)/bin" \ --disable-werror \ diff --git a/package/boot/grub2/patches/100-grub_setup_root.patch b/package/boot/grub2/patches/100-grub_setup_root.patch index 9619c410b8..f053ba95e2 100644 --- a/package/boot/grub2/patches/100-grub_setup_root.patch +++ b/package/boot/grub2/patches/100-grub_setup_root.patch @@ -17,7 +17,7 @@ int force; int fs_probe; int allow_floppy; -@@ -178,6 +181,13 @@ argp_parser (int key, char *arg, struct +@@ -178,6 +181,13 @@ argp_parser (int key, char *arg, struct argp_state *state) arguments->dev_map = xstrdup (arg); break; @@ -42,7 +42,7 @@ --- a/util/setup.c +++ b/util/setup.c -@@ -247,13 +247,12 @@ identify_partmap (grub_disk_t disk __att +@@ -247,13 +247,12 @@ identify_partmap (grub_disk_t disk __attribute__ ((unused)), void SETUP (const char *dir, const char *boot_file, const char *core_file, @@ -69,7 +69,7 @@ char **root_devices = grub_guess_root_devices (dir); char **cur; int found = 0; -@@ -317,6 +319,8 @@ SETUP (const char *dir, +@@ -320,6 +322,8 @@ SETUP (const char *dir, char *drive; grub_device_t try_dev; @@ -80,7 +80,7 @@ continue; --- a/include/grub/util/install.h +++ b/include/grub/util/install.h -@@ -182,13 +182,13 @@ grub_install_get_image_target (const cha +@@ -184,13 +184,13 @@ grub_install_get_image_target (const char *arg); void grub_util_bios_setup (const char *dir, const char *boot_file, const char *core_file, @@ -98,7 +98,7 @@ --- a/util/grub-install.c +++ b/util/grub-install.c -@@ -1660,7 +1660,7 @@ main (int argc, char *argv[]) +@@ -1673,7 +1673,7 @@ main (int argc, char *argv[]) /* Now perform the installation. */ if (install_bootsector) grub_util_bios_setup (platdir, "boot.img", "core.img", @@ -107,12 +107,12 @@ fs_probe, allow_floppy, add_rs_codes); break; } -@@ -1686,7 +1686,7 @@ main (int argc, char *argv[]) +@@ -1699,7 +1699,7 @@ main (int argc, char *argv[]) /* Now perform the installation. */ if (install_bootsector) grub_util_sparc_setup (platdir, "boot.img", "core.img", -- install_device, force, -+ NULL, install_device, force, +- install_drive, force, ++ NULL, install_drive, force, fs_probe, allow_floppy, 0 /* unused */ ); break; diff --git a/package/boot/grub2/patches/100-musl-compat.patch b/package/boot/grub2/patches/100-musl-compat.patch deleted file mode 100644 index e3b12be58a..0000000000 --- a/package/boot/grub2/patches/100-musl-compat.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/grub-core/osdep/unix/hostdisk.c -+++ b/grub-core/osdep/unix/hostdisk.c -@@ -48,11 +48,10 @@ - #ifdef __linux__ - # include /* ioctl */ - # include --# if !defined(__GLIBC__) || \ -- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))) -+# if defined(__UCLIBC__) - /* Maybe libc doesn't have large file support. */ - # include /* _llseek */ --# endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */ -+# endif /* __UCLIBC__ */ - #endif /* __linux__ */ - - grub_uint64_t -@@ -79,8 +78,7 @@ grub_util_get_fd_size (grub_util_fd_t fd - return st.st_size; - } - --#if defined(__linux__) && (!defined(__GLIBC__) || \ -- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))) -+#if defined(__linux__) && defined(__UCLIBC__) - /* Maybe libc doesn't have large file support. */ - int - grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off) diff --git a/package/boot/grub2/patches/101-disable-gettext-check-macro-version.patch b/package/boot/grub2/patches/101-disable-gettext-check-macro-version.patch new file mode 100644 index 0000000000..4b850ed2a1 --- /dev/null +++ b/package/boot/grub2/patches/101-disable-gettext-check-macro-version.patch @@ -0,0 +1,13 @@ +diff --git a/po/Makefile.in.in b/po/Makefile.in.in +index 3619458..060e0db 100644 +--- a/po/Makefile.in.in ++++ b/po/Makefile.in.in +@@ -97,7 +97,7 @@ CATALOGS = @CATALOGS@ + mv t-$@ $@ + + +-all: check-macro-version all-@USE_NLS@ ++all: all-@USE_NLS@ + + all-yes: stamp-po + all-no: diff --git a/package/boot/grub2/patches/210-fix_serial_rtscts.patch b/package/boot/grub2/patches/210-fix_serial_rtscts.patch deleted file mode 100644 index d60471c1d1..0000000000 --- a/package/boot/grub2/patches/210-fix_serial_rtscts.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/grub-core/term/serial.c -+++ b/grub-core/term/serial.c -@@ -241,9 +241,9 @@ grub_cmd_serial (grub_extcmd_context_t c - - if (state[OPTION_RTSCTS].set) - { -- if (grub_strcmp (state[OPTION_PARITY].arg, "on") == 0) -+ if (grub_strcmp (state[OPTION_RTSCTS].arg, "on") == 0) - config.rtscts = 1; -- if (grub_strcmp (state[OPTION_PARITY].arg, "off") == 0) -+ else if (grub_strcmp (state[OPTION_RTSCTS].arg, "off") == 0) - config.rtscts = 0; - else - return grub_error (GRUB_ERR_BAD_ARGUMENT, diff --git a/package/boot/kexec-tools/Config.in b/package/boot/kexec-tools/Config.in index 6c7558f30a..03bc6ee804 100644 --- a/package/boot/kexec-tools/Config.in +++ b/package/boot/kexec-tools/Config.in @@ -1,16 +1,6 @@ menu "Configuration" depends on PACKAGE_kexec-tools -config KEXEC_TOOLS_TARGET_NAME - string - prompt "Target name for kexec kernel" - default EXTRA_TARGET_ARCH_NAME if powerpc64 - default ARCH - help - Defines the target type of the kernels that kexec deals - with. This should be the target specification of - the kernel you're booting. - config KEXEC_TOOLS_kdump bool prompt "kdump support" diff --git a/package/boot/kexec-tools/Makefile b/package/boot/kexec-tools/Makefile index 6f04bce7be..ecd2a6ea11 100644 --- a/package/boot/kexec-tools/Makefile +++ b/package/boot/kexec-tools/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=kexec-tools -PKG_VERSION:=2.0.9 +PKG_VERSION:=2.0.14-rc1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec -PKG_MD5SUM:=6681319934e22e74c532bd392ccb1bbb +PKG_HASH:=3fc505ff8d8a2d24c68aac5e6b4783997d5a086966ff3de8b05a0ceb27e5e23b PKG_FIXUP:=autoreconf @@ -24,7 +24,7 @@ include $(INCLUDE_DIR)/package.mk define Package/kexec-tools SECTION:=utils CATEGORY:=Utilities - DEPENDS:=@KERNEL_KEXEC @armeb||@arm||@i386||@powerpc64||@mipsel||@mips +KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma + DEPENDS:=@armeb||@arm||@i386||@x86_64||@powerpc64||@mipsel||@mips +KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma TITLE:=Kernel boots kernel URL:=http://kernel.org/pub/linux/kernel/people/horms/kexec-tools/ MAINTAINER:=Florian Fainelli @@ -40,7 +40,7 @@ define Package/kexec-tools/config source "$(SOURCE)/Config.in" endef -KEXEC_TARGET_NAME:=$(call qstrip,$(CONFIG_KEXEC_TOOLS_TARGET_NAME))-linux-$(TARGET_SUFFIX) +KEXEC_TARGET_NAME:=$(ARCH)-linux-$(TARGET_SUFFIX) CONFIGURE_ARGS = \ --target=$(KEXEC_TARGET_NAME) \ @@ -55,7 +55,8 @@ CONFIGURE_ARGS = \ --libexecdir=/usr/lib \ --sysconfdir=/etc \ $(if $(CONFIG_KEXEC_ZLIB),--with,--without)-zlib \ - $(if $(CONFIG_KEXEC_LZMA),--with,--without)-lzma + $(if $(CONFIG_KEXEC_LZMA),--with,--without)-lzma \ + TARGET_LD="$(TARGET_CROSS)ld" TARGET_CFLAGS += -ffunction-sections -fdata-sections TARGET_LDFLAGS += -Wl,--gc-sections diff --git a/package/boot/kexec-tools/patches/0001-Fix-zlib-lzma-decompression.patch b/package/boot/kexec-tools/patches/0001-Fix-zlib-lzma-decompression.patch deleted file mode 100644 index 06c11ec350..0000000000 --- a/package/boot/kexec-tools/patches/0001-Fix-zlib-lzma-decompression.patch +++ /dev/null @@ -1,171 +0,0 @@ -From d606837b56d46eb7f815b5d85f07fcc3f1555d00 Mon Sep 17 00:00:00 2001 -From: Yousong Zhou -Date: Sun, 1 Feb 2015 00:10:07 +0800 -Subject: [PATCH 1/5] Fix zlib/lzma decompression. - -Let {zlib,lzma}_decompress_file() return NULL if anything wrong happened -to allow the other method to have a chance to run. - -Signed-off-by: Yousong Zhou -Signed-off-by: Simon Horman ---- - kexec/lzma.c | 33 ++++++++++++++++++++++----------- - kexec/zlib.c | 57 +++++++++++++++++++++++++++++++++++---------------------- - 2 files changed, 57 insertions(+), 33 deletions(-) - -diff --git a/kexec/lzma.c b/kexec/lzma.c -index 939aeb3..5bfccb7 100644 ---- a/kexec/lzma.c -+++ b/kexec/lzma.c -@@ -162,13 +162,16 @@ char *lzma_decompress_file(const char *filename, off_t *r_size) - off_t size, allocated; - ssize_t result; - -- if (!filename) { -- *r_size = 0; -- return 0; -- } -+ dbgprintf("Try LZMA decompression.\n"); -+ -+ *r_size = 0; -+ if (!filename) -+ return NULL; -+ - fp = lzopen(filename, "rb"); - if (fp == 0) { -- die("Cannot open `%s'\n", filename); -+ dbgprintf("Cannot open `%s'\n", filename); -+ return NULL; - } - size = 0; - allocated = 65536; -@@ -183,17 +186,25 @@ char *lzma_decompress_file(const char *filename, off_t *r_size) - if ((errno == EINTR) || (errno == EAGAIN)) - continue; - -- die ("read on %s of %ld bytes failed\n", -- filename, (allocated - size) + 0UL); -+ dbgprintf("%s: read on %s of %ld bytes failed\n", -+ __func__, filename, (allocated - size) + 0UL); -+ break; - } - size += result; -- } while(result > 0); -- result = lzclose(fp); -- if (result != LZMA_OK) { -- die ("Close of %s failed\n", filename); -+ } while (result > 0); -+ -+ if (lzclose(fp) != LZMA_OK) { -+ dbgprintf("%s: Close of %s failed\n", __func__, filename); -+ goto fail; - } -+ if (result < 0) -+ goto fail; -+ - *r_size = size; - return buf; -+fail: -+ free(buf); -+ return NULL; - } - #else - char *lzma_decompress_file(const char *UNUSED(filename), off_t *UNUSED(r_size)) -diff --git a/kexec/zlib.c b/kexec/zlib.c -index d44df12..7170ac3 100644 ---- a/kexec/zlib.c -+++ b/kexec/zlib.c -@@ -15,29 +15,39 @@ - #include - #include - -+static void _gzerror(gzFile fp, int *errnum, const char **errmsg) -+{ -+ *errmsg = gzerror(fp, errnum); -+ if (*errnum == Z_ERRNO) { -+ *errmsg = strerror(*errnum); -+ } -+} -+ - char *zlib_decompress_file(const char *filename, off_t *r_size) - { - gzFile fp; - int errnum; - const char *msg; - char *buf; -- off_t size, allocated; -+ off_t size = 0, allocated; - ssize_t result; - -+ dbgprintf("Try gzip decompression.\n"); -+ -+ *r_size = 0; - if (!filename) { -- *r_size = 0; -- return 0; -+ return NULL; - } - fp = gzopen(filename, "rb"); - if (fp == 0) { -- msg = gzerror(fp, &errnum); -- if (errnum == Z_ERRNO) { -- msg = strerror(errno); -- } -- fprintf(stderr, "Cannot open `%s': %s\n", filename, msg); -+ _gzerror(fp, &errnum, &msg); -+ dbgprintf("Cannot open `%s': %s\n", filename, msg); -+ return NULL; -+ } -+ if (gzdirect(fp)) { -+ /* It's not in gzip format */ - return NULL; - } -- size = 0; - allocated = 65536; - buf = xmalloc(allocated); - do { -@@ -49,25 +59,28 @@ char *zlib_decompress_file(const char *filename, off_t *r_size) - if (result < 0) { - if ((errno == EINTR) || (errno == EAGAIN)) - continue; -- -- msg = gzerror(fp, &errnum); -- if (errnum == Z_ERRNO) { -- msg = strerror(errno); -- } -- die ("read on %s of %ld bytes failed: %s\n", -- filename, (allocated - size) + 0UL, msg); -+ _gzerror(fp, &errnum, &msg); -+ dbgprintf("Read on %s of %ld bytes failed: %s\n", -+ filename, (allocated - size) + 0UL, msg); -+ size = 0; -+ goto fail; - } - size += result; - } while(result > 0); -+ -+fail: - result = gzclose(fp); - if (result != Z_OK) { -- msg = gzerror(fp, &errnum); -- if (errnum == Z_ERRNO) { -- msg = strerror(errno); -- } -- die ("Close of %s failed: %s\n", filename, msg); -+ _gzerror(fp, &errnum, &msg); -+ dbgprintf(" Close of %s failed: %s\n", filename, msg); -+ } -+ -+ if (size > 0) { -+ *r_size = size; -+ } else { -+ free(buf); -+ buf = NULL; - } -- *r_size = size; - return buf; - } - #else --- -1.7.10.4 - diff --git a/package/boot/kexec-tools/patches/0002-configure.ac-apply-necessary-quotes-to-result-of-mac.patch b/package/boot/kexec-tools/patches/0002-configure.ac-apply-necessary-quotes-to-result-of-mac.patch deleted file mode 100644 index aba8af7412..0000000000 --- a/package/boot/kexec-tools/patches/0002-configure.ac-apply-necessary-quotes-to-result-of-mac.patch +++ /dev/null @@ -1,52 +0,0 @@ -From eb20884c9bbc42bdf1ccace4444f3ce72657d7d8 Mon Sep 17 00:00:00 2001 -From: Yousong Zhou -Date: Tue, 9 Sep 2014 20:15:16 +0800 -Subject: [PATCH 2/5] configure.ac: apply necessary quotes to result of macro - expansion. - -This can fix the following error when searching for lzma support and -while at it also apply the practice to other uses of the same pattern. - - checking for lzma_code in -llzma... ./configure: line 4756: ac_fn_c_try_link: command not found - -Signed-off-by: Yousong Zhou ---- - configure.ac | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/configure.ac b/configure.ac -index db93331..c410e90 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -152,22 +152,22 @@ AC_CHECK_PROG([DIRNAME], dirname, dirname, "no", [$PATH]) - dnl See if I have a usable copy of zlib available - if test "$with_zlib" = yes ; then - AC_CHECK_HEADER(zlib.h, -- AC_CHECK_LIB(z, inflateInit_, , -- AC_MSG_NOTICE([zlib support disabled]))) -+ [AC_CHECK_LIB(z, inflateInit_, , -+ AC_MSG_NOTICE([zlib support disabled]))]) - fi - - dnl See if I have a usable copy of lzma available - if test "$with_lzma" = yes ; then - AC_CHECK_HEADER(lzma.h, -- AC_CHECK_LIB(lzma, lzma_code, , -- AC_MSG_NOTICE([lzma support disabled]))) -+ [AC_CHECK_LIB(lzma, lzma_code, , -+ AC_MSG_NOTICE([lzma support disabled]))]) - fi - - dnl find Xen control stack libraries - if test "$with_xen" = yes ; then - AC_CHECK_HEADER(xenctrl.h, -- AC_CHECK_LIB(xenctrl, xc_kexec_load, , -- AC_MSG_NOTICE([Xen support disabled]))) -+ [AC_CHECK_LIB(xenctrl, xc_kexec_load, , -+ AC_MSG_NOTICE([Xen support disabled]))]) - fi - - dnl ---Sanity checks --- -1.7.10.4 - diff --git a/package/boot/kexec-tools/patches/0003-mips-fix-compiler-warning-on-printing-64-bit-integer.patch b/package/boot/kexec-tools/patches/0003-mips-fix-compiler-warning-on-printing-64-bit-integer.patch deleted file mode 100644 index f4762e94c5..0000000000 --- a/package/boot/kexec-tools/patches/0003-mips-fix-compiler-warning-on-printing-64-bit-integer.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 89d455d785190203b1d3a8766c8babb8c1688fc3 Mon Sep 17 00:00:00 2001 -From: Yousong Zhou -Date: Mon, 9 Feb 2015 19:51:25 +0800 -Subject: [PATCH 3/5] mips: fix compiler warning on printing 64-bit integer. - - -Signed-off-by: Yousong Zhou ---- - kexec/arch/mips/crashdump-mips.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/kexec/arch/mips/crashdump-mips.c b/kexec/arch/mips/crashdump-mips.c -index e7840e0..98c9f7c 100644 ---- a/kexec/arch/mips/crashdump-mips.c -+++ b/kexec/arch/mips/crashdump-mips.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -52,7 +53,7 @@ static int get_kernel_paddr(struct crash_elf_info *elf_info) - - if (parse_iomem_single("Kernel code\n", &start, NULL) == 0) { - elf_info->kern_paddr_start = start; -- dbgprintf("kernel load physical addr start = 0x%lx\n", start); -+ dbgprintf("kernel load physical addr start = 0x%" PRIu64 "\n", start); - return 0; - } - --- -1.7.10.4 - diff --git a/package/boot/kexec-tools/patches/0004-mips-remove-unused-variable.patch b/package/boot/kexec-tools/patches/0004-mips-remove-unused-variable.patch deleted file mode 100644 index 8626c41347..0000000000 --- a/package/boot/kexec-tools/patches/0004-mips-remove-unused-variable.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 904e9ae892b0592c916a013869e3be3d830e0155 Mon Sep 17 00:00:00 2001 -From: Yousong Zhou -Date: Mon, 9 Feb 2015 20:11:04 +0800 -Subject: [PATCH 4/5] mips: remove unused variable. - -Fixes the following compilation warning. - - kexec/arch/mips/crashdump-mips.c:151:6: warning: unused variable 'i' [-Wunused-variable] - -Signed-off-by: Yousong Zhou ---- - kexec/arch/mips/crashdump-mips.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/kexec/arch/mips/crashdump-mips.c b/kexec/arch/mips/crashdump-mips.c -index 98c9f7c..dc68cb4 100644 ---- a/kexec/arch/mips/crashdump-mips.c -+++ b/kexec/arch/mips/crashdump-mips.c -@@ -148,7 +148,7 @@ static int exclude_crash_reserve_region(int *nr_ranges) - static int get_crash_memory_ranges(struct memory_range **range, int *ranges) - { - const char iomem[] = "/proc/iomem"; -- int i, memory_ranges = 0; -+ int memory_ranges = 0; - char line[MAX_LINE]; - FILE *fp; - unsigned long long start, end; --- -1.7.10.4 - diff --git a/package/boot/kexec-tools/patches/0005-mips-fix-warning-about-implicit-type-conversion.patch b/package/boot/kexec-tools/patches/0005-mips-fix-warning-about-implicit-type-conversion.patch deleted file mode 100644 index 008a62dcfd..0000000000 --- a/package/boot/kexec-tools/patches/0005-mips-fix-warning-about-implicit-type-conversion.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 00e75179b3b4b80e6e58d29a2bd948f97682fd00 Mon Sep 17 00:00:00 2001 -From: Yousong Zhou -Date: Mon, 9 Feb 2015 20:28:14 +0800 -Subject: [PATCH 5/5] mips: fix warning about implicit type conversion. - -Fixes the following warning. - - kexec/arch/mips/kexec-elf-mips.c:161:16: warning: assignment makes integer from pointer without a cast [enabled by default] - -Signed-off-by: Yousong Zhou ---- - kexec/arch/mips/kexec-elf-mips.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/kexec/arch/mips/kexec-elf-mips.c b/kexec/arch/mips/kexec-elf-mips.c -index a27d986..8a6419a 100644 ---- a/kexec/arch/mips/kexec-elf-mips.c -+++ b/kexec/arch/mips/kexec-elf-mips.c -@@ -158,7 +158,7 @@ int elf_mips_load(int argc, char **argv, const char *buf, off_t len, - if (info->kexec_flags & KEXEC_ON_CRASH) - /* In case of crashdump segment[0] is kernel. - * Put cmdline just after it. */ -- cmdline_addr = info->segment[0].mem + -+ cmdline_addr = (unsigned long)info->segment[0].mem + - info->segment[0].memsz; - else - cmdline_addr = 0; --- -1.7.10.4 - diff --git a/package/boot/kexec-tools/patches/100-format_string_fix.patch b/package/boot/kexec-tools/patches/100-format_string_fix.patch new file mode 100644 index 0000000000..601121bcc0 --- /dev/null +++ b/package/boot/kexec-tools/patches/100-format_string_fix.patch @@ -0,0 +1,20 @@ +--- a/kexec/arch/i386/kexec-elf-x86.c ++++ b/kexec/arch/i386/kexec-elf-x86.c +@@ -296,6 +296,6 @@ out: + free(command_line); + free(modified_cmdline); + if (error_msg) +- die(error_msg); ++ die("%s", error_msg); + return result; + } +--- a/kexec/arch/x86_64/kexec-elf-x86_64.c ++++ b/kexec/arch/x86_64/kexec-elf-x86_64.c +@@ -276,6 +276,6 @@ out: + free(command_line); + free(modified_cmdline); + if (error_msg) +- die(error_msg); ++ die("%s", error_msg); + return result; + } diff --git a/package/boot/kexec-tools/patches/110-fix-vmcore-dmsg-compilation-error.patch b/package/boot/kexec-tools/patches/110-fix-vmcore-dmsg-compilation-error.patch new file mode 100644 index 0000000000..0cf2d3ebb5 --- /dev/null +++ b/package/boot/kexec-tools/patches/110-fix-vmcore-dmsg-compilation-error.patch @@ -0,0 +1,11 @@ +--- a/vmcore-dmesg/vmcore-dmesg.c ++++ b/vmcore-dmesg/vmcore-dmesg.c +@@ -1,6 +1,8 @@ + #define _XOPEN_SOURCE 600 + #define _LARGEFILE_SOURCE 1 + #define _FILE_OFFSET_BITS 64 ++#define _GNU_SOURCE ++ + #include + #include + #include diff --git a/package/boot/kobs-ng/Makefile b/package/boot/kobs-ng/Makefile new file mode 100644 index 0000000000..3fa8302b8c --- /dev/null +++ b/package/boot/kobs-ng/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2013-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=kobs-ng +PKG_VERSION:=5.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=imx-kobs-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.freescale.com/lgfiles/NMG/MAD/YOCTO/ +PKG_HASH:=85171b46068ac47c42fedb8104167bf9afd33dd9527ed127e1ca2eb29d7a86bf +PKG_BUILD_DIR:=$(BUILD_DIR)/imx-kobs-$(PKG_VERSION) + +PKG_LICENSE:=GPLv2 +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/kobs-ng + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Application for writing bootstreams to NAND flash + DEPENDS:=@TARGET_imx6 +endef + +define Package/kobs-ng/description + The kobs-ng application writes a bootstream to NAND flash with the proper + FCB/DBBT headers and replicated streams. +endef + +define Build/Prepare + $(call Build/Prepare/Default) + echo "const char* git_sha = \"$(PKG_VERSION)\";" > $(PKG_BUILD_DIR)/autoversion.h +endef + +define Package/kobs-ng/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/kobs-ng $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,kobs-ng)) diff --git a/package/boot/kobs-ng/patches/001-compile.patch b/package/boot/kobs-ng/patches/001-compile.patch new file mode 100644 index 0000000000..67da93a324 --- /dev/null +++ b/package/boot/kobs-ng/patches/001-compile.patch @@ -0,0 +1,23 @@ +--- a/src/mtd.c ++++ b/src/mtd.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include + #include + #include +--- a/src/mtd.h ++++ b/src/mtd.h +@@ -25,8 +25,10 @@ + #ifndef MTD_H + #define MTD_H + ++#define _GNU_SOURCE + #include + #include ++#include + + #include "BootControlBlocks.h" + #include "rom_nand_hamming_code_ecc.h" diff --git a/package/boot/kobs-ng/patches/002-add-init-size-param.patch b/package/boot/kobs-ng/patches/002-add-init-size-param.patch new file mode 100644 index 0000000000..8ad34e9e71 --- /dev/null +++ b/package/boot/kobs-ng/patches/002-add-init-size-param.patch @@ -0,0 +1,45 @@ +Add --chip_0_size param to override the size of the mtd partition which is +required if the SPL does not occupy the entire partition. For Gateworks +Ventana boards the 'uboot' partition contains both the SPL and uboot. +--- a/src/main.c ++++ b/src/main.c +@@ -94,6 +94,7 @@ void usage(void) + " [KOBS] boot structures config options\n" + " --chip_0_device_path= .......... Device of boot (default /dev/mtd0)\n" + " --chip_1_device_path= .......... The second chip in case of multichip NAND\n" ++ " --chip_0_size= ................. Override size of chip_0 device\n" + " --search_exponent= ............ NCB field (default 2)\n" + " --data_setup_time= ............ NCB field (default 80)\n" + " --data_hold_time= ............. NCB field (default 60)\n" +--- a/src/mtd.c ++++ b/src/mtd.c +@@ -876,6 +876,11 @@ struct mtd_data *mtd_open(const struct m + goto out; + } + ++ /* override MTD size */ ++ if (md->cfg.chip_0_size) { ++ miu->size = md->cfg.chip_0_size; ++ } ++ + /* verify it's a nand */ + if (miu->type != MTD_NANDFLASH + && miu->type != MTD_MLCNANDFLASH) { +@@ -3385,7 +3390,7 @@ static const struct { + } mtd_int_args[] = { + ARG_IGNORE(chip_count), + ARG_IGNORE(chip_0_offset), +- ARG_IGNORE(chip_0_size), ++ ARG(chip_0_size), + ARG_IGNORE(chip_1_offset), + ARG_IGNORE(chip_1_size), + ARG(search_exponent), +@@ -3578,7 +3583,7 @@ void mtd_cfg_dump(struct mtd_config *cfg + // Pd(chip_count); + Ps(chip_0_device_path); + // Pd(chip_0_offset); +-// Pd(chip_0_size); ++ Pd(chip_0_size); + Ps(chip_1_device_path); + // Pd(chip_1_offset); + // Pd(chip_1_size); diff --git a/package/boot/kobs-ng/patches/003-raw-mode.patch b/package/boot/kobs-ng/patches/003-raw-mode.patch new file mode 100644 index 0000000000..5a3be5f058 --- /dev/null +++ b/package/boot/kobs-ng/patches/003-raw-mode.patch @@ -0,0 +1,45 @@ +The downstream Freescale vendor kernel has a patch that allows determining +if raw NAND flash mode is provided via a debugfs file. This is not present +in upstream kernels, but the raw access support was added in the 3.19 +kernel, so we will check the kernel version if we can't find the file. +--- a/src/mtd.c ++++ b/src/mtd.c +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + #include "mtd.h" + #include "rand.h" +@@ -808,15 +809,27 @@ struct mtd_data *mtd_open(const struct m + md->cfg = *cfg; + + /* check if use new raw access mode */ ++ /* by looking for debugfs from fsl patch */ ++ md->raw_mode_flag = 0; + fp = fopen("/sys/kernel/debug/gpmi-nand/raw_mode", "r"); + if (!fp) { +- md->raw_mode_flag = 0; +- vp(md, "mtd: use legacy raw access mode\n"); ++ /* fallback to kernel version: raw access added in 3.19 */ ++ struct utsname uts; ++ if (!uname(&uts)) { ++ int major = 0, minor = 0; ++ sscanf(uts.release, "%d.%d", &major, &minor); ++ vp(md, "mtd: Linux %d.%d\n", major, minor); ++ if ((major << 8 | minor) > (3 << 8 | 18)) ++ md->raw_mode_flag = 1; ++ } + } else { + fclose(fp); + md->raw_mode_flag = 1; +- vp(md, "mtd: use new bch layout raw access mode\n"); + } ++ if (md->raw_mode_flag) ++ vp(md, "mtd: use new bch layout raw access mode\n"); ++ else ++ vp(md, "mtd: use legacy raw access mode\n"); + + if (plat_config_data->m_u32UseMultiBootArea) { + diff --git a/package/boot/kobs-ng/patches/004-fix-cal_nfc_geometry.patch b/package/boot/kobs-ng/patches/004-fix-cal_nfc_geometry.patch new file mode 100644 index 0000000000..ebfd62345c --- /dev/null +++ b/package/boot/kobs-ng/patches/004-fix-cal_nfc_geometry.patch @@ -0,0 +1,27 @@ +The Freescale downstream vendor kernel has a patch that exports the bch +flash geometry via a debugfs file. This is not available in mainline linux +kernels so the fallback method calculates the geometry based on known info +from the mtd partition. A bug exists in this funcion where it fails to +assume that block0 ECC is the same as the other blocks by default. +--- a/src/mtd.c ++++ b/src/mtd.c +@@ -610,7 +610,7 @@ static int cal_nfc_geometry(struct mtd_d + /* The two are fixed, please change them when the driver changes. */ + geo->metadata_size_in_bytes = 10; + geo->gf_len = 13; +- geo->ecc_chunkn_size_in_bytes = 512; ++ geo->ecc_chunkn_size_in_bytes = geo->ecc_chunk0_size_in_bytes = 512; + + if (mtd->oobsize > geo->ecc_chunkn_size_in_bytes) { + geo->gf_len = 14; +@@ -700,8 +700,9 @@ int parse_nfc_geometry(struct mtd_data * + unsigned int value; + + if (!plat_config_data->m_u32UseNfcGeo) { ++ /* fsl kernel patch provides bch_geometry via debugfs */ + if (!(node = fopen(dbg_geometry_node_path, "r"))) { +- fprintf(stderr, "Cannot open BCH geometry node: \"%s\"", ++ fprintf(stderr, "Cannot open BCH geometry node: \"%s\"\n", + dbg_geometry_node_path); + return cal_nfc_geometry(md); + } diff --git a/package/boot/rbcfg/Makefile b/package/boot/rbcfg/Makefile new file mode 100644 index 0000000000..412f7ab11a --- /dev/null +++ b/package/boot/rbcfg/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2010 Gabor Juhos +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=rbcfg +PKG_RELEASE:=1 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +PKG_FLAGS:=nonshared + +include $(INCLUDE_DIR)/package.mk + +define Package/rbcfg + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Boot Loaders + TITLE:=RouterBOOT configuration tool + DEPENDS:=@TARGET_ar71xx +endef + +define Package/rbcfg/description + This package contains an utility to manipulate RouterBOOT configuration on the + MikroTIK RB-4XX devices. +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -Wall" \ + LDFLAGS="$(TARGET_LDFLAGS)" +endef + +define Package/rbcfg/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/rbcfg $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,rbcfg)) diff --git a/package/boot/rbcfg/src/Makefile b/package/boot/rbcfg/src/Makefile new file mode 100644 index 0000000000..62c74b2678 --- /dev/null +++ b/package/boot/rbcfg/src/Makefile @@ -0,0 +1,14 @@ +CC = gcc +CFLAGS = -Wall +OBJS = main.o cyg_crc32.o + +all: rbcfg + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +rbcfg: $(OBJS) + $(CC) -o $@ $(OBJS) + +clean: + rm -f rbcfg *.o diff --git a/package/boot/rbcfg/src/cyg_crc.h b/package/boot/rbcfg/src/cyg_crc.h new file mode 100644 index 0000000000..7b59803446 --- /dev/null +++ b/package/boot/rbcfg/src/cyg_crc.h @@ -0,0 +1,109 @@ +//========================================================================== +// +// crc.h +// +// Interface for the CRC algorithms. +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 2002 Andrew Lunn +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): Andrew Lunn +// Contributors: Andrew Lunn +// Date: 2002-08-06 +// Purpose: +// Description: +// +// This code is part of eCos (tm). +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#ifndef _SERVICES_CRC_CRC_H_ +#define _SERVICES_CRC_CRC_H_ + +#if 0 +#include +#else +#include +typedef uint32_t cyg_uint32; +typedef uint16_t cyg_uint16; +#endif + +#ifndef __externC +# ifdef __cplusplus +# define __externC extern "C" +# else +# define __externC extern +# endif +#endif + +// Compute a CRC, using the POSIX 1003 definition + +__externC cyg_uint32 +cyg_posix_crc32(unsigned char *s, int len); + +// Gary S. Brown's 32 bit CRC + +__externC cyg_uint32 +cyg_crc32(unsigned char *s, int len); + +// Gary S. Brown's 32 bit CRC, but accumulate the result from a +// previous CRC calculation + +__externC cyg_uint32 +cyg_crc32_accumulate(cyg_uint32 crc, unsigned char *s, int len); + +// Ethernet FCS Algorithm + +__externC cyg_uint32 +cyg_ether_crc32(unsigned char *s, int len); + +// Ethernet FCS algorithm, but accumulate the result from a previous +// CRC calculation. + +__externC cyg_uint32 +cyg_ether_crc32_accumulate(cyg_uint32 crc, unsigned char *s, int len); + +// 16 bit CRC with polynomial x^16+x^12+x^5+1 + +__externC cyg_uint16 +cyg_crc16(unsigned char *s, int len); + +#endif // _SERVICES_CRC_CRC_H_ + + + diff --git a/package/boot/rbcfg/src/cyg_crc32.c b/package/boot/rbcfg/src/cyg_crc32.c new file mode 100644 index 0000000000..9462598ae6 --- /dev/null +++ b/package/boot/rbcfg/src/cyg_crc32.c @@ -0,0 +1,172 @@ +//========================================================================== +// +// crc32.c +// +// Gary S. Brown's 32 bit CRC +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// Copyright (C) 2002 Gary Thomas +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas,asl +// Date: 2001-01-31 +// Purpose: +// Description: +// +// This code is part of eCos (tm). +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#if 0 +#include +#else +#include "cyg_crc.h" +#endif + + /* ====================================================================== */ + /* COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or */ + /* code or tables extracted from it, as desired without restriction. */ + /* */ + /* First, the polynomial itself and its table of feedback terms. The */ + /* polynomial is */ + /* X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 */ + /* */ + /* ====================================================================== */ + +static const cyg_uint32 crc32_tab[] = { + 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, + 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, + 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, + 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, + 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, + 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, + 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, + 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, + 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, + 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, + 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, + 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, + 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, + 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, + 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, + 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, + 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, + 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, + 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, + 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, + 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, + 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, + 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, + 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, + 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, + 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, + 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, + 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, + 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, + 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, + 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, + 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, + 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, + 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, + 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, + 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, + 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, + 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, + 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, + 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, + 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, + 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, + 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, + 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, + 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, + 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, + 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, + 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, + 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, + 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, + 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, + 0x2d02ef8dL + }; + +/* This is the standard Gary S. Brown's 32 bit CRC algorithm, but + accumulate the CRC into the result of a previous CRC. */ +cyg_uint32 +cyg_crc32_accumulate(cyg_uint32 crc32val, unsigned char *s, int len) +{ + int i; + + for (i = 0; i < len; i++) { + crc32val = crc32_tab[(crc32val ^ s[i]) & 0xff] ^ (crc32val >> 8); + } + return crc32val; +} + +/* This is the standard Gary S. Brown's 32 bit CRC algorithm */ +cyg_uint32 +cyg_crc32(unsigned char *s, int len) +{ + return (cyg_crc32_accumulate(0,s,len)); +} + +/* Return a 32-bit CRC of the contents of the buffer accumulating the + result from a previous CRC calculation. This uses the Ethernet FCS + algorithm.*/ +cyg_uint32 +cyg_ether_crc32_accumulate(cyg_uint32 crc32val, unsigned char *s, int len) +{ + int i; + + if (s == 0) return 0L; + + crc32val = crc32val ^ 0xffffffff; + for (i = 0; i < len; i++) { + crc32val = crc32_tab[(crc32val ^ s[i]) & 0xff] ^ (crc32val >> 8); + } + return crc32val ^ 0xffffffff; +} + +/* Return a 32-bit CRC of the contents of the buffer, using the + Ethernet FCS algorithm. */ +cyg_uint32 +cyg_ether_crc32(unsigned char *s, int len) +{ + return cyg_ether_crc32_accumulate(0,s,len); +} + + diff --git a/package/boot/rbcfg/src/main.c b/package/boot/rbcfg/src/main.c new file mode 100644 index 0000000000..b7cf79ffae --- /dev/null +++ b/package/boot/rbcfg/src/main.c @@ -0,0 +1,791 @@ +/* + * RouterBOOT configuration utility + * + * Copyright (C) 2010 Gabor Juhos + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "rbcfg.h" +#include "cyg_crc.h" + +#define RBCFG_TMP_FILE "/tmp/.rbcfg" +#define RBCFG_MTD_NAME "soft_config" + +#define RB_ERR_NOTFOUND 1 +#define RB_ERR_INVALID 2 +#define RB_ERR_NOMEM 3 +#define RB_ERR_IO 4 + +#define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0])) + +struct rbcfg_ctx { + char *mtd_device; + char *tmp_file; + char *buf; + unsigned buflen; +}; + +struct rbcfg_value { + const char *name; + const char *desc; + union { + uint32_t u32; + const char *raw; + } val; +}; + +#define RBCFG_ENV_TYPE_U32 0 + +struct rbcfg_env { + const char *name; + int type; + uint16_t id; + const struct rbcfg_value *values; + int num_values; +}; + +#define CMD_FLAG_USES_CFG 0x01 + +struct rbcfg_command { + const char *command; + const char *usage; + int flags; + int (*exec)(int argc, const char *argv[]); +}; + +static void usage(void); + +/* Globals */ + +static struct rbcfg_ctx *rbcfg_ctx; +static char *rbcfg_name; + +#define CFG_U32(_name, _desc, _val) { \ + .name = (_name), \ + .desc = (_desc), \ + .val.u32 = (_val), \ +} + +static const struct rbcfg_value rbcfg_boot_delay[] = { + CFG_U32("1", "1 second", RB_BOOT_DELAY_1SEC), + CFG_U32("2", "2 seconds", RB_BOOT_DELAY_2SEC), + CFG_U32("3", "3 seconds", RB_BOOT_DELAY_3SEC), + CFG_U32("4", "4 seconds", RB_BOOT_DELAY_4SEC), + CFG_U32("5", "5 seconds", RB_BOOT_DELAY_5SEC), + CFG_U32("6", "6 seconds", RB_BOOT_DELAY_6SEC), + CFG_U32("7", "7 seconds", RB_BOOT_DELAY_7SEC), + CFG_U32("8", "8 seconds", RB_BOOT_DELAY_8SEC), + CFG_U32("9", "9 seconds", RB_BOOT_DELAY_9SEC), +}; + +static const struct rbcfg_value rbcfg_boot_device[] = { + CFG_U32("eth", "boot over Ethernet", + RB_BOOT_DEVICE_ETHER), + CFG_U32("nandeth", "boot from NAND, if fail then Ethernet", + RB_BOOT_DEVICE_NANDETH), + CFG_U32("ethnand", "boot Ethernet once, then NAND", + RB_BOOT_DEVICE_ETHONCE), + CFG_U32("nand", "boot from NAND only", + RB_BOOT_DEVICE_NANDONLY), +}; + +static const struct rbcfg_value rbcfg_boot_key[] = { + CFG_U32("any", "any key", RB_BOOT_KEY_ANY), + CFG_U32("del", " key only", RB_BOOT_KEY_DEL), +}; + +static const struct rbcfg_value rbcfg_boot_protocol[] = { + CFG_U32("bootp", "BOOTP protocol", RB_BOOT_PROTOCOL_BOOTP), + CFG_U32("dhcp", "DHCP protocol", RB_BOOT_PROTOCOL_DHCP), +}; + +static const struct rbcfg_value rbcfg_uart_speed[] = { + CFG_U32("115200", "", RB_UART_SPEED_115200), + CFG_U32("57600", "", RB_UART_SPEED_57600), + CFG_U32("38400", "", RB_UART_SPEED_38400), + CFG_U32("19200", "", RB_UART_SPEED_19200), + CFG_U32("9600", "", RB_UART_SPEED_9600), + CFG_U32("4800", "", RB_UART_SPEED_4800), + CFG_U32("2400", "", RB_UART_SPEED_2400), + CFG_U32("1200", "", RB_UART_SPEED_1200), + CFG_U32("off", "disable console output", RB_UART_SPEED_OFF), +}; + +static const struct rbcfg_value rbcfg_cpu_mode[] = { + CFG_U32("powersave", "power save", RB_CPU_MODE_POWERSAVE), + CFG_U32("regular", "regular (better for -0c environment)", + RB_CPU_MODE_REGULAR), +}; + +static const struct rbcfg_value rbcfg_booter[] = { + CFG_U32("regular", "load regular booter", RB_BOOTER_REGULAR), + CFG_U32("backup", "force backup-booter loading", RB_BOOTER_BACKUP), +}; + +static const struct rbcfg_env rbcfg_envs[] = { + { + .name = "boot_delay", + .id = RB_ID_BOOT_DELAY, + .type = RBCFG_ENV_TYPE_U32, + .values = rbcfg_boot_delay, + .num_values = ARRAY_SIZE(rbcfg_boot_delay), + }, { + .name = "boot_device", + .id = RB_ID_BOOT_DEVICE, + .type = RBCFG_ENV_TYPE_U32, + .values = rbcfg_boot_device, + .num_values = ARRAY_SIZE(rbcfg_boot_device), + }, { + .name = "boot_key", + .id = RB_ID_BOOT_KEY, + .type = RBCFG_ENV_TYPE_U32, + .values = rbcfg_boot_key, + .num_values = ARRAY_SIZE(rbcfg_boot_key), + }, { + .name = "boot_protocol", + .id = RB_ID_BOOT_PROTOCOL, + .type = RBCFG_ENV_TYPE_U32, + .values = rbcfg_boot_protocol, + .num_values = ARRAY_SIZE(rbcfg_boot_protocol), + }, { + .name = "booter", + .id = RB_ID_BOOTER, + .type = RBCFG_ENV_TYPE_U32, + .values = rbcfg_booter, + .num_values = ARRAY_SIZE(rbcfg_booter), + }, { + .name = "cpu_mode", + .id = RB_ID_CPU_MODE, + .type = RBCFG_ENV_TYPE_U32, + .values = rbcfg_cpu_mode, + .num_values = ARRAY_SIZE(rbcfg_cpu_mode), + }, { + .name = "uart_speed", + .id = RB_ID_UART_SPEED, + .type = RBCFG_ENV_TYPE_U32, + .values = rbcfg_uart_speed, + .num_values = ARRAY_SIZE(rbcfg_uart_speed), + } +}; + +static inline uint16_t +get_u16(const void *buf) +{ + const uint8_t *p = buf; + + return ((uint16_t) p[1] + ((uint16_t) p[0] << 8)); +} + +static inline uint32_t +get_u32(const void *buf) +{ + const uint8_t *p = buf; + + return ((uint32_t) p[3] + ((uint32_t) p[2] << 8) + + ((uint32_t) p[1] << 16) + ((uint32_t) p[0] << 24)); +} + +static inline void +put_u32(void *buf, uint32_t val) +{ + uint8_t *p = buf; + + p[3] = val & 0xff; + p[2] = (val >> 8) & 0xff; + p[1] = (val >> 16) & 0xff; + p[0] = (val >> 24) & 0xff; +} + +static int +rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len, + void **tag_data) +{ + uint16_t id; + uint16_t len; + char *buf = ctx->buf; + unsigned int buflen = ctx->buflen; + int ret = RB_ERR_NOTFOUND; + + /* skip magic and CRC value */ + buf += 8; + buflen -= 8; + + while (buflen > 2) { + len = get_u16(buf); + buf += 2; + buflen -= 2; + + if (buflen < 2) + break; + + id = get_u16(buf); + buf += 2; + buflen -= 2; + + if (id == RB_ID_TERMINATOR) + break; + + if (buflen < len) + break; + + if (id == tag_id) { + *tag_len = len; + *tag_data = buf; + ret = 0; + break; + } + + buf += len; + buflen -= len; + } + + if (ret) + fprintf(stderr, "no tag found with id=%u\n", tag_id); + + return ret; +} + +static int +rbcfg_get_u32(struct rbcfg_ctx *ctx, uint16_t id, uint32_t *val) +{ + void *tag_data; + uint16_t tag_len; + int err; + + err = rbcfg_find_tag(ctx, id, &tag_len, &tag_data); + if (err) + return err; + + *val = get_u32(tag_data); + return 0; +} + +static int +rbcfg_set_u32(struct rbcfg_ctx *ctx, uint16_t id, uint32_t val) +{ + void *tag_data; + uint16_t tag_len; + int err; + + err = rbcfg_find_tag(ctx, id, &tag_len, &tag_data); + if (err) + return err; + + put_u32(tag_data, val); + return 0; +} + +char *rbcfg_find_mtd(const char *name, int *erase_size) +{ + FILE *f; + int mtd_num; + char dev[PATH_MAX]; + char *ret = NULL; + struct stat s; + int err; + + f = fopen("/proc/mtd", "r"); + if (!f) + return NULL; + + while (1) { + char *p; + p = fgets(dev, sizeof(dev), f); + if (!p) + break; + + if (!strstr(dev, name)) + continue; + + err = sscanf(dev, "mtd%d: %08x", &mtd_num, erase_size); + if (err != 2) + break; + + sprintf(dev, "/dev/mtdblock%d", mtd_num); + err = stat(dev, &s); + if (err < 0) + break; + + if ((s.st_mode & S_IFBLK) == 0) + break; + + ret = malloc(strlen(dev) + 1); + if (ret == NULL) + break; + + strncpy(ret, dev, strlen(dev) + 1); + break; + } + + fclose(f); + return ret; +} + +static int +rbcfg_check_tmp(struct rbcfg_ctx *ctx) +{ + struct stat s; + int err; + + err = stat(ctx->tmp_file, &s); + if (err < 0) + return 0; + + if ((s.st_mode & S_IFREG) == 0) + return 0; + + if (s.st_size != ctx->buflen) + return 0; + + return 1; +} + +static int +rbcfg_load(struct rbcfg_ctx *ctx) +{ + uint32_t magic; + uint32_t crc_orig, crc; + char *name; + int tmp; + int fd; + int err; + + tmp = rbcfg_check_tmp(ctx); + name = (tmp) ? ctx->tmp_file : ctx->mtd_device; + + fd = open(name, O_RDONLY); + if (fd < 0) { + fprintf(stderr, "unable to open %s\n", name); + err = RB_ERR_IO; + goto err; + } + + err = read(fd, ctx->buf, ctx->buflen); + if (err != ctx->buflen) { + fprintf(stderr, "unable to read from %s\n", name); + err = RB_ERR_IO; + goto err_close; + } + + magic = get_u32(ctx->buf); + if (magic != RB_MAGIC_SOFT) { + fprintf(stderr, "invalid configuration\n"); + err = RB_ERR_INVALID; + goto err_close; + } + + crc_orig = get_u32(ctx->buf + 4); + put_u32(ctx->buf + 4, 0); + crc = cyg_ether_crc32((unsigned char *) ctx->buf, ctx->buflen); + if (crc != crc_orig) { + fprintf(stderr, "configuration has CRC error\n"); + err = RB_ERR_INVALID; + goto err_close; + } + + err = 0; + + err_close: + close(fd); + err: + return err; +} + +static int +rbcfg_open() +{ + char *mtd_device; + struct rbcfg_ctx *ctx; + int buflen; + int err; + + mtd_device = rbcfg_find_mtd(RBCFG_MTD_NAME, &buflen); + if (!mtd_device) { + fprintf(stderr, "unable to find configuration\n"); + return RB_ERR_NOTFOUND; + } + + ctx = malloc(sizeof(struct rbcfg_ctx) + buflen); + if (ctx == NULL) { + err = RB_ERR_NOMEM; + goto err_free_mtd; + } + + ctx->mtd_device = mtd_device; + ctx->tmp_file = RBCFG_TMP_FILE; + ctx->buflen = buflen; + ctx->buf = (char *) &ctx[1]; + + err = rbcfg_load(ctx); + if (err) + goto err_free_ctx; + + rbcfg_ctx = ctx; + return 0; + + err_free_ctx: + free(ctx); + err_free_mtd: + free(mtd_device); + return err; +} + +static int +rbcfg_update(int tmp) +{ + struct rbcfg_ctx *ctx = rbcfg_ctx; + char *name; + uint32_t crc; + int fd; + int err; + + put_u32(ctx->buf, RB_MAGIC_SOFT); + put_u32(ctx->buf + 4, 0); + crc = cyg_ether_crc32((unsigned char *) ctx->buf, ctx->buflen); + put_u32(ctx->buf + 4, crc); + + name = (tmp) ? ctx->tmp_file : ctx->mtd_device; + fd = open(name, O_WRONLY | O_CREAT); + if (fd < 0) { + fprintf(stderr, "unable to open %s for writing\n", name); + err = RB_ERR_IO; + goto out; + } + + err = write(fd, ctx->buf, ctx->buflen); + if (err != ctx->buflen) { + err = RB_ERR_IO; + goto out_close; + } + + fsync(fd); + err = 0; + + out_close: + close(fd); + out: + return err; +} + +static void +rbcfg_close(void) +{ + struct rbcfg_ctx *ctx; + + ctx = rbcfg_ctx; + free(ctx->mtd_device); + free(ctx); +} + +static const struct rbcfg_value * +rbcfg_env_find(const struct rbcfg_env *env, const char *name) +{ + unsigned i; + + for (i = 0; i < env->num_values; i++) { + const struct rbcfg_value *v = &env->values[i]; + + if (strcmp(v->name, name) == 0) + return v; + } + + return NULL; +} + +static const struct rbcfg_value * +rbcfg_env_find_u32(const struct rbcfg_env *env, uint32_t val) +{ + unsigned i; + + for (i = 0; i < env->num_values; i++) { + const struct rbcfg_value *v = &env->values[i]; + + if (v->val.u32 == val) + return v; + } + + return NULL; +} + +static const char * +rbcfg_env_get_u32(const struct rbcfg_env *env) +{ + const struct rbcfg_value *v; + uint32_t val; + int err; + + err = rbcfg_get_u32(rbcfg_ctx, env->id, &val); + if (err) + return NULL; + + v = rbcfg_env_find_u32(env, val); + if (v == NULL) { + fprintf(stderr, "unknown value %08x found for %s\n", + val, env->name); + return NULL; + } + + return v->name; +} + +static int +rbcfg_env_set_u32(const struct rbcfg_env *env, const char *data) +{ + const struct rbcfg_value *v; + int err; + + v = rbcfg_env_find(env, data); + if (v == NULL) { + fprintf(stderr, "invalid value '%s'\n", data); + return RB_ERR_INVALID; + } + + err = rbcfg_set_u32(rbcfg_ctx, env->id, v->val.u32); + return err; +} + +static const char * +rbcfg_env_get(const struct rbcfg_env *env) +{ + const char *ret = NULL; + + switch (env->type) { + case RBCFG_ENV_TYPE_U32: + ret = rbcfg_env_get_u32(env); + break; + } + + return ret; +} + +static int +rbcfg_env_set(const struct rbcfg_env *env, const char *data) +{ + int ret = 0; + + switch (env->type) { + case RBCFG_ENV_TYPE_U32: + ret = rbcfg_env_set_u32(env, data); + break; + } + + return ret; +} + +static int +rbcfg_cmd_apply(int argc, const char *argv[]) +{ + return rbcfg_update(0); +} + +static int +rbcfg_cmd_help(int argc, const char *argv[]) +{ + usage(); + return 0; +} + +static int +rbcfg_cmd_get(int argc, const char *argv[]) +{ + int err = RB_ERR_NOTFOUND; + int i; + + if (argc != 1) { + usage(); + return RB_ERR_INVALID; + } + + for (i = 0; i < ARRAY_SIZE(rbcfg_envs); i++) { + const struct rbcfg_env *env = &rbcfg_envs[i]; + const char *value; + + if (strcmp(env->name, argv[0])) + continue; + + value = rbcfg_env_get(env); + if (value) { + fprintf(stdout, "%s\n", value); + err = 0; + } + break; + } + + return err; +} + +static int +rbcfg_cmd_set(int argc, const char *argv[]) +{ + int err = RB_ERR_INVALID; + int i; + + if (argc != 2) { + /* not enough parameters */ + usage(); + return RB_ERR_INVALID; + } + + for (i = 0; i < ARRAY_SIZE(rbcfg_envs); i++) { + const struct rbcfg_env *env = &rbcfg_envs[i]; + + if (strcmp(env->name, argv[0])) + continue; + + err = rbcfg_env_set(env, argv[1]); + if (err == 0) + err = rbcfg_update(1); + break; + } + + return err; +} + +static int +rbcfg_cmd_show(int argc, const char *argv[]) +{ + int i; + + if (argc != 0) { + usage(); + return RB_ERR_INVALID; + } + + for (i = 0; i < ARRAY_SIZE(rbcfg_envs); i++) { + const struct rbcfg_env *env = &rbcfg_envs[i]; + const char *value; + + value = rbcfg_env_get(env); + if (value) + fprintf(stdout, "%s=%s\n", env->name, value); + } + + return 0; +} + +static const struct rbcfg_command rbcfg_commands[] = { + { + .command = "apply", + .usage = "apply\n" + "\t- write configuration to the mtd device", + .flags = CMD_FLAG_USES_CFG, + .exec = rbcfg_cmd_apply, + }, { + .command = "help", + .usage = "help\n" + "\t- show this screen", + .exec = rbcfg_cmd_help, + }, { + .command = "get", + .usage = "get \n" + "\t- get value of the configuration option ", + .flags = CMD_FLAG_USES_CFG, + .exec = rbcfg_cmd_get, + }, { + .command = "set", + .usage = "set \n" + "\t- set value of the configuration option to ", + .flags = CMD_FLAG_USES_CFG, + .exec = rbcfg_cmd_set, + }, { + .command = "show", + .usage = "show\n" + "\t- show value of all configuration options", + .flags = CMD_FLAG_USES_CFG, + .exec = rbcfg_cmd_show, + } +}; + +static void +usage(void) +{ + char buf[255]; + int len; + int i; + + fprintf(stderr, "Usage: %s \n", rbcfg_name); + + fprintf(stderr, "\nCommands:\n"); + for (i = 0; i < ARRAY_SIZE(rbcfg_commands); i++) { + const struct rbcfg_command *cmd; + cmd = &rbcfg_commands[i]; + + len = snprintf(buf, sizeof(buf), "%s", cmd->usage); + buf[len] = '\0'; + fprintf(stderr, "%s\n", buf); + } + + fprintf(stderr, "\nConfiguration options:\n"); + for (i = 0; i < ARRAY_SIZE(rbcfg_envs); i++) { + const struct rbcfg_env *env; + int j; + + env = &rbcfg_envs[i]; + fprintf(stderr, "\n%s:\n", env->name); + for (j = 0; j < env->num_values; j++) { + const struct rbcfg_value *v = &env->values[j]; + fprintf(stderr, "\t%-12s %s\n", v->name, v->desc); + } + } + fprintf(stderr, "\n"); +} + +int main(int argc, const char *argv[]) +{ + const struct rbcfg_command *cmd = NULL; + int ret; + int i; + + rbcfg_name = (char *) argv[0]; + + if (argc < 2) { + usage(); + return EXIT_FAILURE; + } + + for (i = 0; i < ARRAY_SIZE(rbcfg_commands); i++) { + if (strcmp(rbcfg_commands[i].command, argv[1]) == 0) { + cmd = &rbcfg_commands[i]; + break; + } + } + + if (cmd == NULL) { + fprintf(stderr, "unknown command '%s'\n", argv[1]); + usage(); + return EXIT_FAILURE; + } + + argc -= 2; + argv += 2; + + if (cmd->flags & CMD_FLAG_USES_CFG) { + ret = rbcfg_open(); + if (ret) + return EXIT_FAILURE; + } + + ret = cmd->exec(argc, argv); + + if (cmd->flags & CMD_FLAG_USES_CFG) + rbcfg_close(); + + if (ret) + return EXIT_FAILURE; + + return EXIT_SUCCESS; +} diff --git a/package/boot/rbcfg/src/rbcfg.h b/package/boot/rbcfg/src/rbcfg.h new file mode 100644 index 0000000000..899161a10d --- /dev/null +++ b/package/boot/rbcfg/src/rbcfg.h @@ -0,0 +1,75 @@ +/* + * Mikrotik's RouterBOOT configuration defines + * + * Copyright (C) 2010 Gabor Juhos + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + */ + +#ifndef _RBCFG_H +#define _RBCFG_H + +/* + * Magic numbers + */ +#define RB_MAGIC_SOFT 0x74666f53 /* 'Soft' */ + +/* + * ID values for Software settings + */ +#define RB_ID_TERMINATOR 0 +#define RB_ID_UART_SPEED 1 +#define RB_ID_BOOT_DELAY 2 +#define RB_ID_BOOT_DEVICE 3 +#define RB_ID_BOOT_KEY 4 +#define RB_ID_CPU_MODE 5 +#define RB_ID_FW_VERSION 6 +#define RB_ID_SOFT_07 7 +#define RB_ID_SOFT_08 8 +#define RB_ID_BOOT_PROTOCOL 9 +#define RB_ID_SOFT_10 10 +#define RB_ID_SOFT_11 11 +#define RB_ID_BOOTER 13 + +#define RB_UART_SPEED_115200 0 +#define RB_UART_SPEED_57600 1 +#define RB_UART_SPEED_38400 2 +#define RB_UART_SPEED_19200 3 +#define RB_UART_SPEED_9600 4 +#define RB_UART_SPEED_4800 5 +#define RB_UART_SPEED_2400 6 +#define RB_UART_SPEED_1200 7 +#define RB_UART_SPEED_OFF 8 + +#define RB_BOOT_DELAY_1SEC 1 +#define RB_BOOT_DELAY_2SEC 2 +#define RB_BOOT_DELAY_3SEC 3 +#define RB_BOOT_DELAY_4SEC 4 +#define RB_BOOT_DELAY_5SEC 5 +#define RB_BOOT_DELAY_6SEC 6 +#define RB_BOOT_DELAY_7SEC 7 +#define RB_BOOT_DELAY_8SEC 8 +#define RB_BOOT_DELAY_9SEC 9 + +#define RB_BOOT_DEVICE_ETHER 0 +#define RB_BOOT_DEVICE_NANDETH 1 +#define RB_BOOT_DEVICE_CFCARD 2 +#define RB_BOOT_DEVICE_ETHONCE 3 +#define RB_BOOT_DEVICE_NANDONLY 5 + +#define RB_BOOT_KEY_ANY 0 +#define RB_BOOT_KEY_DEL 1 + +#define RB_CPU_MODE_POWERSAVE 0 +#define RB_CPU_MODE_REGULAR 1 + +#define RB_BOOT_PROTOCOL_BOOTP 0 +#define RB_BOOT_PROTOCOL_DHCP 1 + +#define RB_BOOTER_REGULAR 0 +#define RB_BOOTER_BACKUP 1 + +#endif /* _RBCFG_H */ diff --git a/package/boot/yamonenv/Makefile b/package/boot/yamonenv/Makefile index a490f45fe1..011d39acd6 100644 --- a/package/boot/yamonenv/Makefile +++ b/package/boot/yamonenv/Makefile @@ -13,10 +13,12 @@ PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)_gruen.4g__$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/ -PKG_MD5SUM:=a3e4f24155aa3ba5aa502bc63fdaa6ad +PKG_HASH:=466eca9cdad2c15e957fb9ce7d0b6927ecd17d85c4cc2dff37e97a3e6b209c67 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) +PKG_FLAGS:=nonshared + include $(INCLUDE_DIR)/package.mk define Package/yamonenv diff --git a/package/kernel/avila-wdt/Makefile b/package/kernel/avila-wdt/Makefile deleted file mode 100644 index 94bda9b8d5..0000000000 --- a/package/kernel/avila-wdt/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright (C) 2008 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=avila-wdt -PKG_RELEASE:=1 - -include $(INCLUDE_DIR)/package.mk - -define KernelPackage/avila-wdt - SUBMENU:=Other modules - TITLE:=GPIO hardware watchdog driver for modified Avila boards - DEPENDS:=@GPIO_SUPPORT @TARGET_ixp4xx - FILES:=$(PKG_BUILD_DIR)/avila-wdt.ko - AUTOLOAD:=$(call AutoLoad,10,avila-wdt) -endef - -MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - SUBDIRS="$(PKG_BUILD_DIR)" - -define Build/Compile - $(MAKE) -C "$(LINUX_DIR)" \ - $(MAKE_OPTS) \ - modules -endef - -$(eval $(call KernelPackage,avila-wdt)) diff --git a/package/kernel/avila-wdt/src/Makefile b/package/kernel/avila-wdt/src/Makefile deleted file mode 100644 index 90d90657ed..0000000000 --- a/package/kernel/avila-wdt/src/Makefile +++ /dev/null @@ -1 +0,0 @@ -obj-m := avila-wdt.o diff --git a/package/kernel/avila-wdt/src/avila-wdt.c b/package/kernel/avila-wdt/src/avila-wdt.c deleted file mode 100644 index 22a3d6c7ea..0000000000 --- a/package/kernel/avila-wdt/src/avila-wdt.c +++ /dev/null @@ -1,231 +0,0 @@ -/* - * avila-wdt.c - * Copyright (C) 2009 Felix Fietkau - * - * based on: - * drivers/char/watchdog/ixp4xx_wdt.c - * - * Watchdog driver for Intel IXP4xx network processors - * - * Author: Deepak Saxena - * - * Copyright 2004 (c) MontaVista, Software, Inc. - * Based on sa1100 driver, Copyright (C) 2000 Oleg Drokin - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int nowayout = WATCHDOG_NOWAYOUT; -static int heartbeat = 20; /* (secs) Default is 20 seconds */ -static unsigned long wdt_status; -static atomic_t wdt_counter; -struct timer_list wdt_timer; - -#define WDT_IN_USE 0 -#define WDT_OK_TO_CLOSE 1 -#define WDT_RUNNING 2 - -static void wdt_refresh(unsigned long data) -{ - if (test_bit(WDT_RUNNING, &wdt_status)) { - if (atomic_dec_and_test(&wdt_counter)) { - printk(KERN_WARNING "Avila watchdog expired, expect a reboot soon!\n"); - clear_bit(WDT_RUNNING, &wdt_status); - return; - } - } - - /* strobe to the watchdog */ - gpio_line_set(14, IXP4XX_GPIO_HIGH); - gpio_line_set(14, IXP4XX_GPIO_LOW); - - mod_timer(&wdt_timer, jiffies + msecs_to_jiffies(500)); -} - -static void wdt_enable(void) -{ - atomic_set(&wdt_counter, heartbeat * 2); - - /* Disable clock generator output on GPIO 14/15 */ - *IXP4XX_GPIO_GPCLKR &= ~(1 << 8); - - /* activate GPIO 14 out */ - gpio_line_config(14, IXP4XX_GPIO_OUT); - gpio_line_set(14, IXP4XX_GPIO_LOW); - - if (!test_bit(WDT_RUNNING, &wdt_status)) - wdt_refresh(0); - set_bit(WDT_RUNNING, &wdt_status); -} - -static void wdt_disable(void) -{ - /* Re-enable clock generator output on GPIO 14/15 */ - *IXP4XX_GPIO_GPCLKR |= (1 << 8); -} - -static int avila_wdt_open(struct inode *inode, struct file *file) -{ - if (test_and_set_bit(WDT_IN_USE, &wdt_status)) - return -EBUSY; - - clear_bit(WDT_OK_TO_CLOSE, &wdt_status); - wdt_enable(); - return nonseekable_open(inode, file); -} - -static ssize_t -avila_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos) -{ - if (len) { - if (!nowayout) { - size_t i; - - clear_bit(WDT_OK_TO_CLOSE, &wdt_status); - - for (i = 0; i != len; i++) { - char c; - - if (get_user(c, data + i)) - return -EFAULT; - if (c == 'V') - set_bit(WDT_OK_TO_CLOSE, &wdt_status); - } - } - wdt_enable(); - } - return len; -} - -static struct watchdog_info ident = { - .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE | - WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, - .identity = "Avila Watchdog", -}; - - -static long avila_wdt_ioctl(struct file *file, unsigned int cmd, - unsigned long arg) -{ - int ret = -ENOTTY; - int time; - - switch (cmd) { - case WDIOC_GETSUPPORT: - ret = copy_to_user((struct watchdog_info *)arg, &ident, - sizeof(ident)) ? -EFAULT : 0; - break; - - case WDIOC_GETSTATUS: - ret = put_user(0, (int *)arg); - break; - - case WDIOC_KEEPALIVE: - wdt_enable(); - ret = 0; - break; - - case WDIOC_SETTIMEOUT: - ret = get_user(time, (int *)arg); - if (ret) - break; - - if (time <= 0 || time > 60) { - ret = -EINVAL; - break; - } - - heartbeat = time; - wdt_enable(); - /* Fall through */ - - case WDIOC_GETTIMEOUT: - ret = put_user(heartbeat, (int *)arg); - break; - } - return ret; -} - -static int avila_wdt_release(struct inode *inode, struct file *file) -{ - if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) - wdt_disable(); - else - printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - " - "timer will not stop\n"); - clear_bit(WDT_IN_USE, &wdt_status); - clear_bit(WDT_OK_TO_CLOSE, &wdt_status); - - return 0; -} - - -static const struct file_operations avila_wdt_fops = { - .owner = THIS_MODULE, - .llseek = no_llseek, - .write = avila_wdt_write, - .unlocked_ioctl = avila_wdt_ioctl, - .open = avila_wdt_open, - .release = avila_wdt_release, -}; - -static struct miscdevice avila_wdt_miscdev = { - .minor = WATCHDOG_MINOR + 1, - .name = "avila_watchdog", - .fops = &avila_wdt_fops, -}; - -static int __init avila_wdt_init(void) -{ - int ret; - - init_timer(&wdt_timer); - wdt_timer.expires = 0; - wdt_timer.data = 0; - wdt_timer.function = wdt_refresh; - ret = misc_register(&avila_wdt_miscdev); - if (ret == 0) - printk(KERN_INFO "Avila Watchdog Timer: heartbeat %d sec\n", - heartbeat); - return ret; -} - -static void __exit avila_wdt_exit(void) -{ - misc_deregister(&avila_wdt_miscdev); - del_timer(&wdt_timer); - wdt_disable(); -} - - -module_init(avila_wdt_init); -module_exit(avila_wdt_exit); - -MODULE_AUTHOR("Felix Fietkau "); -MODULE_DESCRIPTION("Gateworks Avila Hardware Watchdog"); - -module_param(heartbeat, int, 0); -MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds (default 20s)"); - -module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"); - -MODULE_LICENSE("GPL"); -MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); - diff --git a/package/kernel/kmod-sched-cake/Makefile b/package/kernel/kmod-sched-cake/Makefile index 519278db1c..b58c610b2c 100644 --- a/package/kernel/kmod-sched-cake/Makefile +++ b/package/kernel/kmod-sched-cake/Makefile @@ -12,10 +12,10 @@ PKG_NAME:=sched-cake PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/kdarbyshirebryant/sch_cake.git -PKG_SOURCE_DATE:=2016-12-19 -PKG_SOURCE_VERSION:=70c8eb766d5afcf3cf187594b7cd776da92bee3c -PKG_MIRROR_HASH:=16174db5dad0a5b5ba522d4cfc058cff9851ed013a3a05166b04eb127bb12a24 +PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git +PKG_SOURCE_DATE:=2017-01-28 +PKG_SOURCE_VERSION:=9789742cfc596d48583ba4cdbc8f38d026121fa6 +PKG_MIRROR_HASH:=2a5afc45722c28ca8778eb50452eb305306e7898b32d7d6d73d3e77edf3cce99 PKG_MAINTAINER:=Kevin Darbyshire-Bryant include $(INCLUDE_DIR)/package.mk diff --git a/package/kernel/linux/modules/can.mk b/package/kernel/linux/modules/can.mk index eeef88a835..5529fe02e0 100644 --- a/package/kernel/linux/modules/can.mk +++ b/package/kernel/linux/modules/can.mk @@ -241,7 +241,7 @@ $(eval $(call KernelPackage,can-c-can)) define KernelPackage/can-c-can-platform TITLE:=Platform Bus based BOSCH C_CAN/D_CAN driver KCONFIG:=CONFIG_CAN_C_CAN_PLATFORM - DEPENDS:=kmod-can-c-can +LINUX_4_1:kmod-regmap + DEPENDS:=kmod-can-c-can +!LINUX_3_18:kmod-regmap FILES:=$(LINUX_DIR)/drivers/net/can/c_can/c_can_platform.ko AUTOLOAD:=$(call AutoProbe,c_can_platform) $(call AddDepends/can) diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk index bc2f349c76..a5941d2310 100644 --- a/package/kernel/linux/modules/netfilter.mk +++ b/package/kernel/linux/modules/netfilter.mk @@ -495,7 +495,7 @@ $(eval $(call KernelPackage,ipt-tproxy)) define KernelPackage/ipt-tee TITLE:=TEE support - DEPENDS:=+kmod-ipt-conntrack @!LINUX_4_4 + DEPENDS:=+kmod-ipt-conntrack KCONFIG:= \ CONFIG_NETFILTER_XT_TARGET_TEE FILES:= \ diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index ef5c5ba848..3d5e74327a 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -736,7 +736,7 @@ $(eval $(call KernelPackage,mppe)) SCHED_MODULES = $(patsubst $(LINUX_DIR)/net/sched/%.ko,%,$(wildcard $(LINUX_DIR)/net/sched/*.ko)) -SCHED_MODULES_CORE = sch_ingress sch_fq_codel sch_hfsc cls_fw cls_route cls_flow cls_tcindex cls_u32 em_u32 act_mirred act_skbedit +SCHED_MODULES_CORE = sch_ingress sch_fq_codel sch_hfsc sch_htb sch_tbf cls_fw cls_route cls_flow cls_tcindex cls_u32 em_u32 act_mirred act_skbedit SCHED_MODULES_FILTER = $(SCHED_MODULES_CORE) act_connmark sch_netem SCHED_MODULES_EXTRA = $(filter-out $(SCHED_MODULES_FILTER),$(SCHED_MODULES)) SCHED_FILES = $(patsubst %,$(LINUX_DIR)/net/sched/%.ko,$(filter $(SCHED_MODULES_CORE),$(SCHED_MODULES))) @@ -748,6 +748,8 @@ define KernelPackage/sched-core KCONFIG:= \ CONFIG_NET_SCHED=y \ CONFIG_NET_SCH_HFSC \ + CONFIG_NET_SCH_HTB \ + CONFIG_NET_SCH_TBF \ CONFIG_NET_SCH_INGRESS \ CONFIG_NET_SCH_FQ_CODEL \ CONFIG_NET_CLS=y \ @@ -789,12 +791,10 @@ define KernelPackage/sched KCONFIG:= \ CONFIG_NET_SCH_CODEL \ CONFIG_NET_SCH_DSMARK \ - CONFIG_NET_SCH_HTB \ CONFIG_NET_SCH_FIFO \ CONFIG_NET_SCH_GRED \ CONFIG_NET_SCH_PRIO \ CONFIG_NET_SCH_RED \ - CONFIG_NET_SCH_TBF \ CONFIG_NET_SCH_SFQ \ CONFIG_NET_SCH_TEQL \ CONFIG_NET_SCH_FQ \ diff --git a/package/kernel/linux/modules/nls.mk b/package/kernel/linux/modules/nls.mk index 55c5c1a8a8..05fce27bbc 100644 --- a/package/kernel/linux/modules/nls.mk +++ b/package/kernel/linux/modules/nls.mk @@ -147,6 +147,38 @@ endef $(eval $(call KernelPackage,nls-cp932)) +define KernelPackage/nls-cp936 + SUBMENU:=Native Language Support + TITLE:=Codepage 936 (Simplified Chinese) + KCONFIG:=CONFIG_NLS_CODEPAGE_936 + FILES:=$(LINUX_DIR)/fs/nls/nls_cp936.ko + AUTOLOAD:=$(call AutoLoad,25,nls_cp936) + $(call AddDepends/nls) +endef + +define KernelPackage/nls-cp936/description + Kernel module for NLS Codepage 936 (Simplified Chinese) +endef + +$(eval $(call KernelPackage,nls-cp936)) + + +define KernelPackage/nls-cp950 + SUBMENU:=Native Language Support + TITLE:=Codepage 950 (Traditional Chinese) + KCONFIG:=CONFIG_NLS_CODEPAGE_950 + FILES:=$(LINUX_DIR)/fs/nls/nls_cp950.ko + AUTOLOAD:=$(call AutoLoad,25,nls_cp950) + $(call AddDepends/nls) +endef + +define KernelPackage/nls-cp950/description + Kernel module for NLS Codepage 950 (Traditional Chinese) +endef + +$(eval $(call KernelPackage,nls-cp950)) + + define KernelPackage/nls-cp1250 SUBMENU:=Native Language Support TITLE:=Codepage 1250 (Eastern Europe) diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 57e13706e9..32ed19e125 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,13 +10,13 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=2016-10-08 +PKG_VERSION:=2017-01-31 PKG_RELEASE:=1 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources PKG_BACKPORT_VERSION:= -PKG_HASH:=4f6350e3b75815060bfdf47ef266ad613c7bfea5b7b1dc4552dee69e1bebe4fb +PKG_HASH:=75e6d39e34cf156212a2509172a4a62b673b69eb4a1d9aaa565f7fa719fa2317 -PKG_SOURCE:=compat-wireless-$(PKG_VERSION)$(PKG_BACKPORT_VERSION).tar.bz2 +PKG_SOURCE:=compat-wireless-$(PKG_VERSION)$(PKG_BACKPORT_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION) PKG_BUILD_PARALLEL:=1 diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 1fa39b8261..baa023ecf6 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -756,7 +756,7 @@ drv_mac80211_setup() { for_each_interface "ap" mac80211_prepare_vif [ -n "$hostapd_ctrl" ] && { - /usr/sbin/hostapd -P /var/run/wifi-$phy.pid -B "$hostapd_conf_file" + /usr/sbin/hostapd -s -P /var/run/wifi-$phy.pid -B "$hostapd_conf_file" ret="$?" wireless_add_process "$(cat /var/run/wifi-$phy.pid)" "/usr/sbin/hostapd" 1 [ "$ret" != 0 ] && { diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh index 4bfc7424b2..3d1299d7da 100644 --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh @@ -122,7 +122,7 @@ detect_mac80211() { set wireless.default_radio${devidx}.device=radio${devidx} set wireless.default_radio${devidx}.network=lan set wireless.default_radio${devidx}.mode=ap - set wireless.default_radio${devidx}.ssid=LEDE + set wireless.default_radio${devidx}.ssid=libreCMC set wireless.default_radio${devidx}.encryption=none EOF uci -q commit wireless diff --git a/package/kernel/mac80211/patches/002-change_allconfig.patch b/package/kernel/mac80211/patches/002-change_allconfig.patch index bd5bebfa45..a071ae6370 100644 --- a/package/kernel/mac80211/patches/002-change_allconfig.patch +++ b/package/kernel/mac80211/patches/002-change_allconfig.patch @@ -1,6 +1,6 @@ --- a/kconf/conf.c +++ b/kconf/conf.c -@@ -593,40 +593,12 @@ int main(int ac, char **av) +@@ -594,40 +594,12 @@ int main(int ac, char **av) case oldconfig: case listnewconfig: case olddefconfig: @@ -44,7 +44,7 @@ break; --- a/kconf/confdata.c +++ b/kconf/confdata.c -@@ -1169,6 +1169,8 @@ bool conf_set_all_new_symbols(enum conf_ +@@ -1170,6 +1170,8 @@ bool conf_set_all_new_symbols(enum conf_ } bool has_changed = false; @@ -53,7 +53,7 @@ for_all_symbols(i, sym) { if (sym_has_value(sym) || (sym->flags & SYMBOL_VALID)) continue; -@@ -1212,8 +1214,6 @@ bool conf_set_all_new_symbols(enum conf_ +@@ -1213,8 +1215,6 @@ bool conf_set_all_new_symbols(enum conf_ } diff --git a/package/kernel/mac80211/patches/004-fix_duplicate_skcipher_backport.patch b/package/kernel/mac80211/patches/004-fix_duplicate_skcipher_backport.patch deleted file mode 100644 index 38b31795a4..0000000000 --- a/package/kernel/mac80211/patches/004-fix_duplicate_skcipher_backport.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/compat/Makefile -+++ b/compat/Makefile -@@ -35,8 +35,6 @@ compat-$(CPTCFG_KERNEL_4_6) += backport- - - compat-$(CPTCFG_BPAUTO_BUILD_CRYPTO_CCM) += crypto-ccm.o - compat-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += crypto-skcipher.o --skcipher-objs += crypto-skcipher.o --obj-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += skcipher.o - compat-$(CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP) += drivers-base-devcoredump.o - compat-$(CPTCFG_BPAUTO_RHASHTABLE) += lib-rhashtable.o - cordic-objs += lib-cordic.o diff --git a/package/kernel/mac80211/patches/004-kconfig_backport_fix.patch b/package/kernel/mac80211/patches/004-kconfig_backport_fix.patch new file mode 100644 index 0000000000..f11029844c --- /dev/null +++ b/package/kernel/mac80211/patches/004-kconfig_backport_fix.patch @@ -0,0 +1,28 @@ +--- a/backport-include/linux/kconfig.h ++++ b/backport-include/linux/kconfig.h +@@ -5,6 +5,8 @@ + #include_next + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) ++ + #ifndef __ARG_PLACEHOLDER_1 + #define __ARG_PLACEHOLDER_1 0, + #define config_enabled(cfg) _config_enabled(cfg) +@@ -16,6 +18,7 @@ + * 3.1 - 3.3 had a broken version of this, so undef + * (they didn't have __ARG_PLACEHOLDER_1) + */ ++ + #undef IS_ENABLED + #define IS_ENABLED(option) \ + (config_enabled(option) || config_enabled(option##_MODULE)) +@@ -24,6 +27,8 @@ + #undef IS_BUILTIN + #define IS_BUILTIN(option) config_enabled(option) + ++#endif ++ + #ifndef IS_REACHABLE + /* + * IS_REACHABLE(CONFIG_FOO) evaluates to 1 if the currently compiled diff --git a/package/kernel/mac80211/patches/005-backport_skb_get_hash_perturb.patch b/package/kernel/mac80211/patches/005-backport_skb_get_hash_perturb.patch deleted file mode 100644 index 29bccc1e99..0000000000 --- a/package/kernel/mac80211/patches/005-backport_skb_get_hash_perturb.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/backport-include/linux/skbuff.h -+++ b/backport-include/linux/skbuff.h -@@ -305,6 +305,19 @@ static inline void skb_free_frag(void *d - { - put_page(virt_to_head_page(data)); - } -+ -+#include -+#include -+ -+static inline u32 skb_get_hash_perturb(struct sk_buff *skb, u32 key) -+{ -+ struct flow_keys keys; -+ -+ skb_flow_dissect(skb, &keys); -+ return jhash_3words((__force u32)keys.dst, -+ (__force u32)keys.src ^ keys.ip_proto, -+ (__force u32)keys.ports, key); -+} - #endif - - #endif /* __BACKPORT_SKBUFF_H */ diff --git a/package/kernel/mac80211/patches/005-revert-devcoredump.patch b/package/kernel/mac80211/patches/005-revert-devcoredump.patch new file mode 100644 index 0000000000..ff460900ff --- /dev/null +++ b/package/kernel/mac80211/patches/005-revert-devcoredump.patch @@ -0,0 +1,152 @@ +--- a/compat/Makefile ++++ b/compat/Makefile +@@ -35,8 +35,6 @@ compat-$(CPTCFG_KERNEL_4_6) += backport- + + compat-$(CPTCFG_BPAUTO_BUILD_CRYPTO_CCM) += crypto-ccm.o + compat-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += crypto-skcipher.o +-skcipher-objs += crypto-skcipher.o +-obj-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += skcipher.o + compat-$(CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP) += drivers-base-devcoredump.o + compat-$(CPTCFG_BPAUTO_RHASHTABLE) += lib-rhashtable.o + cordic-objs += lib-cordic.o +--- a/compat/drivers-base-devcoredump.c ++++ b/compat/drivers-base-devcoredump.c +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include "backports.h" + + static struct class devcd_class; + +@@ -40,6 +41,10 @@ static bool devcd_disabled; + /* if data isn't read by userspace after 5 minutes then delete it */ + #define DEVCD_TIMEOUT (HZ * 60 * 5) + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) ++static struct bin_attribute devcd_attr_data; ++#endif ++ + struct devcd_entry { + struct device devcd_dev; + void *data; +@@ -69,8 +74,7 @@ static void devcd_dev_release(struct dev + * a struct device to know when it goes away? + */ + if (devcd->failing_dev->kobj.sd) +- sysfs_delete_link(&devcd->failing_dev->kobj, &dev->kobj, +- "devcoredump"); ++ sysfs_remove_link(&devcd->failing_dev->kobj, "devcoredump"); + + put_device(devcd->failing_dev); + kfree(devcd); +@@ -82,6 +86,9 @@ static void devcd_del(struct work_struct + + devcd = container_of(wk, struct devcd_entry, del_wk.work); + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) ++ device_remove_bin_file(&devcd->devcd_dev, &devcd_attr_data); ++#endif + device_del(&devcd->devcd_dev); + put_device(&devcd->devcd_dev); + } +@@ -115,6 +122,7 @@ static struct bin_attribute devcd_attr_d + .write = devcd_data_write, + }; + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) + static struct bin_attribute *devcd_dev_bin_attrs[] = { + &devcd_attr_data, NULL, + }; +@@ -126,6 +134,7 @@ static const struct attribute_group devc + static const struct attribute_group *devcd_dev_groups[] = { + &devcd_dev_group, NULL, + }; ++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) */ + + static int devcd_free(struct device *dev, void *data) + { +@@ -160,18 +169,11 @@ static ssize_t disabled_store(struct cla + + return count; + } +-static CLASS_ATTR_RW(disabled); + +-static struct attribute *devcd_class_attrs[] = { +- &class_attr_disabled.attr, +- NULL, ++static struct class_attribute devcd_class_attrs[] = { ++ __ATTR_RW(disabled), ++ __ATTR_NULL + }; +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) +-ATTRIBUTE_GROUPS(devcd_class); +-#else +-#define BP_ATTR_GRP_STRUCT device_attribute +-ATTRIBUTE_GROUPS_BACKPORT(devcd_class); +-#endif + + static struct class devcd_class = { + .name = "devcoredump", +@@ -179,10 +181,8 @@ static struct class devcd_class = { + .dev_release = devcd_dev_release, + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) + .dev_groups = devcd_dev_groups, +-#else +- .dev_attrs = devcd_class_dev_attrs, + #endif +- .class_groups = devcd_class_groups, ++ .class_attrs = devcd_class_attrs, + }; + + static ssize_t devcd_readv(char *buffer, loff_t offset, size_t count, +@@ -325,6 +325,11 @@ void dev_coredumpm(struct device *dev, s + if (device_add(&devcd->devcd_dev)) + goto put_device; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) ++ if (device_create_bin_file(&devcd->devcd_dev, &devcd_attr_data)) ++ goto put_device; ++#endif ++ + if (sysfs_create_link(&devcd->devcd_dev.kobj, &dev->kobj, + "failing_device")) + /* nothing - symlink will be missing */; +@@ -367,16 +372,13 @@ void dev_coredumpsg(struct device *dev, + } + EXPORT_SYMBOL_GPL(dev_coredumpsg); + +-static int __init devcoredump_init(void) ++int __init devcoredump_init(void) + { +- init_devcd_class_attrs(); + return class_register(&devcd_class); + } +-__initcall(devcoredump_init); + +-static void __exit devcoredump_exit(void) ++void __exit devcoredump_exit(void) + { + class_for_each_device(&devcd_class, NULL, NULL, devcd_free); + class_unregister(&devcd_class); + } +-__exitcall(devcoredump_exit); +--- a/include/linux/backport-devcoredump.h ++++ b/include/linux/backport-devcoredump.h +@@ -66,7 +66,7 @@ static inline void _devcd_free_sgtable(s + } + + +-#ifdef CONFIG_DEV_COREDUMP ++#ifdef CPTCFG_BPAUTO_WANT_DEV_COREDUMP + void dev_coredumpv(struct device *dev, void *data, size_t datalen, + gfp_t gfp); + +@@ -100,6 +100,6 @@ static inline void dev_coredumpsg(struct + { + _devcd_free_sgtable(table); + } +-#endif /* CONFIG_DEV_COREDUMP */ ++#endif /* CPTCFG_BPAUTO_WANT_DEV_COREDUMP */ + + #endif /* __DEVCOREDUMP_H */ diff --git a/package/kernel/mac80211/patches/006-revert-ktime-changes.patch b/package/kernel/mac80211/patches/006-revert-ktime-changes.patch new file mode 100644 index 0000000000..b839eb4c8d --- /dev/null +++ b/package/kernel/mac80211/patches/006-revert-ktime-changes.patch @@ -0,0 +1,20 @@ +--- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c +@@ -177,7 +177,7 @@ static bool rt2800usb_tx_sta_fifo_read_c + if (rt2800usb_txstatus_pending(rt2x00dev)) { + /* Read register after 1 ms */ + hrtimer_start(&rt2x00dev->txstatus_timer, +- TXSTATUS_READ_INTERVAL, ++ ktime_set(0, TXSTATUS_READ_INTERVAL), + HRTIMER_MODE_REL); + return false; + } +@@ -204,7 +204,7 @@ static void rt2800usb_async_read_tx_stat + + /* Read TX_STA_FIFO register after 2 ms */ + hrtimer_start(&rt2x00dev->txstatus_timer, +- 2 * TXSTATUS_READ_INTERVAL, ++ ktime_set(0, 2*TXSTATUS_READ_INTERVAL), + HRTIMER_MODE_REL); + } + diff --git a/package/kernel/mac80211/patches/007-revert-genetlink-changes.patch b/package/kernel/mac80211/patches/007-revert-genetlink-changes.patch new file mode 100644 index 0000000000..1a85106bc2 --- /dev/null +++ b/package/kernel/mac80211/patches/007-revert-genetlink-changes.patch @@ -0,0 +1,266 @@ +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -32,8 +32,22 @@ static int nl80211_crypto_settings(struc + struct cfg80211_crypto_settings *settings, + int cipher_limit); + ++static int nl80211_pre_doit(const struct genl_ops *ops, struct sk_buff *skb, ++ struct genl_info *info); ++static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb, ++ struct genl_info *info); ++ + /* the netlink family */ +-static struct genl_family nl80211_fam; ++static struct genl_family nl80211_fam = { ++ .id = GENL_ID_GENERATE, /* don't bother with a hardcoded ID */ ++ .name = NL80211_GENL_NAME, /* have users key off the name instead */ ++ .hdrsize = 0, /* no private header */ ++ .version = 1, /* no particular meaning now */ ++ .maxattr = NL80211_ATTR_MAX, ++ .netnsok = true, ++ .pre_doit = nl80211_pre_doit, ++ .post_doit = nl80211_post_doit, ++}; + + /* multicast groups */ + enum nl80211_multicast_groups { +@@ -549,14 +563,13 @@ static int nl80211_prepare_wdev_dump(str + + if (!cb->args[0]) { + err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, +- genl_family_attrbuf(&nl80211_fam), +- nl80211_fam.maxattr, nl80211_policy); ++ nl80211_fam.attrbuf, nl80211_fam.maxattr, ++ nl80211_policy); + if (err) + goto out_unlock; + +- *wdev = __cfg80211_wdev_from_attrs( +- sock_net(skb->sk), +- genl_family_attrbuf(&nl80211_fam)); ++ *wdev = __cfg80211_wdev_from_attrs(sock_net(skb->sk), ++ nl80211_fam.attrbuf); + if (IS_ERR(*wdev)) { + err = PTR_ERR(*wdev); + goto out_unlock; +@@ -1903,7 +1916,7 @@ static int nl80211_dump_wiphy_parse(stru + struct netlink_callback *cb, + struct nl80211_dump_wiphy_state *state) + { +- struct nlattr **tb = genl_family_attrbuf(&nl80211_fam); ++ struct nlattr **tb = nl80211_fam.attrbuf; + int ret = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, + tb, nl80211_fam.maxattr, nl80211_policy); + /* ignore parse errors for backward compatibility */ +@@ -7733,7 +7746,6 @@ static int nl80211_send_survey(struct sk + + static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb) + { +- struct nlattr **attrbuf = genl_family_attrbuf(&nl80211_fam); + struct survey_info survey; + struct cfg80211_registered_device *rdev; + struct wireless_dev *wdev; +@@ -7746,7 +7758,7 @@ static int nl80211_dump_survey(struct sk + return res; + + /* prepare_wdev_dump parsed the attributes */ +- radio_stats = attrbuf[NL80211_ATTR_SURVEY_RADIO_STATS]; ++ radio_stats = nl80211_fam.attrbuf[NL80211_ATTR_SURVEY_RADIO_STATS]; + + if (!wdev->netdev) { + res = -EINVAL; +@@ -8594,14 +8606,14 @@ static int nl80211_testmode_dump(struct + */ + phy_idx = cb->args[0] - 1; + } else { +- struct nlattr **attrbuf = genl_family_attrbuf(&nl80211_fam); +- + err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, +- attrbuf, nl80211_fam.maxattr, nl80211_policy); ++ nl80211_fam.attrbuf, nl80211_fam.maxattr, ++ nl80211_policy); + if (err) + goto out_err; + +- rdev = __cfg80211_rdev_from_attrs(sock_net(skb->sk), attrbuf); ++ rdev = __cfg80211_rdev_from_attrs(sock_net(skb->sk), ++ nl80211_fam.attrbuf); + if (IS_ERR(rdev)) { + err = PTR_ERR(rdev); + goto out_err; +@@ -8609,8 +8621,9 @@ static int nl80211_testmode_dump(struct + phy_idx = rdev->wiphy_idx; + rdev = NULL; + +- if (attrbuf[NL80211_ATTR_TESTDATA]) +- cb->args[1] = (long)attrbuf[NL80211_ATTR_TESTDATA]; ++ if (nl80211_fam.attrbuf[NL80211_ATTR_TESTDATA]) ++ cb->args[1] = ++ (long)nl80211_fam.attrbuf[NL80211_ATTR_TESTDATA]; + } + + if (cb->args[1]) { +@@ -10814,7 +10827,8 @@ static int handle_nan_filter(struct nlat + + i = 0; + nla_for_each_nested(attr, attr_filter, rem) { +- filter[i].filter = nla_memdup(attr, GFP_KERNEL); ++ filter[i].filter = kmemdup(nla_data(attr), nla_len(attr), ++ GFP_KERNEL); + filter[i].len = nla_len(attr); + i++; + } +@@ -11450,7 +11464,6 @@ static int nl80211_prepare_vendor_dump(s + struct cfg80211_registered_device **rdev, + struct wireless_dev **wdev) + { +- struct nlattr **attrbuf = genl_family_attrbuf(&nl80211_fam); + u32 vid, subcmd; + unsigned int i; + int vcmd_idx = -1; +@@ -11486,28 +11499,31 @@ static int nl80211_prepare_vendor_dump(s + } + + err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, +- attrbuf, nl80211_fam.maxattr, nl80211_policy); ++ nl80211_fam.attrbuf, nl80211_fam.maxattr, ++ nl80211_policy); + if (err) + goto out_unlock; + +- if (!attrbuf[NL80211_ATTR_VENDOR_ID] || +- !attrbuf[NL80211_ATTR_VENDOR_SUBCMD]) { ++ if (!nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_ID] || ++ !nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_SUBCMD]) { + err = -EINVAL; + goto out_unlock; + } + +- *wdev = __cfg80211_wdev_from_attrs(sock_net(skb->sk), attrbuf); ++ *wdev = __cfg80211_wdev_from_attrs(sock_net(skb->sk), ++ nl80211_fam.attrbuf); + if (IS_ERR(*wdev)) + *wdev = NULL; + +- *rdev = __cfg80211_rdev_from_attrs(sock_net(skb->sk), attrbuf); ++ *rdev = __cfg80211_rdev_from_attrs(sock_net(skb->sk), ++ nl80211_fam.attrbuf); + if (IS_ERR(*rdev)) { + err = PTR_ERR(*rdev); + goto out_unlock; + } + +- vid = nla_get_u32(attrbuf[NL80211_ATTR_VENDOR_ID]); +- subcmd = nla_get_u32(attrbuf[NL80211_ATTR_VENDOR_SUBCMD]); ++ vid = nla_get_u32(nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_ID]); ++ subcmd = nla_get_u32(nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_SUBCMD]); + + for (i = 0; i < (*rdev)->wiphy.n_vendor_commands; i++) { + const struct wiphy_vendor_command *vcmd; +@@ -11531,9 +11547,9 @@ static int nl80211_prepare_vendor_dump(s + goto out_unlock; + } + +- if (attrbuf[NL80211_ATTR_VENDOR_DATA]) { +- data = nla_data(attrbuf[NL80211_ATTR_VENDOR_DATA]); +- data_len = nla_len(attrbuf[NL80211_ATTR_VENDOR_DATA]); ++ if (nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_DATA]) { ++ data = nla_data(nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_DATA]); ++ data_len = nla_len(nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_DATA]); + } + + /* 0 is the first index - add 1 to parse only once */ +@@ -12795,21 +12811,6 @@ static __genl_const struct genl_ops nl80 + }, + }; + +-static struct genl_family nl80211_fam __ro_after_init = { +- .name = NL80211_GENL_NAME, /* have users key off the name instead */ +- .hdrsize = 0, /* no private header */ +- .version = 1, /* no particular meaning now */ +- .maxattr = NL80211_ATTR_MAX, +- .netnsok = true, +- .pre_doit = nl80211_pre_doit, +- .post_doit = nl80211_post_doit, +- .module = THIS_MODULE, +- .ops = nl80211_ops, +- .n_ops = ARRAY_SIZE(nl80211_ops), +- .mcgrps = nl80211_mcgrps, +- .n_mcgrps = ARRAY_SIZE(nl80211_mcgrps), +-}; +- + /* notification functions */ + + void nl80211_notify_wiphy(struct cfg80211_registered_device *rdev, +@@ -14759,11 +14760,12 @@ void nl80211_send_ap_stopped(struct wire + + /* initialisation/exit functions */ + +-int __init nl80211_init(void) ++int nl80211_init(void) + { + int err; + +- err = genl_register_family(&nl80211_fam); ++ err = genl_register_family_with_ops_groups(&nl80211_fam, nl80211_ops, ++ nl80211_mcgrps); + if (err) + return err; + +--- a/drivers/net/wireless/mac80211_hwsim.c ++++ b/drivers/net/wireless/mac80211_hwsim.c +@@ -587,8 +587,15 @@ struct hwsim_radiotap_ack_hdr { + __le16 rt_chbitmask; + } __packed; + +-/* MAC80211_HWSIM netlink family */ +-static struct genl_family hwsim_genl_family; ++/* MAC80211_HWSIM netlinf family */ ++static struct genl_family hwsim_genl_family = { ++ .id = GENL_ID_GENERATE, ++ .hdrsize = 0, ++ .name = "MAC80211_HWSIM", ++ .version = 1, ++ .maxattr = HWSIM_ATTR_MAX, ++ .netnsok = true, ++}; + + enum hwsim_multicast_groups { + HWSIM_MCGRP_CONFIG, +@@ -3250,18 +3257,6 @@ static __genl_const struct genl_ops hwsi + }, + }; + +-static struct genl_family hwsim_genl_family __ro_after_init = { +- .name = "MAC80211_HWSIM", +- .version = 1, +- .maxattr = HWSIM_ATTR_MAX, +- .netnsok = true, +- .module = THIS_MODULE, +- .ops = hwsim_ops, +- .n_ops = ARRAY_SIZE(hwsim_ops), +- .mcgrps = hwsim_mcgrps, +- .n_mcgrps = ARRAY_SIZE(hwsim_mcgrps), +-}; +- + static void destroy_radio(struct work_struct *work) + { + struct mac80211_hwsim_data *data = +@@ -3309,13 +3304,15 @@ static struct notifier_block hwsim_netli + .notifier_call = mac80211_hwsim_netlink_notify, + }; + +-static int __init hwsim_init_netlink(void) ++static int hwsim_init_netlink(void) + { + int rc; + + printk(KERN_INFO "mac80211_hwsim: initializing netlink\n"); + +- rc = genl_register_family(&hwsim_genl_family); ++ rc = genl_register_family_with_ops_groups(&hwsim_genl_family, ++ hwsim_ops, ++ hwsim_mcgrps); + if (rc) + goto failure; + diff --git a/package/kernel/mac80211/patches/008-revert-ndo_stats64-cleanup.patch b/package/kernel/mac80211/patches/008-revert-ndo_stats64-cleanup.patch new file mode 100644 index 0000000000..0f6f0f919f --- /dev/null +++ b/package/kernel/mac80211/patches/008-revert-ndo_stats64-cleanup.patch @@ -0,0 +1,20 @@ +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -1133,7 +1133,7 @@ static u16 ieee80211_netdev_select_queue + return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb); + } + +-static void ++static struct rtnl_link_stats64 * + ieee80211_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) + { + int i; +@@ -1158,6 +1158,8 @@ ieee80211_get_stats64(struct net_device + stats->rx_bytes += rx_bytes; + stats->tx_bytes += tx_bytes; + } ++ ++ return stats; + } + + static const struct net_device_ops ieee80211_dataif_ops = { diff --git a/package/kernel/mac80211/patches/009-revert-mtu-changes.patch b/package/kernel/mac80211/patches/009-revert-mtu-changes.patch new file mode 100644 index 0000000000..f5e2757d3f --- /dev/null +++ b/package/kernel/mac80211/patches/009-revert-mtu-changes.patch @@ -0,0 +1,338 @@ +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -151,6 +151,15 @@ void ieee80211_recalc_idle(struct ieee80 + ieee80211_hw_config(local, change); + } + ++static int ieee80211_change_mtu(struct net_device *dev, int new_mtu) ++{ ++ if (new_mtu < 256 || new_mtu > IEEE80211_MAX_DATA_LEN) ++ return -EINVAL; ++ ++ dev->mtu = new_mtu; ++ return 0; ++} ++ + static int ieee80211_verify_mac(struct ieee80211_sub_if_data *sdata, u8 *addr, + bool check_dup) + { +@@ -1168,6 +1177,7 @@ static const struct net_device_ops ieee8 + .ndo_uninit = ieee80211_uninit, + .ndo_start_xmit = ieee80211_subif_start_xmit, + .ndo_set_rx_mode = ieee80211_set_multicast_list, ++ .ndo_change_mtu = ieee80211_change_mtu, + .ndo_set_mac_address = ieee80211_change_mac, + .ndo_select_queue = ieee80211_netdev_select_queue, + .ndo_get_stats64 = ieee80211_get_stats64, +@@ -1211,6 +1221,7 @@ static const struct net_device_ops ieee8 + .ndo_uninit = ieee80211_uninit, + .ndo_start_xmit = ieee80211_monitor_start_xmit, + .ndo_set_rx_mode = ieee80211_set_multicast_list, ++ .ndo_change_mtu = ieee80211_change_mtu, + .ndo_set_mac_address = ieee80211_change_mac, + .ndo_select_queue = ieee80211_monitor_select_queue, + .ndo_get_stats64 = ieee80211_get_stats64, +@@ -1919,10 +1930,6 @@ int ieee80211_if_add(struct ieee80211_lo + + netdev_set_default_ethtool_ops(ndev, &ieee80211_ethtool_ops); + +- /* MTU range: 256 - 2304 */ +- ndev->min_mtu = 256; +- ndev->max_mtu = IEEE80211_MAX_DATA_LEN; +- + ret = register_netdevice(ndev); + if (ret) { + ieee80211_if_free(ndev); +--- a/drivers/net/wireless/ath/wil6210/netdev.c ++++ b/drivers/net/wireless/ath/wil6210/netdev.c +@@ -42,6 +42,21 @@ static int wil_stop(struct net_device *n + return wil_down(wil); + } + ++static int wil_change_mtu(struct net_device *ndev, int new_mtu) ++{ ++ struct wil6210_priv *wil = ndev_to_wil(ndev); ++ ++ if (new_mtu < 68 || new_mtu > mtu_max) { ++ wil_err(wil, "invalid MTU %d\n", new_mtu); ++ return -EINVAL; ++ } ++ ++ wil_dbg_misc(wil, "change MTU %d -> %d\n", ndev->mtu, new_mtu); ++ ndev->mtu = new_mtu; ++ ++ return 0; ++} ++ + static int wil_do_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd) + { + struct wil6210_priv *wil = ndev_to_wil(ndev); +@@ -55,6 +70,7 @@ static const struct net_device_ops wil_n + .ndo_start_xmit = wil_start_xmit, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, ++ .ndo_change_mtu = wil_change_mtu, + .ndo_do_ioctl = wil_do_ioctl, + }; + +@@ -111,7 +127,6 @@ static int wil6210_netdev_poll_tx(struct + static void wil_dev_setup(struct net_device *dev) + { + ether_setup(dev); +- dev->max_mtu = mtu_max; + dev->tx_queue_len = WIL_TX_Q_LEN_DEFAULT; + } + +--- a/drivers/net/wireless/atmel/atmel.c ++++ b/drivers/net/wireless/atmel/atmel.c +@@ -1295,6 +1295,14 @@ static struct iw_statistics *atmel_get_w + return &priv->wstats; + } + ++static int atmel_change_mtu(struct net_device *dev, int new_mtu) ++{ ++ if ((new_mtu < 68) || (new_mtu > 2312)) ++ return -EINVAL; ++ dev->mtu = new_mtu; ++ return 0; ++} ++ + static int atmel_set_mac_address(struct net_device *dev, void *p) + { + struct sockaddr *addr = p; +@@ -1498,6 +1506,7 @@ static const struct file_operations atme + static const struct net_device_ops atmel_netdev_ops = { + .ndo_open = atmel_open, + .ndo_stop = atmel_close, ++ .ndo_change_mtu = atmel_change_mtu, + .ndo_set_mac_address = atmel_set_mac_address, + .ndo_start_xmit = start_tx, + .ndo_do_ioctl = atmel_ioctl, +@@ -1591,10 +1600,6 @@ struct net_device *init_atmel_card(unsig + dev->irq = irq; + dev->base_addr = port; + +- /* MTU range: 68 - 2312 */ +- dev->min_mtu = 68; +- dev->max_mtu = MAX_WIRELESS_BODY - ETH_FCS_LEN; +- + SET_NETDEV_DEV(dev, sys_dev); + + if ((rc = request_irq(dev->irq, service_interrupt, IRQF_SHARED, dev->name, dev))) { +--- a/drivers/net/wireless/cisco/airo.c ++++ b/drivers/net/wireless/cisco/airo.c +@@ -2329,6 +2329,14 @@ static int airo_set_mac_address(struct n + return 0; + } + ++static int airo_change_mtu(struct net_device *dev, int new_mtu) ++{ ++ if ((new_mtu < 68) || (new_mtu > 2400)) ++ return -EINVAL; ++ dev->mtu = new_mtu; ++ return 0; ++} ++ + static LIST_HEAD(airo_devices); + + static void add_airo_dev(struct airo_info *ai) +@@ -2648,6 +2656,7 @@ static const struct net_device_ops airo1 + .ndo_get_stats = airo_get_stats, + .ndo_set_mac_address = airo_set_mac_address, + .ndo_do_ioctl = airo_ioctl, ++ .ndo_change_mtu = airo_change_mtu, + }; + + static void wifi_setup(struct net_device *dev) +@@ -2659,8 +2668,6 @@ static void wifi_setup(struct net_device + dev->type = ARPHRD_IEEE80211; + dev->hard_header_len = ETH_HLEN; + dev->mtu = AIRO_DEF_MTU; +- dev->min_mtu = 68; +- dev->max_mtu = MIC_MSGLEN_MAX; + dev->addr_len = ETH_ALEN; + dev->tx_queue_len = 100; + +@@ -2747,6 +2754,7 @@ static const struct net_device_ops airo_ + .ndo_set_rx_mode = airo_set_multicast_list, + .ndo_set_mac_address = airo_set_mac_address, + .ndo_do_ioctl = airo_ioctl, ++ .ndo_change_mtu = airo_change_mtu, + .ndo_validate_addr = eth_validate_addr, + }; + +@@ -2758,6 +2766,7 @@ static const struct net_device_ops mpi_n + .ndo_set_rx_mode = airo_set_multicast_list, + .ndo_set_mac_address = airo_set_mac_address, + .ndo_do_ioctl = airo_ioctl, ++ .ndo_change_mtu = airo_change_mtu, + .ndo_validate_addr = eth_validate_addr, + }; + +@@ -2813,7 +2822,6 @@ static struct net_device *_init_airo_car + dev->irq = irq; + dev->base_addr = port; + dev->priv_flags &= ~IFF_TX_SKB_SHARING; +- dev->max_mtu = MIC_MSGLEN_MAX; + + SET_NETDEV_DEV(dev, dmdev); + +--- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c ++++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c +@@ -6039,6 +6039,7 @@ static const struct net_device_ops ipw21 + .ndo_open = ipw2100_open, + .ndo_stop = ipw2100_close, + .ndo_start_xmit = libipw_xmit, ++ .ndo_change_mtu = libipw_change_mtu, + .ndo_tx_timeout = ipw2100_tx_timeout, + .ndo_set_mac_address = ipw2100_set_address, + .ndo_validate_addr = eth_validate_addr, +@@ -6074,8 +6075,6 @@ static struct net_device *ipw2100_alloc_ + dev->wireless_data = &priv->wireless_data; + dev->watchdog_timeo = 3 * HZ; + dev->irq = 0; +- dev->min_mtu = 68; +- dev->max_mtu = LIBIPW_DATA_LEN; + + /* NOTE: We don't use the wireless_handlers hook + * in dev as the system will start throwing WX requests +--- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c ++++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c +@@ -11561,6 +11561,7 @@ static const struct net_device_ops ipw_p + .ndo_open = ipw_prom_open, + .ndo_stop = ipw_prom_stop, + .ndo_start_xmit = ipw_prom_hard_start_xmit, ++ .ndo_change_mtu = libipw_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, + }; +@@ -11586,9 +11587,6 @@ static int ipw_prom_alloc(struct ipw_pri + priv->prom_net_dev->type = ARPHRD_IEEE80211_RADIOTAP; + priv->prom_net_dev->netdev_ops = &ipw_prom_netdev_ops; + +- priv->prom_net_dev->min_mtu = 68; +- priv->prom_net_dev->max_mtu = LIBIPW_DATA_LEN; +- + priv->prom_priv->ieee->iw_mode = IW_MODE_MONITOR; + SET_NETDEV_DEV(priv->prom_net_dev, &priv->pci_dev->dev); + +@@ -11621,6 +11619,7 @@ static const struct net_device_ops ipw_n + .ndo_set_rx_mode = ipw_net_set_multicast_list, + .ndo_set_mac_address = ipw_net_set_mac_address, + .ndo_start_xmit = libipw_xmit, ++ .ndo_change_mtu = libipw_change_mtu, + .ndo_validate_addr = eth_validate_addr, + }; + +@@ -11730,9 +11729,6 @@ static int ipw_pci_probe(struct pci_dev + net_dev->wireless_handlers = &ipw_wx_handler_def; + net_dev->ethtool_ops = &ipw_ethtool_ops; + +- net_dev->min_mtu = 68; +- net_dev->max_mtu = LIBIPW_DATA_LEN; +- + err = sysfs_create_group(&pdev->dev.kobj, &ipw_attribute_group); + if (err) { + IPW_ERROR("failed to create sysfs device attributes\n"); +--- a/drivers/net/wireless/intel/ipw2x00/libipw.h ++++ b/drivers/net/wireless/intel/ipw2x00/libipw.h +@@ -948,6 +948,7 @@ static inline int libipw_is_cck_rate(u8 + /* libipw.c */ + void free_libipw(struct net_device *dev, int monitor); + struct net_device *alloc_libipw(int sizeof_priv, int monitor); ++int libipw_change_mtu(struct net_device *dev, int new_mtu); + + void libipw_networks_age(struct libipw_device *ieee, unsigned long age_secs); + +--- a/drivers/net/wireless/intel/ipw2x00/libipw_module.c ++++ b/drivers/net/wireless/intel/ipw2x00/libipw_module.c +@@ -118,6 +118,15 @@ static void libipw_networks_initialize(s + &ieee->network_free_list); + } + ++int libipw_change_mtu(struct net_device *dev, int new_mtu) ++{ ++ if ((new_mtu < 68) || (new_mtu > LIBIPW_DATA_LEN)) ++ return -EINVAL; ++ dev->mtu = new_mtu; ++ return 0; ++} ++EXPORT_SYMBOL(libipw_change_mtu); ++ + struct net_device *alloc_libipw(int sizeof_priv, int monitor) + { + struct libipw_device *ieee; +--- a/drivers/net/wireless/intersil/hostap/hostap_main.c ++++ b/drivers/net/wireless/intersil/hostap/hostap_main.c +@@ -765,6 +765,16 @@ static void hostap_set_multicast_list(st + } + + ++static int prism2_change_mtu(struct net_device *dev, int new_mtu) ++{ ++ if (new_mtu < PRISM2_MIN_MTU || new_mtu > PRISM2_MAX_MTU) ++ return -EINVAL; ++ ++ dev->mtu = new_mtu; ++ return 0; ++} ++ ++ + static void prism2_tx_timeout(struct net_device *dev) + { + struct hostap_interface *iface; +@@ -803,6 +813,7 @@ static const struct net_device_ops hosta + .ndo_do_ioctl = hostap_ioctl, + .ndo_set_mac_address = prism2_set_mac_address, + .ndo_set_rx_mode = hostap_set_multicast_list, ++ .ndo_change_mtu = prism2_change_mtu, + .ndo_tx_timeout = prism2_tx_timeout, + .ndo_validate_addr = eth_validate_addr, + }; +@@ -815,6 +826,7 @@ static const struct net_device_ops hosta + .ndo_do_ioctl = hostap_ioctl, + .ndo_set_mac_address = prism2_set_mac_address, + .ndo_set_rx_mode = hostap_set_multicast_list, ++ .ndo_change_mtu = prism2_change_mtu, + .ndo_tx_timeout = prism2_tx_timeout, + .ndo_validate_addr = eth_validate_addr, + }; +@@ -827,6 +839,7 @@ static const struct net_device_ops hosta + .ndo_do_ioctl = hostap_ioctl, + .ndo_set_mac_address = prism2_set_mac_address, + .ndo_set_rx_mode = hostap_set_multicast_list, ++ .ndo_change_mtu = prism2_change_mtu, + .ndo_tx_timeout = prism2_tx_timeout, + .ndo_validate_addr = eth_validate_addr, + }; +@@ -838,8 +851,6 @@ void hostap_setup_dev(struct net_device + + iface = netdev_priv(dev); + ether_setup(dev); +- dev->min_mtu = PRISM2_MIN_MTU; +- dev->max_mtu = PRISM2_MAX_MTU; + dev->priv_flags &= ~IFF_TX_SKB_SHARING; + + /* kernel callbacks */ +--- a/drivers/net/wireless/intersil/orinoco/main.c ++++ b/drivers/net/wireless/intersil/orinoco/main.c +@@ -322,6 +322,9 @@ int orinoco_change_mtu(struct net_device + { + struct orinoco_private *priv = ndev_priv(dev); + ++ if ((new_mtu < ORINOCO_MIN_MTU) || (new_mtu > ORINOCO_MAX_MTU)) ++ return -EINVAL; ++ + /* MTU + encapsulation + header length */ + if ((new_mtu + ENCAPS_OVERHEAD + sizeof(struct ieee80211_hdr)) > + (priv->nicbuf_size - ETH_HLEN)) +@@ -2285,9 +2288,6 @@ int orinoco_if_add(struct orinoco_privat + dev->base_addr = base_addr; + dev->irq = irq; + +- dev->min_mtu = ORINOCO_MIN_MTU; +- dev->max_mtu = ORINOCO_MAX_MTU; +- + SET_NETDEV_DEV(dev, priv->dev); + ret = register_netdev(dev); + if (ret) diff --git a/package/kernel/mac80211/patches/011-backport_strscpy.patch b/package/kernel/mac80211/patches/011-backport_strscpy.patch new file mode 100644 index 0000000000..c8e26c46f2 --- /dev/null +++ b/package/kernel/mac80211/patches/011-backport_strscpy.patch @@ -0,0 +1,43 @@ +--- a/backport-include/linux/string.h ++++ b/backport-include/linux/string.h +@@ -25,4 +25,8 @@ extern void *memdup_user_nul(const void + void memzero_explicit(void *s, size_t count); + #endif + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)) ++ssize_t strscpy(char *dest, const char *src, size_t count); ++#endif ++ + #endif /* __BACKPORT_LINUX_STRING_H */ +--- a/compat/backport-4.3.c ++++ b/compat/backport-4.3.c +@@ -57,3 +57,29 @@ void seq_hex_dump(struct seq_file *m, co + } + } + EXPORT_SYMBOL_GPL(seq_hex_dump); ++ ++ssize_t strscpy(char *dest, const char *src, size_t count) ++{ ++ long res = 0; ++ ++ if (count == 0) ++ return -E2BIG; ++ ++ while (count) { ++ char c; ++ ++ c = src[res]; ++ dest[res] = c; ++ if (!c) ++ return res; ++ res++; ++ count--; ++ } ++ ++ /* Hit buffer length without finding a NUL; force NUL-termination. */ ++ if (res) ++ dest[res-1] = '\0'; ++ ++ return -E2BIG; ++} ++EXPORT_SYMBOL_GPL(strscpy); diff --git a/package/kernel/mac80211/patches/030-rt2x00_options.patch b/package/kernel/mac80211/patches/030-rt2x00_options.patch new file mode 100644 index 0000000000..a4ca8848c6 --- /dev/null +++ b/package/kernel/mac80211/patches/030-rt2x00_options.patch @@ -0,0 +1,47 @@ +--- a/drivers/net/wireless/ralink/rt2x00/Kconfig ++++ b/drivers/net/wireless/ralink/rt2x00/Kconfig +@@ -225,36 +225,37 @@ config RT2800SOC + + + config RT2800_LIB +- tristate ++ tristate "RT2800 USB/PCI support" + depends on m + + config RT2800_LIB_MMIO +- tristate ++ tristate "RT2800 MMIO support" + depends on m + select RT2X00_LIB_MMIO + select RT2800_LIB + + config RT2X00_LIB_MMIO +- tristate ++ tristate "RT2x00 MMIO support" + depends on m + + config RT2X00_LIB_PCI +- tristate ++ tristate "RT2x00 PCI support" + depends on m + select RT2X00_LIB + + config RT2X00_LIB_SOC +- tristate ++ tristate "RT2x00 SoC support" ++ depends on SOC_RT288X || SOC_RT305X + depends on m + select RT2X00_LIB + + config RT2X00_LIB_USB +- tristate ++ tristate "RT2x00 USB support" + depends on m + select RT2X00_LIB + + config RT2X00_LIB +- tristate ++ tristate "RT2x00 support" + depends on m + + config RT2X00_LIB_FIRMWARE diff --git a/package/kernel/mac80211/patches/040-brcmutil_option.patch b/package/kernel/mac80211/patches/040-brcmutil_option.patch new file mode 100644 index 0000000000..167332d916 --- /dev/null +++ b/package/kernel/mac80211/patches/040-brcmutil_option.patch @@ -0,0 +1,9 @@ +--- a/drivers/net/wireless/broadcom/brcm80211/Kconfig ++++ b/drivers/net/wireless/broadcom/brcm80211/Kconfig +@@ -1,5 +1,5 @@ + config BRCMUTIL +- tristate ++ tristate "Broadcom 802.11 driver utility functions" + depends on m + + config BRCMSMAC diff --git a/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch b/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch index 4df5ac57f0..527938f015 100644 --- a/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch +++ b/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch @@ -1,6 +1,6 @@ --- a/.local-symbols +++ b/.local-symbols -@@ -477,45 +477,6 @@ USB_IPHETH= +@@ -482,45 +482,6 @@ USB_IPHETH= USB_SIERRA_NET= USB_VL600= USB_NET_CH9200= @@ -88,7 +88,7 @@ gpiodev = bus->chipco.dev ? : pcidev; --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/Makefile +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/Makefile -@@ -43,6 +43,6 @@ brcmsmac-y := \ +@@ -42,6 +42,6 @@ brcmsmac-y := \ brcms_trace_events.o \ debug.o diff --git a/package/kernel/mac80211/patches/090-remove-cred.patch b/package/kernel/mac80211/patches/090-remove-cred.patch new file mode 100644 index 0000000000..3adb2afb86 --- /dev/null +++ b/package/kernel/mac80211/patches/090-remove-cred.patch @@ -0,0 +1,15 @@ +This is only needed for kernel < 2.6.29 and conflicts with kernel 4.4.42 + +--- a/backport-include/linux/cred.h ++++ /dev/null +@@ -1,10 +0,0 @@ +-#ifndef __BACKPORT_LINUX_CRED_H +-#define __BACKPORT_LINUX_CRED_H +-#include_next +-#include +- +-#ifndef current_user_ns +-#define current_user_ns() (current->nsproxy->user_ns) +-#endif +- +-#endif /* __BACKPORT_LINUX_CRED_H */ diff --git a/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch b/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch index b65b0bd00e..95fea441a4 100644 --- a/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch +++ b/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch @@ -18,12 +18,12 @@ - aes_gcm.o \ aes_cmac.o \ - aes_gmac.o \ + fils_aead.o \ cfg.o \ ethtool.o \ - rx.o \ --- a/net/mac80211/aes_ccm.c +++ b/net/mac80211/aes_ccm.c -@@ -13,89 +13,132 @@ +@@ -13,103 +13,132 @@ #include #include #include @@ -33,14 +33,39 @@ #include "key.h" #include "aes_ccm.h" --void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +-int ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +- u8 *data, size_t data_len, u8 *mic, +- size_t mic_len) +static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, u8 *s_0, + u8 *a, u8 *b) -+{ + { +- struct scatterlist sg[3]; +- struct aead_request *aead_req; +- int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm); +- u8 *__aad; +- +- aead_req = kzalloc(reqsize + CCM_AAD_LEN, GFP_ATOMIC); +- if (!aead_req) +- return -ENOMEM; +- +- __aad = (u8 *)aead_req + reqsize; +- memcpy(__aad, aad, CCM_AAD_LEN); +- +- sg_init_table(sg, 3); +- sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad)); +- sg_set_buf(&sg[1], data, data_len); +- sg_set_buf(&sg[2], mic, mic_len); +- +- aead_request_set_tfm(aead_req, tfm); +- aead_request_set_crypt(aead_req, sg, sg, data_len, b_0); +- aead_request_set_ad(aead_req, sg[0].length); + int i; -+ + +- crypto_aead_encrypt(aead_req); +- kzfree(aead_req); + crypto_cipher_encrypt_one(tfm, b, b_0); -+ + +- return 0; + /* Extra Authenticate-only data (always two AES blocks) */ + for (i = 0; i < AES_BLOCK_SIZE; i++) + aad[i] ^= b[i]; @@ -63,52 +88,38 @@ + + +void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, - u8 *data, size_t data_len, u8 *mic, - size_t mic_len) - { -- struct scatterlist sg[3]; ++ u8 *data, size_t data_len, u8 *mic, ++ size_t mic_len) ++{ + int i, j, last_len, num_blocks; + u8 b[AES_BLOCK_SIZE]; + u8 s_0[AES_BLOCK_SIZE]; + u8 e[AES_BLOCK_SIZE]; + u8 *pos, *cpos; - -- char aead_req_data[sizeof(struct aead_request) + -- crypto_aead_reqsize(tfm)] -- __aligned(__alignof__(struct aead_request)); -- struct aead_request *aead_req = (void *) aead_req_data; ++ + num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); + last_len = data_len % AES_BLOCK_SIZE; + aes_ccm_prepare(tfm, b_0, aad, s_0, b, b); - -- memset(aead_req, 0, sizeof(aead_req_data)); ++ + /* Process payload blocks */ + pos = data; + cpos = data; + for (j = 1; j <= num_blocks; j++) { + int blen = (j == num_blocks && last_len) ? + last_len : AES_BLOCK_SIZE; - -- sg_init_table(sg, 3); -- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad)); -- sg_set_buf(&sg[1], data, data_len); -- sg_set_buf(&sg[2], mic, mic_len); ++ + /* Authentication followed by encryption */ + for (i = 0; i < blen; i++) + b[i] ^= pos[i]; + crypto_cipher_encrypt_one(tfm, b, b); - -- aead_request_set_tfm(aead_req, tfm); -- aead_request_set_crypt(aead_req, sg, sg, data_len, b_0); -- aead_request_set_ad(aead_req, sg[0].length); ++ + b_0[14] = (j >> 8) & 0xff; + b_0[15] = j & 0xff; + crypto_cipher_encrypt_one(tfm, e, b_0); + for (i = 0; i < blen; i++) + *cpos++ = *pos++ ^ e[i]; + } - -- crypto_aead_encrypt(aead_req); ++ + for (i = 0; i < mic_len; i++) + mic[i] = b[i] ^ s_0[i]; } @@ -119,34 +130,46 @@ size_t mic_len) { - struct scatterlist sg[3]; -- char aead_req_data[sizeof(struct aead_request) + -- crypto_aead_reqsize(tfm)] -- __aligned(__alignof__(struct aead_request)); -- struct aead_request *aead_req = (void *) aead_req_data; +- struct aead_request *aead_req; +- int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm); +- u8 *__aad; +- int err; +- +- if (data_len == 0) +- return -EINVAL; +- +- aead_req = kzalloc(reqsize + CCM_AAD_LEN, GFP_ATOMIC); +- if (!aead_req) +- return -ENOMEM; +- +- __aad = (u8 *)aead_req + reqsize; +- memcpy(__aad, aad, CCM_AAD_LEN); +- +- sg_init_table(sg, 3); +- sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad)); +- sg_set_buf(&sg[1], data, data_len); +- sg_set_buf(&sg[2], mic, mic_len); +- +- aead_request_set_tfm(aead_req, tfm); +- aead_request_set_crypt(aead_req, sg, sg, data_len + mic_len, b_0); +- aead_request_set_ad(aead_req, sg[0].length); + int i, j, last_len, num_blocks; + u8 *pos, *cpos; + u8 a[AES_BLOCK_SIZE]; + u8 b[AES_BLOCK_SIZE]; + u8 s_0[AES_BLOCK_SIZE]; - -- if (data_len == 0) -- return -EINVAL; ++ + num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); + last_len = data_len % AES_BLOCK_SIZE; + aes_ccm_prepare(tfm, b_0, aad, s_0, a, b); - -- memset(aead_req, 0, sizeof(aead_req_data)); ++ + /* Process payload blocks */ + cpos = data; + pos = data; + for (j = 1; j <= num_blocks; j++) { + int blen = (j == num_blocks && last_len) ? + last_len : AES_BLOCK_SIZE; - -- sg_init_table(sg, 3); -- sg_set_buf(&sg[0], &aad[2], be16_to_cpup((__be16 *)aad)); -- sg_set_buf(&sg[1], data, data_len); -- sg_set_buf(&sg[2], mic, mic_len); ++ + /* Decryption followed by authentication */ + b_0[14] = (j >> 8) & 0xff; + b_0[15] = j & 0xff; @@ -157,16 +180,16 @@ + } + crypto_cipher_encrypt_one(tfm, a, a); + } - -- aead_request_set_tfm(aead_req, tfm); -- aead_request_set_crypt(aead_req, sg, sg, data_len + mic_len, b_0); -- aead_request_set_ad(aead_req, sg[0].length); ++ + for (i = 0; i < mic_len; i++) { + if ((mic[i] ^ s_0[i]) != a[i]) + return -1; + } -- return crypto_aead_decrypt(aead_req); +- err = crypto_aead_decrypt(aead_req); +- kzfree(aead_req); +- +- return err; + return 0; } @@ -179,12 +202,12 @@ { - struct crypto_aead *tfm; - int err; -- ++ struct crypto_cipher *tfm; + - tfm = crypto_alloc_aead("ccm(aes)", 0, CRYPTO_ALG_ASYNC); - if (IS_ERR(tfm)) - return tfm; -+ struct crypto_cipher *tfm; - +- - err = crypto_aead_setkey(tfm, key, key_len); - if (err) - goto free_aead; @@ -209,73 +232,11 @@ - crypto_free_aead(tfm); + crypto_free_cipher(tfm); } ---- a/net/mac80211/aes_ccm.h -+++ b/net/mac80211/aes_ccm.h -@@ -12,15 +12,15 @@ - - #include - --struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], -- size_t key_len, -- size_t mic_len); --void ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], -+ size_t key_len, -+ size_t mic_len); -+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, - u8 *data, size_t data_len, u8 *mic, - size_t mic_len); --int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, - u8 *data, size_t data_len, u8 *mic, - size_t mic_len); --void ieee80211_aes_key_free(struct crypto_aead *tfm); -+void ieee80211_aes_key_free(struct crypto_cipher *tfm); - - #endif /* AES_CCM_H */ ---- a/net/mac80211/aes_gcm.h -+++ b/net/mac80211/aes_gcm.h -@@ -11,12 +11,28 @@ - - #include - --void ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -- u8 *data, size_t data_len, u8 *mic); --int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -- u8 *data, size_t data_len, u8 *mic); --struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], -- size_t key_len); --void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm); -+static inline void -+ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic) -+{ -+} -+ -+static inline int -+ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic) -+{ -+ return -EOPNOTSUPP; -+} -+ -+static inline struct crypto_aead * -+ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], size_t key_len) -+{ -+ return NULL; -+} -+ -+static inline void -+ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) -+{ -+} - - #endif /* AES_GCM_H */ --- a/net/mac80211/aes_gmac.h +++ b/net/mac80211/aes_gmac.h -@@ -11,10 +11,22 @@ - - #include +@@ -15,10 +15,22 @@ + #define GMAC_MIC_LEN 16 + #define GMAC_NONCE_LEN 12 -struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], - size_t key_len); @@ -314,7 +275,7 @@ struct { --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c -@@ -304,7 +304,8 @@ ieee80211_crypto_tkip_decrypt(struct iee +@@ -305,7 +305,8 @@ ieee80211_crypto_tkip_decrypt(struct iee } @@ -324,7 +285,7 @@ { __le16 mask_fc; int a4_included, mgmt; -@@ -334,14 +335,8 @@ static void ccmp_special_blocks(struct s +@@ -335,14 +336,8 @@ static void ccmp_special_blocks(struct s else qos_tid = 0; @@ -341,7 +302,7 @@ /* Nonce: Nonce Flags | A2 | PN * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7) -@@ -349,6 +344,8 @@ static void ccmp_special_blocks(struct s +@@ -350,6 +345,8 @@ static void ccmp_special_blocks(struct s b_0[1] = qos_tid | (mgmt << 4); memcpy(&b_0[2], hdr->addr2, ETH_ALEN); memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN); @@ -350,16 +311,31 @@ /* AAD (extra authenticate-only data) / masked 802.11 header * FC | A1 | A2 | A3 | SC | [A4] | [QC] */ -@@ -460,7 +457,7 @@ static int ccmp_encrypt_skb(struct ieee8 +@@ -406,7 +403,7 @@ static int ccmp_encrypt_skb(struct ieee8 + u8 *pos; + u8 pn[6]; + u64 pn64; +- u8 aad[CCM_AAD_LEN]; ++ u8 aad[2 * AES_BLOCK_SIZE]; + u8 b_0[AES_BLOCK_SIZE]; + + if (info->control.hw_key && +@@ -461,9 +458,11 @@ static int ccmp_encrypt_skb(struct ieee8 return 0; pos += IEEE80211_CCMP_HDR_LEN; - ccmp_special_blocks(skb, pn, b_0, aad); +- return ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, +- skb_put(skb, mic_len), mic_len); + ccmp_special_blocks(skb, pn, b_0, aad, len); - ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, - skb_put(skb, mic_len), mic_len); ++ ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, ++ skb_put(skb, mic_len), mic_len); ++ ++ return 0; + } + -@@ -537,7 +534,7 @@ ieee80211_crypto_ccmp_decrypt(struct iee +@@ -536,7 +535,7 @@ ieee80211_crypto_ccmp_decrypt(struct iee u8 aad[2 * AES_BLOCK_SIZE]; u8 b_0[AES_BLOCK_SIZE]; /* hardware didn't decrypt/verify MIC */ @@ -368,3 +344,113 @@ if (ieee80211_aes_ccm_decrypt( key->u.ccmp.tfm, b_0, aad, +@@ -638,7 +637,7 @@ static int gcmp_encrypt_skb(struct ieee8 + u8 *pos; + u8 pn[6]; + u64 pn64; +- u8 aad[GCM_AAD_LEN]; ++ u8 aad[2 * AES_BLOCK_SIZE]; + u8 j_0[AES_BLOCK_SIZE]; + + if (info->control.hw_key && +@@ -695,8 +694,10 @@ static int gcmp_encrypt_skb(struct ieee8 + + pos += IEEE80211_GCMP_HDR_LEN; + gcmp_special_blocks(skb, pn, j_0, aad); +- return ieee80211_aes_gcm_encrypt(key->u.gcmp.tfm, j_0, aad, pos, len, +- skb_put(skb, IEEE80211_GCMP_MIC_LEN)); ++ ieee80211_aes_gcm_encrypt(key->u.gcmp.tfm, j_0, aad, pos, len, ++ skb_put(skb, IEEE80211_GCMP_MIC_LEN)); ++ ++ return 0; + } + + ieee80211_tx_result +@@ -1120,9 +1121,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct + struct ieee80211_key *key = tx->key; + struct ieee80211_mmie_16 *mmie; + struct ieee80211_hdr *hdr; +- u8 aad[GMAC_AAD_LEN]; ++ u8 aad[20]; + u64 pn64; +- u8 nonce[GMAC_NONCE_LEN]; ++ u8 nonce[12]; + + if (WARN_ON(skb_queue_len(&tx->skbs) != 1)) + return TX_DROP; +@@ -1168,7 +1169,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); + struct ieee80211_key *key = rx->key; + struct ieee80211_mmie_16 *mmie; +- u8 aad[GMAC_AAD_LEN], mic[GMAC_MIC_LEN], ipn[6], nonce[GMAC_NONCE_LEN]; ++ u8 aad[20], mic[16], ipn[6], nonce[12]; + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; + + if (!ieee80211_is_mgmt(hdr->frame_control)) +--- a/net/mac80211/aes_ccm.h ++++ b/net/mac80211/aes_ccm.h +@@ -12,17 +12,15 @@ + + #include + +-#define CCM_AAD_LEN 32 +- +-struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], +- size_t key_len, +- size_t mic_len); +-int ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +- u8 *data, size_t data_len, u8 *mic, +- size_t mic_len); +-int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, ++struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], ++ size_t key_len, ++ size_t mic_len); ++void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic, ++ size_t mic_len); ++int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, + u8 *data, size_t data_len, u8 *mic, + size_t mic_len); +-void ieee80211_aes_key_free(struct crypto_aead *tfm); ++void ieee80211_aes_key_free(struct crypto_cipher *tfm); + + #endif /* AES_CCM_H */ +--- a/net/mac80211/aes_gcm.h ++++ b/net/mac80211/aes_gcm.h +@@ -11,14 +11,28 @@ + + #include + +-#define GCM_AAD_LEN 32 ++static inline void ++ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic) ++{ ++} + +-int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, +- u8 *data, size_t data_len, u8 *mic); +-int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, +- u8 *data, size_t data_len, u8 *mic); +-struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], +- size_t key_len); +-void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm); ++static inline int ++ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic) ++{ ++ return -EOPNOTSUPP; ++} ++ ++static inline struct crypto_aead * ++ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], size_t key_len) ++{ ++ return NULL; ++} ++ ++static inline void ++ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) ++{ ++} + + #endif /* AES_GCM_H */ diff --git a/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch b/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch index c42b17de38..ff619129d9 100644 --- a/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch +++ b/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch @@ -2,7 +2,7 @@ Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnects --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -1016,7 +1016,6 @@ static int ieee80211_stop_ap(struct wiph +@@ -1014,7 +1014,6 @@ static int ieee80211_stop_ap(struct wiph sdata->u.ap.driver_smps_mode = IEEE80211_SMPS_OFF; __sta_info_flush(sdata, true); diff --git a/package/kernel/mac80211/patches/130-mac80211-hwsim-hrtimer-clock.patch b/package/kernel/mac80211/patches/130-mac80211-hwsim-hrtimer-clock.patch index 29d70343bb..828ed83cb7 100644 --- a/package/kernel/mac80211/patches/130-mac80211-hwsim-hrtimer-clock.patch +++ b/package/kernel/mac80211/patches/130-mac80211-hwsim-hrtimer-clock.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c -@@ -2662,7 +2662,7 @@ static int mac80211_hwsim_new_radio(stru +@@ -2678,7 +2678,7 @@ static int mac80211_hwsim_new_radio(stru tasklet_hrtimer_init(&data->beacon_timer, mac80211_hwsim_beacon, diff --git a/package/kernel/mac80211/patches/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/150-disable_addr_notifier.patch index f4cb41cd30..ca1e53f8df 100644 --- a/package/kernel/mac80211/patches/150-disable_addr_notifier.patch +++ b/package/kernel/mac80211/patches/150-disable_addr_notifier.patch @@ -18,7 +18,7 @@ static int ieee80211_ifa6_changed(struct notifier_block *nb, unsigned long data, void *arg) { -@@ -1101,14 +1101,14 @@ int ieee80211_register_hw(struct ieee802 +@@ -1111,14 +1111,14 @@ int ieee80211_register_hw(struct ieee802 if (result) goto fail_flows; @@ -35,7 +35,7 @@ local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed; result = register_inet6addr_notifier(&local->ifa6_notifier); if (result) -@@ -1117,13 +1117,13 @@ int ieee80211_register_hw(struct ieee802 +@@ -1127,13 +1127,13 @@ int ieee80211_register_hw(struct ieee802 return 0; @@ -52,7 +52,7 @@ fail_ifa: #endif ieee80211_txq_teardown_flows(local); -@@ -1153,10 +1153,10 @@ void ieee80211_unregister_hw(struct ieee +@@ -1163,10 +1163,10 @@ void ieee80211_unregister_hw(struct ieee tasklet_kill(&local->tx_pending_tasklet); tasklet_kill(&local->tasklet); diff --git a/package/kernel/mac80211/patches/210-ap_scan.patch b/package/kernel/mac80211/patches/210-ap_scan.patch index 94f5f397c9..3b613bba0e 100644 --- a/package/kernel/mac80211/patches/210-ap_scan.patch +++ b/package/kernel/mac80211/patches/210-ap_scan.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2175,7 +2175,7 @@ static int ieee80211_scan(struct wiphy * +@@ -2165,7 +2165,7 @@ static int ieee80211_scan(struct wiphy * * the frames sent while scanning on other channel will be * lost) */ diff --git a/package/kernel/mac80211/patches/300-ath9k-Switch-to-using-mac80211-intermediate-software.patch b/package/kernel/mac80211/patches/300-ath9k-Switch-to-using-mac80211-intermediate-software.patch deleted file mode 100644 index 57917c5b45..0000000000 --- a/package/kernel/mac80211/patches/300-ath9k-Switch-to-using-mac80211-intermediate-software.patch +++ /dev/null @@ -1,953 +0,0 @@ -From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= -Date: Fri, 2 Sep 2016 16:00:30 +0200 -Subject: [PATCH] ath9k: Switch to using mac80211 intermediate software - queues. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This switches ath9k over to using the mac80211 intermediate software -queueing mechanism for data packets. It removes the queueing inside the -driver, except for the retry queue, and instead pulls from mac80211 when -a packet is needed. The retry queue is used to store a packet that was -pulled but can't be sent immediately. - -The old code path in ath_tx_start that would queue packets has been -removed completely, as has the qlen limit tunables (since there's no -longer a queue in the driver to limit). - -Based on Tim's original patch set, but reworked quite thoroughly. - -Cc: Tim Shepard -Cc: Felix Fietkau -Signed-off-by: Toke Høiland-Jørgensen ---- - ---- a/drivers/net/wireless/ath/ath9k/ath9k.h -+++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -91,7 +91,6 @@ int ath_descdma_setup(struct ath_softc * - #define ATH_RXBUF 512 - #define ATH_TXBUF 512 - #define ATH_TXBUF_RESERVE 5 --#define ATH_MAX_QDEPTH (ATH_TXBUF / 4 - ATH_TXBUF_RESERVE) - #define ATH_TXMAXTRY 13 - #define ATH_MAX_SW_RETRIES 30 - -@@ -145,7 +144,7 @@ int ath_descdma_setup(struct ath_softc * - #define BAW_WITHIN(_start, _bawsz, _seqno) \ - ((((_seqno) - (_start)) & 4095) < (_bawsz)) - --#define ATH_AN_2_TID(_an, _tidno) (&(_an)->tid[(_tidno)]) -+#define ATH_AN_2_TID(_an, _tidno) ath_node_to_tid(_an, _tidno) - - #define IS_HT_RATE(rate) (rate & 0x80) - #define IS_CCK_RATE(rate) ((rate >= 0x18) && (rate <= 0x1e)) -@@ -164,7 +163,6 @@ struct ath_txq { - spinlock_t axq_lock; - u32 axq_depth; - u32 axq_ampdu_depth; -- bool stopped; - bool axq_tx_inprogress; - struct list_head txq_fifo[ATH_TXFIFO_DEPTH]; - u8 txq_headidx; -@@ -232,7 +230,6 @@ struct ath_buf { - - struct ath_atx_tid { - struct list_head list; -- struct sk_buff_head buf_q; - struct sk_buff_head retry_q; - struct ath_node *an; - struct ath_txq *txq; -@@ -247,13 +244,13 @@ struct ath_atx_tid { - s8 bar_index; - bool active; - bool clear_ps_filter; -+ bool has_queued; - }; - - struct ath_node { - struct ath_softc *sc; - struct ieee80211_sta *sta; /* station struct we're part of */ - struct ieee80211_vif *vif; /* interface with which we're associated */ -- struct ath_atx_tid tid[IEEE80211_NUM_TIDS]; - - u16 maxampdu; - u8 mpdudensity; -@@ -276,7 +273,6 @@ struct ath_tx_control { - struct ath_node *an; - struct ieee80211_sta *sta; - u8 paprd; -- bool force_channel; - }; - - -@@ -293,7 +289,6 @@ struct ath_tx { - struct ath_descdma txdma; - struct ath_txq *txq_map[IEEE80211_NUM_ACS]; - struct ath_txq *uapsdq; -- u32 txq_max_pending[IEEE80211_NUM_ACS]; - u16 max_aggr_framelen[IEEE80211_NUM_ACS][4][32]; - }; - -@@ -421,6 +416,22 @@ struct ath_offchannel { - int duration; - }; - -+static inline struct ath_atx_tid * -+ath_node_to_tid(struct ath_node *an, u8 tidno) -+{ -+ struct ieee80211_sta *sta = an->sta; -+ struct ieee80211_vif *vif = an->vif; -+ struct ieee80211_txq *txq; -+ -+ BUG_ON(!vif); -+ if (sta) -+ txq = sta->txq[tidno % ARRAY_SIZE(sta->txq)]; -+ else -+ txq = vif->txq; -+ -+ return (struct ath_atx_tid *) txq->drv_priv; -+} -+ - #define case_rtn_string(val) case val: return #val - - #define ath_for_each_chanctx(_sc, _ctx) \ -@@ -575,7 +586,6 @@ void ath_tx_edma_tasklet(struct ath_soft - int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, - u16 tid, u16 *ssn); - void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); --void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); - - void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an); - void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc, -@@ -585,6 +595,7 @@ void ath9k_release_buffered_frames(struc - u16 tids, int nframes, - enum ieee80211_frame_release_type reason, - bool more_data); -+void ath9k_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *queue); - - /********/ - /* VIFs */ ---- a/drivers/net/wireless/ath/ath9k/channel.c -+++ b/drivers/net/wireless/ath/ath9k/channel.c -@@ -1010,7 +1010,6 @@ static void ath_scan_send_probe(struct a - goto error; - - txctl.txq = sc->tx.txq_map[IEEE80211_AC_VO]; -- txctl.force_channel = true; - if (ath_tx_start(sc->hw, skb, &txctl)) - goto error; - -@@ -1133,7 +1132,6 @@ ath_chanctx_send_vif_ps_frame(struct ath - memset(&txctl, 0, sizeof(txctl)); - txctl.txq = sc->tx.txq_map[IEEE80211_AC_VO]; - txctl.sta = sta; -- txctl.force_channel = true; - if (ath_tx_start(sc->hw, skb, &txctl)) { - ieee80211_free_txskb(sc->hw, skb); - return false; ---- a/drivers/net/wireless/ath/ath9k/debug.c -+++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -600,7 +600,6 @@ static int read_file_xmit(struct seq_fil - PR("MPDUs XRetried: ", xretries); - PR("Aggregates: ", a_aggr); - PR("AMPDUs Queued HW:", a_queued_hw); -- PR("AMPDUs Queued SW:", a_queued_sw); - PR("AMPDUs Completed:", a_completed); - PR("AMPDUs Retried: ", a_retries); - PR("AMPDUs XRetried: ", a_xretries); -@@ -629,8 +628,7 @@ static void print_queue(struct ath_softc - seq_printf(file, "%s: %d ", "qnum", txq->axq_qnum); - seq_printf(file, "%s: %2d ", "qdepth", txq->axq_depth); - seq_printf(file, "%s: %2d ", "ampdu-depth", txq->axq_ampdu_depth); -- seq_printf(file, "%s: %3d ", "pending", txq->pending_frames); -- seq_printf(file, "%s: %d\n", "stopped", txq->stopped); -+ seq_printf(file, "%s: %3d\n", "pending", txq->pending_frames); - - ath_txq_unlock(sc, txq); - } -@@ -1208,7 +1206,6 @@ static const char ath9k_gstrings_stats[] - AMKSTR(d_tx_mpdu_xretries), - AMKSTR(d_tx_aggregates), - AMKSTR(d_tx_ampdus_queued_hw), -- AMKSTR(d_tx_ampdus_queued_sw), - AMKSTR(d_tx_ampdus_completed), - AMKSTR(d_tx_ampdu_retries), - AMKSTR(d_tx_ampdu_xretries), -@@ -1288,7 +1285,6 @@ void ath9k_get_et_stats(struct ieee80211 - AWDATA(xretries); - AWDATA(a_aggr); - AWDATA(a_queued_hw); -- AWDATA(a_queued_sw); - AWDATA(a_completed); - AWDATA(a_retries); - AWDATA(a_xretries); -@@ -1346,14 +1342,6 @@ int ath9k_init_debug(struct ath_hw *ah) - read_file_xmit); - debugfs_create_devm_seqfile(sc->dev, "queues", sc->debug.debugfs_phy, - read_file_queues); -- debugfs_create_u32("qlen_bk", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, -- &sc->tx.txq_max_pending[IEEE80211_AC_BK]); -- debugfs_create_u32("qlen_be", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, -- &sc->tx.txq_max_pending[IEEE80211_AC_BE]); -- debugfs_create_u32("qlen_vi", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, -- &sc->tx.txq_max_pending[IEEE80211_AC_VI]); -- debugfs_create_u32("qlen_vo", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, -- &sc->tx.txq_max_pending[IEEE80211_AC_VO]); - debugfs_create_devm_seqfile(sc->dev, "misc", sc->debug.debugfs_phy, - read_file_misc); - debugfs_create_devm_seqfile(sc->dev, "reset", sc->debug.debugfs_phy, ---- a/drivers/net/wireless/ath/ath9k/debug.h -+++ b/drivers/net/wireless/ath/ath9k/debug.h -@@ -147,7 +147,6 @@ struct ath_interrupt_stats { - * @completed: Total MPDUs (non-aggr) completed - * @a_aggr: Total no. of aggregates queued - * @a_queued_hw: Total AMPDUs queued to hardware -- * @a_queued_sw: Total AMPDUs queued to software queues - * @a_completed: Total AMPDUs completed - * @a_retries: No. of AMPDUs retried (SW) - * @a_xretries: No. of AMPDUs dropped due to xretries -@@ -174,7 +173,6 @@ struct ath_tx_stats { - u32 xretries; - u32 a_aggr; - u32 a_queued_hw; -- u32 a_queued_sw; - u32 a_completed; - u32 a_retries; - u32 a_xretries; ---- a/drivers/net/wireless/ath/ath9k/debug_sta.c -+++ b/drivers/net/wireless/ath/ath9k/debug_sta.c -@@ -52,8 +52,8 @@ static ssize_t read_file_node_aggr(struc - "TID", "SEQ_START", "SEQ_NEXT", "BAW_SIZE", - "BAW_HEAD", "BAW_TAIL", "BAR_IDX", "SCHED", "PAUSED"); - -- for (tidno = 0, tid = &an->tid[tidno]; -- tidno < IEEE80211_NUM_TIDS; tidno++, tid++) { -+ for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) { -+ tid = ath_node_to_tid(an, tidno); - txq = tid->txq; - ath_txq_lock(sc, txq); - if (tid->active) { ---- a/drivers/net/wireless/ath/ath9k/init.c -+++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -358,7 +358,6 @@ static int ath9k_init_queues(struct ath_ - for (i = 0; i < IEEE80211_NUM_ACS; i++) { - sc->tx.txq_map[i] = ath_txq_setup(sc, ATH9K_TX_QUEUE_DATA, i); - sc->tx.txq_map[i]->mac80211_qnum = i; -- sc->tx.txq_max_pending[i] = ATH_MAX_QDEPTH; - } - return 0; - } -@@ -877,6 +876,7 @@ static void ath9k_set_hw_capab(struct at - hw->max_rate_tries = 10; - hw->sta_data_size = sizeof(struct ath_node); - hw->vif_data_size = sizeof(struct ath_vif); -+ hw->txq_data_size = sizeof(struct ath_atx_tid); - hw->extra_tx_headroom = 4; - - hw->wiphy->available_antennas_rx = BIT(ah->caps.max_rxchains) - 1; ---- a/drivers/net/wireless/ath/ath9k/main.c -+++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -1902,9 +1902,11 @@ static int ath9k_ampdu_action(struct iee - bool flush = false; - int ret = 0; - struct ieee80211_sta *sta = params->sta; -+ struct ath_node *an = (struct ath_node *)sta->drv_priv; - enum ieee80211_ampdu_mlme_action action = params->action; - u16 tid = params->tid; - u16 *ssn = ¶ms->ssn; -+ struct ath_atx_tid *atid; - - mutex_lock(&sc->mutex); - -@@ -1937,9 +1939,9 @@ static int ath9k_ampdu_action(struct iee - ath9k_ps_restore(sc); - break; - case IEEE80211_AMPDU_TX_OPERATIONAL: -- ath9k_ps_wakeup(sc); -- ath_tx_aggr_resume(sc, sta, tid); -- ath9k_ps_restore(sc); -+ atid = ath_node_to_tid(an, tid); -+ atid->baw_size = IEEE80211_MIN_AMPDU_BUF << -+ sta->ht_cap.ampdu_factor; - break; - default: - ath_err(ath9k_hw_common(sc->sc_ah), "Unknown AMPDU action\n"); -@@ -2701,4 +2703,5 @@ struct ieee80211_ops ath9k_ops = { - .sw_scan_start = ath9k_sw_scan_start, - .sw_scan_complete = ath9k_sw_scan_complete, - .get_txpower = ath9k_get_txpower, -+ .wake_tx_queue = ath9k_wake_tx_queue, - }; ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -67,6 +67,8 @@ static struct ath_buf *ath_tx_setup_buff - struct ath_txq *txq, - struct ath_atx_tid *tid, - struct sk_buff *skb); -+static int ath_tx_prepare(struct ieee80211_hw *hw, struct sk_buff *skb, -+ struct ath_tx_control *txctl); - - enum { - MCS_HT20, -@@ -137,6 +139,26 @@ static void ath_tx_queue_tid(struct ath_ - list_add_tail(&tid->list, list); - } - -+void ath9k_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *queue) -+{ -+ struct ath_softc *sc = hw->priv; -+ struct ath_common *common = ath9k_hw_common(sc->sc_ah); -+ struct ath_atx_tid *tid = (struct ath_atx_tid *) queue->drv_priv; -+ struct ath_txq *txq = tid->txq; -+ -+ ath_dbg(common, QUEUE, "Waking TX queue: %pM (%d)\n", -+ queue->sta ? queue->sta->addr : queue->vif->addr, -+ tid->tidno); -+ -+ ath_txq_lock(sc, txq); -+ -+ tid->has_queued = true; -+ ath_tx_queue_tid(sc, txq, tid); -+ ath_txq_schedule(sc, txq); -+ -+ ath_txq_unlock(sc, txq); -+} -+ - static struct ath_frame_info *get_frame_info(struct sk_buff *skb) - { - struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); -@@ -164,7 +186,6 @@ static void ath_set_rates(struct ieee802 - static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq, - struct sk_buff *skb) - { -- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); - struct ath_frame_info *fi = get_frame_info(skb); - int q = fi->txq; - -@@ -175,14 +196,6 @@ static void ath_txq_skb_done(struct ath_ - if (WARN_ON(--txq->pending_frames < 0)) - txq->pending_frames = 0; - -- if (txq->stopped && -- txq->pending_frames < sc->tx.txq_max_pending[q]) { -- if (ath9k_is_chanctx_enabled()) -- ieee80211_wake_queue(sc->hw, info->hw_queue); -- else -- ieee80211_wake_queue(sc->hw, q); -- txq->stopped = false; -- } - } - - static struct ath_atx_tid * -@@ -192,9 +205,48 @@ ath_get_skb_tid(struct ath_softc *sc, st - return ATH_AN_2_TID(an, tidno); - } - -+static struct sk_buff * -+ath_tid_pull(struct ath_atx_tid *tid) -+{ -+ struct ieee80211_txq *txq = container_of((void*)tid, struct ieee80211_txq, drv_priv); -+ struct ath_softc *sc = tid->an->sc; -+ struct ieee80211_hw *hw = sc->hw; -+ struct ath_tx_control txctl = { -+ .txq = tid->txq, -+ .sta = tid->an->sta, -+ }; -+ struct sk_buff *skb; -+ struct ath_frame_info *fi; -+ int q; -+ -+ if (!tid->has_queued) -+ return NULL; -+ -+ skb = ieee80211_tx_dequeue(hw, txq); -+ if (!skb) { -+ tid->has_queued = false; -+ return NULL; -+ } -+ -+ if (ath_tx_prepare(hw, skb, &txctl)) { -+ ieee80211_free_txskb(hw, skb); -+ return NULL; -+ } -+ -+ q = skb_get_queue_mapping(skb); -+ if (tid->txq == sc->tx.txq_map[q]) { -+ fi = get_frame_info(skb); -+ fi->txq = q; -+ ++tid->txq->pending_frames; -+ } -+ -+ return skb; -+ } -+ -+ - static bool ath_tid_has_buffered(struct ath_atx_tid *tid) - { -- return !skb_queue_empty(&tid->buf_q) || !skb_queue_empty(&tid->retry_q); -+ return !skb_queue_empty(&tid->retry_q) || tid->has_queued; - } - - static struct sk_buff *ath_tid_dequeue(struct ath_atx_tid *tid) -@@ -203,46 +255,11 @@ static struct sk_buff *ath_tid_dequeue(s - - skb = __skb_dequeue(&tid->retry_q); - if (!skb) -- skb = __skb_dequeue(&tid->buf_q); -+ skb = ath_tid_pull(tid); - - return skb; - } - --/* -- * ath_tx_tid_change_state: -- * - clears a-mpdu flag of previous session -- * - force sequence number allocation to fix next BlockAck Window -- */ --static void --ath_tx_tid_change_state(struct ath_softc *sc, struct ath_atx_tid *tid) --{ -- struct ath_txq *txq = tid->txq; -- struct ieee80211_tx_info *tx_info; -- struct sk_buff *skb, *tskb; -- struct ath_buf *bf; -- struct ath_frame_info *fi; -- -- skb_queue_walk_safe(&tid->buf_q, skb, tskb) { -- fi = get_frame_info(skb); -- bf = fi->bf; -- -- tx_info = IEEE80211_SKB_CB(skb); -- tx_info->flags &= ~IEEE80211_TX_CTL_AMPDU; -- -- if (bf) -- continue; -- -- bf = ath_tx_setup_buffer(sc, txq, tid, skb); -- if (!bf) { -- __skb_unlink(skb, &tid->buf_q); -- ath_txq_skb_done(sc, txq, skb); -- ieee80211_free_txskb(sc->hw, skb); -- continue; -- } -- } -- --} -- - static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid) - { - struct ath_txq *txq = tid->txq; -@@ -883,20 +900,16 @@ static int ath_compute_num_delims(struct - - static struct ath_buf * - ath_tx_get_tid_subframe(struct ath_softc *sc, struct ath_txq *txq, -- struct ath_atx_tid *tid, struct sk_buff_head **q) -+ struct ath_atx_tid *tid) - { - struct ieee80211_tx_info *tx_info; - struct ath_frame_info *fi; -- struct sk_buff *skb; -+ struct sk_buff *skb, *first_skb = NULL; - struct ath_buf *bf; - u16 seqno; - - while (1) { -- *q = &tid->retry_q; -- if (skb_queue_empty(*q)) -- *q = &tid->buf_q; -- -- skb = skb_peek(*q); -+ skb = ath_tid_dequeue(tid); - if (!skb) - break; - -@@ -908,7 +921,6 @@ ath_tx_get_tid_subframe(struct ath_softc - bf->bf_state.stale = false; - - if (!bf) { -- __skb_unlink(skb, *q); - ath_txq_skb_done(sc, txq, skb); - ieee80211_free_txskb(sc->hw, skb); - continue; -@@ -937,8 +949,20 @@ ath_tx_get_tid_subframe(struct ath_softc - seqno = bf->bf_state.seqno; - - /* do not step over block-ack window */ -- if (!BAW_WITHIN(tid->seq_start, tid->baw_size, seqno)) -+ if (!BAW_WITHIN(tid->seq_start, tid->baw_size, seqno)) { -+ __skb_queue_tail(&tid->retry_q, skb); -+ -+ /* If there are other skbs in the retry q, they are -+ * probably within the BAW, so loop immediately to get -+ * one of them. Otherwise the queue can get stuck. */ -+ if (!skb_queue_is_first(&tid->retry_q, skb) && -+ !WARN_ON(skb == first_skb)) { -+ if(!first_skb) /* infinite loop prevention */ -+ first_skb = skb; -+ continue; -+ } - break; -+ } - - if (tid->bar_index > ATH_BA_INDEX(tid->seq_start, seqno)) { - struct ath_tx_status ts = {}; -@@ -946,7 +970,6 @@ ath_tx_get_tid_subframe(struct ath_softc - - INIT_LIST_HEAD(&bf_head); - list_add(&bf->list, &bf_head); -- __skb_unlink(skb, *q); - ath_tx_update_baw(sc, tid, seqno); - ath_tx_complete_buf(sc, bf, txq, &bf_head, NULL, &ts, 0); - continue; -@@ -958,11 +981,10 @@ ath_tx_get_tid_subframe(struct ath_softc - return NULL; - } - --static bool -+static int - ath_tx_form_aggr(struct ath_softc *sc, struct ath_txq *txq, - struct ath_atx_tid *tid, struct list_head *bf_q, -- struct ath_buf *bf_first, struct sk_buff_head *tid_q, -- int *aggr_len) -+ struct ath_buf *bf_first) - { - #define PADBYTES(_len) ((4 - ((_len) % 4)) % 4) - struct ath_buf *bf = bf_first, *bf_prev = NULL; -@@ -972,12 +994,13 @@ ath_tx_form_aggr(struct ath_softc *sc, s - struct ieee80211_tx_info *tx_info; - struct ath_frame_info *fi; - struct sk_buff *skb; -- bool closed = false; -+ - - bf = bf_first; - aggr_limit = ath_lookup_rate(sc, bf, tid); - -- do { -+ while (bf) -+ { - skb = bf->bf_mpdu; - fi = get_frame_info(skb); - -@@ -986,12 +1009,12 @@ ath_tx_form_aggr(struct ath_softc *sc, s - if (nframes) { - if (aggr_limit < al + bpad + al_delta || - ath_lookup_legacy(bf) || nframes >= h_baw) -- break; -+ goto stop; - - tx_info = IEEE80211_SKB_CB(bf->bf_mpdu); - if ((tx_info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) || - !(tx_info->flags & IEEE80211_TX_CTL_AMPDU)) -- break; -+ goto stop; - } - - /* add padding for previous frame to aggregation length */ -@@ -1013,20 +1036,18 @@ ath_tx_form_aggr(struct ath_softc *sc, s - ath_tx_addto_baw(sc, tid, bf); - bf->bf_state.ndelim = ndelim; - -- __skb_unlink(skb, tid_q); - list_add_tail(&bf->list, bf_q); - if (bf_prev) - bf_prev->bf_next = bf; - - bf_prev = bf; - -- bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q); -- if (!bf) { -- closed = true; -- break; -- } -- } while (ath_tid_has_buffered(tid)); -- -+ bf = ath_tx_get_tid_subframe(sc, txq, tid); -+ } -+ goto finish; -+stop: -+ __skb_queue_tail(&tid->retry_q, bf->bf_mpdu); -+finish: - bf = bf_first; - bf->bf_lastbf = bf_prev; - -@@ -1037,9 +1058,7 @@ ath_tx_form_aggr(struct ath_softc *sc, s - TX_STAT_INC(txq->axq_qnum, a_aggr); - } - -- *aggr_len = al; -- -- return closed; -+ return al; - #undef PADBYTES - } - -@@ -1416,18 +1435,15 @@ static void ath_tx_fill_desc(struct ath_ - static void - ath_tx_form_burst(struct ath_softc *sc, struct ath_txq *txq, - struct ath_atx_tid *tid, struct list_head *bf_q, -- struct ath_buf *bf_first, struct sk_buff_head *tid_q) -+ struct ath_buf *bf_first) - { - struct ath_buf *bf = bf_first, *bf_prev = NULL; -- struct sk_buff *skb; - int nframes = 0; - - do { - struct ieee80211_tx_info *tx_info; -- skb = bf->bf_mpdu; - - nframes++; -- __skb_unlink(skb, tid_q); - list_add_tail(&bf->list, bf_q); - if (bf_prev) - bf_prev->bf_next = bf; -@@ -1436,13 +1452,15 @@ ath_tx_form_burst(struct ath_softc *sc, - if (nframes >= 2) - break; - -- bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q); -+ bf = ath_tx_get_tid_subframe(sc, txq, tid); - if (!bf) - break; - - tx_info = IEEE80211_SKB_CB(bf->bf_mpdu); -- if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) -+ if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) { -+ __skb_queue_tail(&tid->retry_q, bf->bf_mpdu); - break; -+ } - - ath_set_rates(tid->an->vif, tid->an->sta, bf); - } while (1); -@@ -1453,34 +1471,33 @@ static bool ath_tx_sched_aggr(struct ath - { - struct ath_buf *bf; - struct ieee80211_tx_info *tx_info; -- struct sk_buff_head *tid_q; - struct list_head bf_q; - int aggr_len = 0; -- bool aggr, last = true; -+ bool aggr; - - if (!ath_tid_has_buffered(tid)) - return false; - - INIT_LIST_HEAD(&bf_q); - -- bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q); -+ bf = ath_tx_get_tid_subframe(sc, txq, tid); - if (!bf) - return false; - - tx_info = IEEE80211_SKB_CB(bf->bf_mpdu); - aggr = !!(tx_info->flags & IEEE80211_TX_CTL_AMPDU); - if ((aggr && txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) || -- (!aggr && txq->axq_depth >= ATH_NON_AGGR_MIN_QDEPTH)) { -+ (!aggr && txq->axq_depth >= ATH_NON_AGGR_MIN_QDEPTH)) { -+ __skb_queue_tail(&tid->retry_q, bf->bf_mpdu); - *stop = true; - return false; - } - - ath_set_rates(tid->an->vif, tid->an->sta, bf); - if (aggr) -- last = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf, -- tid_q, &aggr_len); -+ aggr_len = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf); - else -- ath_tx_form_burst(sc, txq, tid, &bf_q, bf, tid_q); -+ ath_tx_form_burst(sc, txq, tid, &bf_q, bf); - - if (list_empty(&bf_q)) - return false; -@@ -1523,9 +1540,6 @@ int ath_tx_aggr_start(struct ath_softc * - an->mpdudensity = density; - } - -- /* force sequence number allocation for pending frames */ -- ath_tx_tid_change_state(sc, txtid); -- - txtid->active = true; - *ssn = txtid->seq_start = txtid->seq_next; - txtid->bar_index = -1; -@@ -1550,7 +1564,6 @@ void ath_tx_aggr_stop(struct ath_softc * - ath_txq_lock(sc, txq); - txtid->active = false; - ath_tx_flush_tid(sc, txtid); -- ath_tx_tid_change_state(sc, txtid); - ath_txq_unlock_complete(sc, txq); - } - -@@ -1560,14 +1573,12 @@ void ath_tx_aggr_sleep(struct ieee80211_ - struct ath_common *common = ath9k_hw_common(sc->sc_ah); - struct ath_atx_tid *tid; - struct ath_txq *txq; -- bool buffered; - int tidno; - - ath_dbg(common, XMIT, "%s called\n", __func__); - -- for (tidno = 0, tid = &an->tid[tidno]; -- tidno < IEEE80211_NUM_TIDS; tidno++, tid++) { -- -+ for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) { -+ tid = ath_node_to_tid(an, tidno); - txq = tid->txq; - - ath_txq_lock(sc, txq); -@@ -1577,13 +1588,12 @@ void ath_tx_aggr_sleep(struct ieee80211_ - continue; - } - -- buffered = ath_tid_has_buffered(tid); -+ if (!skb_queue_empty(&tid->retry_q)) -+ ieee80211_sta_set_buffered(sta, tid->tidno, true); - - list_del_init(&tid->list); - - ath_txq_unlock(sc, txq); -- -- ieee80211_sta_set_buffered(sta, tidno, buffered); - } - } - -@@ -1596,49 +1606,20 @@ void ath_tx_aggr_wakeup(struct ath_softc - - ath_dbg(common, XMIT, "%s called\n", __func__); - -- for (tidno = 0, tid = &an->tid[tidno]; -- tidno < IEEE80211_NUM_TIDS; tidno++, tid++) { -- -+ for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) { -+ tid = ath_node_to_tid(an, tidno); - txq = tid->txq; - - ath_txq_lock(sc, txq); - tid->clear_ps_filter = true; -- - if (ath_tid_has_buffered(tid)) { - ath_tx_queue_tid(sc, txq, tid); - ath_txq_schedule(sc, txq); - } -- - ath_txq_unlock_complete(sc, txq); - } - } - --void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, -- u16 tidno) --{ -- struct ath_common *common = ath9k_hw_common(sc->sc_ah); -- struct ath_atx_tid *tid; -- struct ath_node *an; -- struct ath_txq *txq; -- -- ath_dbg(common, XMIT, "%s called\n", __func__); -- -- an = (struct ath_node *)sta->drv_priv; -- tid = ATH_AN_2_TID(an, tidno); -- txq = tid->txq; -- -- ath_txq_lock(sc, txq); -- -- tid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor; -- -- if (ath_tid_has_buffered(tid)) { -- ath_tx_queue_tid(sc, txq, tid); -- ath_txq_schedule(sc, txq); -- } -- -- ath_txq_unlock_complete(sc, txq); --} -- - void ath9k_release_buffered_frames(struct ieee80211_hw *hw, - struct ieee80211_sta *sta, - u16 tids, int nframes, -@@ -1651,7 +1632,6 @@ void ath9k_release_buffered_frames(struc - struct ieee80211_tx_info *info; - struct list_head bf_q; - struct ath_buf *bf_tail = NULL, *bf; -- struct sk_buff_head *tid_q; - int sent = 0; - int i; - -@@ -1666,11 +1646,10 @@ void ath9k_release_buffered_frames(struc - - ath_txq_lock(sc, tid->txq); - while (nframes > 0) { -- bf = ath_tx_get_tid_subframe(sc, sc->tx.uapsdq, tid, &tid_q); -+ bf = ath_tx_get_tid_subframe(sc, sc->tx.uapsdq, tid); - if (!bf) - break; - -- __skb_unlink(bf->bf_mpdu, tid_q); - list_add_tail(&bf->list, &bf_q); - ath_set_rates(tid->an->vif, tid->an->sta, bf); - if (bf_isampdu(bf)) { -@@ -1685,7 +1664,7 @@ void ath9k_release_buffered_frames(struc - sent++; - TX_STAT_INC(txq->axq_qnum, a_queued_hw); - -- if (an->sta && !ath_tid_has_buffered(tid)) -+ if (an->sta && skb_queue_empty(&tid->retry_q)) - ieee80211_sta_set_buffered(an->sta, i, false); - } - ath_txq_unlock_complete(sc, tid->txq); -@@ -1914,13 +1893,7 @@ bool ath_drain_all_txq(struct ath_softc - if (!ATH_TXQ_SETUP(sc, i)) - continue; - -- /* -- * The caller will resume queues with ieee80211_wake_queues. -- * Mark the queue as not stopped to prevent ath_tx_complete -- * from waking the queue too early. -- */ - txq = &sc->tx.txq[i]; -- txq->stopped = false; - ath_draintxq(sc, txq); - } - -@@ -2319,16 +2292,14 @@ int ath_tx_start(struct ieee80211_hw *hw - struct ath_softc *sc = hw->priv; - struct ath_txq *txq = txctl->txq; - struct ath_atx_tid *tid = NULL; -+ struct ath_node *an = NULL; - struct ath_buf *bf; -- bool queue, skip_uapsd = false, ps_resp; -+ bool ps_resp; - int q, ret; - - if (vif) - avp = (void *)vif->drv_priv; - -- if (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) -- txctl->force_channel = true; -- - ps_resp = !!(info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE); - - ret = ath_tx_prepare(hw, skb, txctl); -@@ -2343,63 +2314,18 @@ int ath_tx_start(struct ieee80211_hw *hw - - q = skb_get_queue_mapping(skb); - -- ath_txq_lock(sc, txq); -- if (txq == sc->tx.txq_map[q]) { -- fi->txq = q; -- if (++txq->pending_frames > sc->tx.txq_max_pending[q] && -- !txq->stopped) { -- if (ath9k_is_chanctx_enabled()) -- ieee80211_stop_queue(sc->hw, info->hw_queue); -- else -- ieee80211_stop_queue(sc->hw, q); -- txq->stopped = true; -- } -- } -- -- queue = ieee80211_is_data_present(hdr->frame_control); -- -- /* If chanctx, queue all null frames while NOA could be there */ -- if (ath9k_is_chanctx_enabled() && -- ieee80211_is_nullfunc(hdr->frame_control) && -- !txctl->force_channel) -- queue = true; -- -- /* Force queueing of all frames that belong to a virtual interface on -- * a different channel context, to ensure that they are sent on the -- * correct channel. -- */ -- if (((avp && avp->chanctx != sc->cur_chan) || -- sc->cur_chan->stopped) && !txctl->force_channel) { -- if (!txctl->an) -- txctl->an = &avp->mcast_node; -- queue = true; -- skip_uapsd = true; -- } -- -- if (txctl->an && queue) -- tid = ath_get_skb_tid(sc, txctl->an, skb); -- -- if (!skip_uapsd && ps_resp) { -- ath_txq_unlock(sc, txq); -+ if (ps_resp) - txq = sc->tx.uapsdq; -- ath_txq_lock(sc, txq); -- } else if (txctl->an && queue) { -- WARN_ON(tid->txq != txctl->txq); -- -- if (info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT) -- tid->clear_ps_filter = true; - -- /* -- * Add this frame to software queue for scheduling later -- * for aggregation. -- */ -- TX_STAT_INC(txq->axq_qnum, a_queued_sw); -- __skb_queue_tail(&tid->buf_q, skb); -- if (!txctl->an->sleeping) -- ath_tx_queue_tid(sc, txq, tid); -+ if (txctl->sta) { -+ an = (struct ath_node *) sta->drv_priv; -+ tid = ath_get_skb_tid(sc, an, skb); -+ } - -- ath_txq_schedule(sc, txq); -- goto out; -+ ath_txq_lock(sc, txq); -+ if (txq == sc->tx.txq_map[q]) { -+ fi->txq = q; -+ ++txq->pending_frames; - } - - bf = ath_tx_setup_buffer(sc, txq, tid, skb); -@@ -2892,9 +2818,8 @@ void ath_tx_node_init(struct ath_softc * - struct ath_atx_tid *tid; - int tidno, acno; - -- for (tidno = 0, tid = &an->tid[tidno]; -- tidno < IEEE80211_NUM_TIDS; -- tidno++, tid++) { -+ for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) { -+ tid = ath_node_to_tid(an, tidno); - tid->an = an; - tid->tidno = tidno; - tid->seq_start = tid->seq_next = 0; -@@ -2902,11 +2827,14 @@ void ath_tx_node_init(struct ath_softc * - tid->baw_head = tid->baw_tail = 0; - tid->active = false; - tid->clear_ps_filter = true; -- __skb_queue_head_init(&tid->buf_q); -+ tid->has_queued = false; - __skb_queue_head_init(&tid->retry_q); - INIT_LIST_HEAD(&tid->list); - acno = TID_TO_WME_AC(tidno); - tid->txq = sc->tx.txq_map[acno]; -+ -+ if (!an->sta) -+ break; /* just one multicast ath_atx_tid */ - } - } - -@@ -2916,9 +2844,8 @@ void ath_tx_node_cleanup(struct ath_soft - struct ath_txq *txq; - int tidno; - -- for (tidno = 0, tid = &an->tid[tidno]; -- tidno < IEEE80211_NUM_TIDS; tidno++, tid++) { -- -+ for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) { -+ tid = ath_node_to_tid(an, tidno); - txq = tid->txq; - - ath_txq_lock(sc, txq); -@@ -2930,6 +2857,9 @@ void ath_tx_node_cleanup(struct ath_soft - tid->active = false; - - ath_txq_unlock(sc, txq); -+ -+ if (!an->sta) -+ break; /* just one multicast ath_atx_tid */ - } - } - diff --git a/package/kernel/mac80211/patches/314-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch b/package/kernel/mac80211/patches/300-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch similarity index 100% rename from package/kernel/mac80211/patches/314-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch rename to package/kernel/mac80211/patches/300-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch diff --git a/package/kernel/mac80211/patches/315-ath9k_hw-issue-external-reset-for-QCA955x.patch b/package/kernel/mac80211/patches/301-ath9k_hw-issue-external-reset-for-QCA955x.patch similarity index 99% rename from package/kernel/mac80211/patches/315-ath9k_hw-issue-external-reset-for-QCA955x.patch rename to package/kernel/mac80211/patches/301-ath9k_hw-issue-external-reset-for-QCA955x.patch index 34d7d3b1cf..5eb69b898d 100644 --- a/package/kernel/mac80211/patches/315-ath9k_hw-issue-external-reset-for-QCA955x.patch +++ b/package/kernel/mac80211/patches/301-ath9k_hw-issue-external-reset-for-QCA955x.patch @@ -29,6 +29,21 @@ Signed-off-by: Felix Fietkau - npend = ath9k_hw_numtxpending(ah, i); - if (npend) - break; +- } +- +- if (ah->external_reset && +- (npend || type == ATH9K_RESET_COLD)) { +- int reset_err = 0; +- +- ath_dbg(ath9k_hw_common(ah), RESET, +- "reset MAC via external reset\n"); +- +- reset_err = ah->external_reset(); +- if (reset_err) { +- ath_err(ath9k_hw_common(ah), +- "External reset failed, err=%d\n", +- reset_err); +- return false; + if (type == ATH9K_RESET_COLD) + return true; + @@ -44,47 +59,35 @@ Signed-off-by: Felix Fietkau + for (i = 0; i < AR_NUM_QCU; i++) { + if (ath9k_hw_numtxpending(ah, i)) + return true; -+ } - } - -- if (ah->external_reset && -- (npend || type == ATH9K_RESET_COLD)) { -- int reset_err = 0; + } ++ } ++ + return false; +} - -- ath_dbg(ath9k_hw_common(ah), RESET, -- "reset MAC via external reset\n"); ++ +static bool ath9k_hw_external_reset(struct ath_hw *ah, int type) +{ + int err; - -- reset_err = ah->external_reset(); -- if (reset_err) { -- ath_err(ath9k_hw_common(ah), -- "External reset failed, err=%d\n", -- reset_err); -- return false; -- } ++ + if (!ah->external_reset || !ath9k_hw_need_external_reset(ah, type)) + return true; - -- REG_WRITE(ah, AR_RTC_RESET, 1); ++ + ath_dbg(ath9k_hw_common(ah), RESET, + "reset MAC via external reset\n"); -+ + +- REG_WRITE(ah, AR_RTC_RESET, 1); + err = ah->external_reset(); + if (err) { + ath_err(ath9k_hw_common(ah), + "External reset failed, err=%d\n", err); + return false; -+ } -+ + } + + if (AR_SREV_9550(ah)) { + REG_WRITE(ah, AR_RTC_RESET, 0); + udelay(10); - } - ++ } ++ + REG_WRITE(ah, AR_RTC_RESET, 1); + udelay(10); + diff --git a/package/kernel/mac80211/patches/316-ath9k_hw-set-spectral-scan-enable-bit-on-trigger-for.patch b/package/kernel/mac80211/patches/302-ath9k_hw-set-spectral-scan-enable-bit-on-trigger-for.patch similarity index 100% rename from package/kernel/mac80211/patches/316-ath9k_hw-set-spectral-scan-enable-bit-on-trigger-for.patch rename to package/kernel/mac80211/patches/302-ath9k_hw-set-spectral-scan-enable-bit-on-trigger-for.patch diff --git a/package/kernel/mac80211/patches/347-ath9k-don-t-run-periodic-and-nf-calibation-at-the-sa.patch b/package/kernel/mac80211/patches/303-ath9k-don-t-run-periodic-and-nf-calibation-at-the-sa.patch similarity index 98% rename from package/kernel/mac80211/patches/347-ath9k-don-t-run-periodic-and-nf-calibation-at-the-sa.patch rename to package/kernel/mac80211/patches/303-ath9k-don-t-run-periodic-and-nf-calibation-at-the-sa.patch index 529e1098b3..22f5154146 100644 --- a/package/kernel/mac80211/patches/347-ath9k-don-t-run-periodic-and-nf-calibation-at-the-sa.patch +++ b/package/kernel/mac80211/patches/303-ath9k-don-t-run-periodic-and-nf-calibation-at-the-sa.patch @@ -1,6 +1,7 @@ From: Felix Fietkau Date: Tue, 27 Dec 2016 23:16:23 +0100 -Subject: [PATCH] ath9k: don't run periodic and nf calibation at the same time +Subject: [PATCH] ath9k: don't run periodic and nf calibation at the same + time The checks already prevents periodic cal from being started while noise floor calibration runs. It is missing checks for the other way around. diff --git a/package/kernel/mac80211/patches/301-ath9k-force-rx_clear-when-disabling-rx.patch b/package/kernel/mac80211/patches/304-ath9k-force-rx_clear-when-disabling-rx.patch similarity index 96% rename from package/kernel/mac80211/patches/301-ath9k-force-rx_clear-when-disabling-rx.patch rename to package/kernel/mac80211/patches/304-ath9k-force-rx_clear-when-disabling-rx.patch index 098bda7e93..eb6862db6d 100644 --- a/package/kernel/mac80211/patches/301-ath9k-force-rx_clear-when-disabling-rx.patch +++ b/package/kernel/mac80211/patches/304-ath9k-force-rx_clear-when-disabling-rx.patch @@ -27,7 +27,7 @@ Signed-off-by: Helmut Schaa - REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_ABORT | AR_DIAG_RX_DIS); + u32 reg = AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT; + -+ if (!config_enabled(CPTCFG_ATH9K_TX99)) ++ if (!IS_ENABLED(CPTCFG_ATH9K_TX99)) + reg |= AR_DIAG_FORCE_RX_CLEAR; + REG_SET_BIT(ah, AR_DIAG_SW, reg); diff --git a/package/kernel/mac80211/patches/302-ath9k-limit-retries-for-powersave-response-frames.patch b/package/kernel/mac80211/patches/305-ath9k-limit-retries-for-powersave-response-frames.patch similarity index 84% rename from package/kernel/mac80211/patches/302-ath9k-limit-retries-for-powersave-response-frames.patch rename to package/kernel/mac80211/patches/305-ath9k-limit-retries-for-powersave-response-frames.patch index 8c19ea22f4..5923594be3 100644 --- a/package/kernel/mac80211/patches/302-ath9k-limit-retries-for-powersave-response-frames.patch +++ b/package/kernel/mac80211/patches/305-ath9k-limit-retries-for-powersave-response-frames.patch @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -177,10 +177,25 @@ static void ath_send_bar(struct ath_atx_ +@@ -188,10 +188,25 @@ static void ath_send_bar(struct ath_atx_ } static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta, @@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau } static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq, -@@ -1462,7 +1477,7 @@ ath_tx_form_burst(struct ath_softc *sc, +@@ -1522,7 +1537,7 @@ ath_tx_form_burst(struct ath_softc *sc, break; } @@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau } while (1); } -@@ -1493,7 +1508,7 @@ static bool ath_tx_sched_aggr(struct ath +@@ -1552,7 +1567,7 @@ static bool ath_tx_sched_aggr(struct ath return false; } @@ -58,7 +58,7 @@ Signed-off-by: Felix Fietkau if (aggr) aggr_len = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf); else -@@ -1651,7 +1666,7 @@ void ath9k_release_buffered_frames(struc +@@ -1710,7 +1725,7 @@ void ath9k_release_buffered_frames(struc break; list_add_tail(&bf->list, &bf_q); @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau if (bf_isampdu(bf)) { ath_tx_addto_baw(sc, tid, bf); bf->bf_state.bf_type &= ~BUF_AGGR; -@@ -2343,7 +2358,7 @@ int ath_tx_start(struct ieee80211_hw *hw +@@ -2410,7 +2425,7 @@ int ath_tx_start(struct ieee80211_hw *hw if (txctl->paprd) bf->bf_state.bfs_paprd_timestamp = jiffies; @@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau ath_tx_send_normal(sc, txq, tid, skb); out: -@@ -2382,7 +2397,7 @@ void ath_tx_cabq(struct ieee80211_hw *hw +@@ -2449,7 +2464,7 @@ void ath_tx_cabq(struct ieee80211_hw *hw break; bf->bf_lastbf = bf; @@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau ath_buf_set_rate(sc, bf, &info, fi->framelen, false); duration += info.rates[0].PktDuration; if (bf_tail) -@@ -2898,7 +2913,7 @@ int ath9k_tx99_send(struct ath_softc *sc +@@ -2968,7 +2983,7 @@ int ath9k_tx99_send(struct ath_softc *sc return -EINVAL; } diff --git a/package/kernel/mac80211/patches/303-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch b/package/kernel/mac80211/patches/306-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch similarity index 89% rename from package/kernel/mac80211/patches/303-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch rename to package/kernel/mac80211/patches/306-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch index 57f45c1c93..956ab83903 100644 --- a/package/kernel/mac80211/patches/303-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch +++ b/package/kernel/mac80211/patches/306-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch @@ -8,7 +8,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411. --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -2910,7 +2910,8 @@ void ath9k_hw_apply_txpower(struct ath_h +@@ -2931,7 +2931,8 @@ void ath9k_hw_apply_txpower(struct ath_h { struct ath_regulatory *reg = ath9k_hw_regulatory(ah); struct ieee80211_channel *channel; @@ -18,7 +18,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411. if (!chan) return; -@@ -2918,10 +2919,15 @@ void ath9k_hw_apply_txpower(struct ath_h +@@ -2939,10 +2940,15 @@ void ath9k_hw_apply_txpower(struct ath_h channel = chan->chan; chan_pwr = min_t(int, channel->max_power * 2, MAX_RATE_POWER); new_pwr = min_t(int, chan_pwr, reg->power_limit); diff --git a/package/kernel/mac80211/patches/304-mac80211-add-hdrlen-to-ieee80211_tx_data.patch b/package/kernel/mac80211/patches/307-mac80211-add-hdrlen-to-ieee80211_tx_data.patch similarity index 91% rename from package/kernel/mac80211/patches/304-mac80211-add-hdrlen-to-ieee80211_tx_data.patch rename to package/kernel/mac80211/patches/307-mac80211-add-hdrlen-to-ieee80211_tx_data.patch index 72e81ee1b0..1a6fd8471c 100644 --- a/package/kernel/mac80211/patches/304-mac80211-add-hdrlen-to-ieee80211_tx_data.patch +++ b/package/kernel/mac80211/patches/307-mac80211-add-hdrlen-to-ieee80211_tx_data.patch @@ -11,7 +11,7 @@ Signed-off-by: Janusz Dziedzic --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -175,6 +175,7 @@ struct ieee80211_tx_data { +@@ -177,6 +177,7 @@ struct ieee80211_tx_data { struct ieee80211_tx_rate rate; unsigned int flags; @@ -21,7 +21,7 @@ Signed-off-by: Janusz Dziedzic --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -955,7 +955,7 @@ ieee80211_tx_h_fragment(struct ieee80211 +@@ -925,7 +925,7 @@ ieee80211_tx_h_fragment(struct ieee80211 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_hdr *hdr = (void *)skb->data; int frag_threshold = tx->local->hw.wiphy->frag_threshold; @@ -30,7 +30,7 @@ Signed-off-by: Janusz Dziedzic int fragnum; /* no matter what happens, tx->skb moves to tx->skbs */ -@@ -976,8 +976,6 @@ ieee80211_tx_h_fragment(struct ieee80211 +@@ -946,8 +946,6 @@ ieee80211_tx_h_fragment(struct ieee80211 if (WARN_ON(info->flags & IEEE80211_TX_CTL_AMPDU)) return TX_DROP; @@ -39,7 +39,7 @@ Signed-off-by: Janusz Dziedzic /* internal error, why isn't DONTFRAG set? */ if (WARN_ON(skb->len + FCS_LEN <= frag_threshold)) return TX_DROP; -@@ -1209,6 +1207,8 @@ ieee80211_tx_prepare(struct ieee80211_su +@@ -1179,6 +1177,8 @@ ieee80211_tx_prepare(struct ieee80211_su hdr = (struct ieee80211_hdr *) skb->data; @@ -48,7 +48,7 @@ Signed-off-by: Janusz Dziedzic if (likely(sta)) { if (!IS_ERR(sta)) tx->sta = sta; -@@ -3414,6 +3414,7 @@ begin: +@@ -3437,6 +3437,7 @@ begin: tx.local = local; tx.skb = skb; tx.sdata = vif_to_sdata(info->control.vif); @@ -56,7 +56,7 @@ Signed-off-by: Janusz Dziedzic if (txq->sta) tx.sta = container_of(txq->sta, struct sta_info, sta); -@@ -3584,6 +3585,7 @@ ieee80211_build_data_template(struct iee +@@ -3731,6 +3732,7 @@ ieee80211_build_data_template(struct iee hdr = (void *)skb->data; tx.sta = sta_info_get(sdata, hdr->addr1); tx.skb = skb; @@ -126,7 +126,7 @@ Signed-off-by: Janusz Dziedzic if (!iv) return -1; -@@ -306,13 +306,14 @@ static int wep_encrypt_skb(struct ieee80 +@@ -307,13 +307,14 @@ static int wep_encrypt_skb(struct ieee80 struct ieee80211_key_conf *hw_key = info->control.hw_key; if (!hw_key) { @@ -181,7 +181,7 @@ Signed-off-by: Janusz Dziedzic len = skb->len - hdrlen; if (info->control.hw_key) -@@ -418,7 +417,7 @@ static int ccmp_encrypt_skb(struct ieee8 +@@ -419,7 +418,7 @@ static int ccmp_encrypt_skb(struct ieee8 return 0; } @@ -190,7 +190,7 @@ Signed-off-by: Janusz Dziedzic len = skb->len - hdrlen; if (info->control.hw_key) -@@ -651,7 +650,7 @@ static int gcmp_encrypt_skb(struct ieee8 +@@ -652,7 +651,7 @@ static int gcmp_encrypt_skb(struct ieee8 return 0; } @@ -199,7 +199,7 @@ Signed-off-by: Janusz Dziedzic len = skb->len - hdrlen; if (info->control.hw_key) -@@ -791,7 +790,6 @@ static ieee80211_tx_result +@@ -792,7 +791,6 @@ static ieee80211_tx_result ieee80211_crypto_cs_encrypt(struct ieee80211_tx_data *tx, struct sk_buff *skb) { @@ -207,7 +207,7 @@ Signed-off-by: Janusz Dziedzic struct ieee80211_key *key = tx->key; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); int hdrlen; -@@ -807,8 +805,7 @@ ieee80211_crypto_cs_encrypt(struct ieee8 +@@ -808,8 +806,7 @@ ieee80211_crypto_cs_encrypt(struct ieee8 pskb_expand_head(skb, iv_len, 0, GFP_ATOMIC))) return TX_DROP; diff --git a/package/kernel/mac80211/patches/305-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch b/package/kernel/mac80211/patches/308-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch similarity index 87% rename from package/kernel/mac80211/patches/305-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch rename to package/kernel/mac80211/patches/308-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch index 704e7f7815..43455773f1 100644 --- a/package/kernel/mac80211/patches/305-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch +++ b/package/kernel/mac80211/patches/308-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch @@ -23,9 +23,9 @@ Signed-off-by: Janusz Dziedzic --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -2025,6 +2025,9 @@ struct ieee80211_txq { - * drivers, mac80211 packet loss mechanism will not be triggered and driver - * is completely depending on firmware event for station kickout. +@@ -2043,6 +2043,9 @@ struct ieee80211_txq { + * The stack will not do fragmentation. + * The callback for @set_frag_threshold should be set as well. * + * @IEEE80211_HW_NEEDS_ALIGNED4_SKBS: Driver need aligned skbs to four-byte. + * Padding will be added after ieee80211_hdr, before IV/LLC. @@ -33,28 +33,28 @@ Signed-off-by: Janusz Dziedzic * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays */ enum ieee80211_hw_flags { -@@ -2066,6 +2069,7 @@ enum ieee80211_hw_flags { - IEEE80211_HW_TX_AMSDU, +@@ -2085,6 +2088,7 @@ enum ieee80211_hw_flags { IEEE80211_HW_TX_FRAG_LIST, IEEE80211_HW_REPORTS_LOW_ACK, + IEEE80211_HW_SUPPORTS_TX_FRAG, + IEEE80211_HW_NEEDS_ALIGNED4_SKBS, /* keep last, obviously */ NUM_IEEE80211_HW_FLAGS --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c -@@ -210,6 +210,7 @@ static const char *hw_flag_names[] = { - FLAG(TX_AMSDU), +@@ -211,6 +211,7 @@ static const char *hw_flag_names[] = { FLAG(TX_FRAG_LIST), FLAG(REPORTS_LOW_ACK), + FLAG(SUPPORTS_TX_FRAG), + FLAG(NEEDS_ALIGNED4_SKBS), #undef FLAG }; --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1529,6 +1529,29 @@ ieee80211_have_rx_timestamp(struct ieee8 - return false; +@@ -1553,6 +1553,29 @@ ieee80211_vif_get_num_mcast_if(struct ie + return -1; } +static inline unsigned int @@ -96,7 +96,7 @@ Signed-off-by: Janusz Dziedzic struct rcu_head rcu_head; --- a/net/mac80211/status.c +++ b/net/mac80211/status.c -@@ -689,9 +689,22 @@ void ieee80211_tx_monitor(struct ieee802 +@@ -693,9 +693,22 @@ void ieee80211_tx_monitor(struct ieee802 struct sk_buff *skb2; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_sub_if_data *sdata; @@ -137,7 +137,7 @@ Signed-off-by: Janusz Dziedzic --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -1206,8 +1206,7 @@ ieee80211_tx_prepare(struct ieee80211_su +@@ -1176,8 +1176,7 @@ ieee80211_tx_prepare(struct ieee80211_su info->flags &= ~IEEE80211_TX_INTFL_NEED_TXPROCESSING; hdr = (struct ieee80211_hdr *) skb->data; @@ -147,7 +147,7 @@ Signed-off-by: Janusz Dziedzic if (likely(sta)) { if (!IS_ERR(sta)) -@@ -2158,7 +2157,7 @@ netdev_tx_t ieee80211_monitor_start_xmit +@@ -2152,7 +2151,7 @@ netdev_tx_t ieee80211_monitor_start_xmit goto fail; hdr = (struct ieee80211_hdr *)(skb->data + len_rthdr); @@ -156,7 +156,7 @@ Signed-off-by: Janusz Dziedzic if (skb->len < len_rthdr + hdrlen) goto fail; -@@ -2376,7 +2375,7 @@ static struct sk_buff *ieee80211_build_h +@@ -2370,7 +2369,7 @@ static struct sk_buff *ieee80211_build_h struct ieee80211_chanctx_conf *chanctx_conf; struct ieee80211_sub_if_data *ap_sdata; enum nl80211_band band; @@ -165,7 +165,7 @@ Signed-off-by: Janusz Dziedzic if (IS_ERR(sta)) sta = NULL; -@@ -2596,6 +2595,9 @@ static struct sk_buff *ieee80211_build_h +@@ -2590,6 +2589,9 @@ static struct sk_buff *ieee80211_build_h hdrlen += 2; } @@ -175,7 +175,7 @@ Signed-off-by: Janusz Dziedzic /* * Drop unicast frames to unauthorised stations unless they are * EAPOL frames from the local station. -@@ -2676,6 +2678,7 @@ static struct sk_buff *ieee80211_build_h +@@ -2670,6 +2672,7 @@ static struct sk_buff *ieee80211_build_h skb_pull(skb, skip_header_bytes); head_need = hdrlen + encaps_len + meshhdrlen - skb_headroom(skb); @@ -183,7 +183,7 @@ Signed-off-by: Janusz Dziedzic /* * So we need to modify the skb header and hence need a copy of -@@ -2708,6 +2711,9 @@ static struct sk_buff *ieee80211_build_h +@@ -2702,6 +2705,9 @@ static struct sk_buff *ieee80211_build_h memcpy(skb_push(skb, meshhdrlen), &mesh_hdr, meshhdrlen); #endif @@ -193,7 +193,7 @@ Signed-off-by: Janusz Dziedzic if (ieee80211_is_data_qos(fc)) { __le16 *qos_control; -@@ -2883,6 +2889,9 @@ void ieee80211_check_fast_xmit(struct st +@@ -2877,6 +2883,9 @@ void ieee80211_check_fast_xmit(struct st fc |= cpu_to_le16(IEEE80211_STYPE_QOS_DATA); } @@ -203,7 +203,7 @@ Signed-off-by: Janusz Dziedzic /* We store the key here so there's no point in using rcu_dereference() * but that's fine because the code that changes the pointers will call * this function after doing so. For a single CPU that would be enough, -@@ -3436,7 +3445,7 @@ begin: +@@ -3464,7 +3473,7 @@ begin: if (tx.key && (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) diff --git a/package/kernel/mac80211/patches/306-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch b/package/kernel/mac80211/patches/309-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch similarity index 86% rename from package/kernel/mac80211/patches/306-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch rename to package/kernel/mac80211/patches/309-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch index 6e7ecb9c4d..a62b1bb28e 100644 --- a/package/kernel/mac80211/patches/306-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch +++ b/package/kernel/mac80211/patches/309-mac80211-minstrel-Enable-STBC-and-LDPC-for-VHT-Rates.patch @@ -10,7 +10,7 @@ Signed-off-by: Chaitanya TK --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h -@@ -1551,6 +1551,7 @@ struct ieee80211_vht_operation { +@@ -1553,6 +1553,7 @@ struct ieee80211_vht_operation { #define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300 #define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400 #define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700 @@ -20,15 +20,16 @@ Signed-off-by: Chaitanya TK #define IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT 13 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c -@@ -1166,13 +1166,14 @@ minstrel_ht_update_caps(void *priv, stru +@@ -1130,7 +1130,7 @@ minstrel_ht_update_caps(void *priv, stru struct minstrel_ht_sta_priv *msp = priv_sta; struct minstrel_ht_sta *mi = &msp->ht; struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs; - u16 sta_cap = sta->ht_cap.cap; + u16 ht_cap = sta->ht_cap.cap; struct ieee80211_sta_vht_cap *vht_cap = &sta->vht_cap; + struct sta_info *sinfo = container_of(sta, struct sta_info, sta); int use_vht; - int n_supported = 0; +@@ -1138,6 +1138,7 @@ minstrel_ht_update_caps(void *priv, stru int ack_dur; int stbc; int i; @@ -36,7 +37,7 @@ Signed-off-by: Chaitanya TK /* fall back to the old minstrel for legacy stations */ if (!sta->ht_cap.ht_supported) -@@ -1210,16 +1211,24 @@ minstrel_ht_update_caps(void *priv, stru +@@ -1175,16 +1176,24 @@ minstrel_ht_update_caps(void *priv, stru } mi->sample_tries = 4; @@ -66,7 +67,7 @@ Signed-off-by: Chaitanya TK for (i = 0; i < ARRAY_SIZE(mi->groups); i++) { u32 gflags = minstrel_mcs_groups[i].flags; int bw, nss; -@@ -1232,10 +1241,10 @@ minstrel_ht_update_caps(void *priv, stru +@@ -1197,10 +1206,10 @@ minstrel_ht_update_caps(void *priv, stru if (gflags & IEEE80211_TX_RC_SHORT_GI) { if (gflags & IEEE80211_TX_RC_40_MHZ_WIDTH) { diff --git a/package/kernel/mac80211/patches/307-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch b/package/kernel/mac80211/patches/310-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch similarity index 86% rename from package/kernel/mac80211/patches/307-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch rename to package/kernel/mac80211/patches/310-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch index 4fc6dc1ec3..b2a74ccbac 100644 --- a/package/kernel/mac80211/patches/307-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch +++ b/package/kernel/mac80211/patches/310-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch @@ -7,7 +7,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -1635,6 +1635,22 @@ void ath_tx_aggr_wakeup(struct ath_softc +@@ -1694,6 +1694,22 @@ void ath_tx_aggr_wakeup(struct ath_softc } } @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau void ath9k_release_buffered_frames(struct ieee80211_hw *hw, struct ieee80211_sta *sta, u16 tids, int nframes, -@@ -1665,6 +1681,7 @@ void ath9k_release_buffered_frames(struc +@@ -1724,6 +1740,7 @@ void ath9k_release_buffered_frames(struc if (!bf) break; @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau list_add_tail(&bf->list, &bf_q); ath_set_rates(tid->an->vif, tid->an->sta, bf, true); if (bf_isampdu(bf)) { -@@ -1688,6 +1705,9 @@ void ath9k_release_buffered_frames(struc +@@ -1747,6 +1764,9 @@ void ath9k_release_buffered_frames(struc if (list_empty(&bf_q)) return; diff --git a/package/kernel/mac80211/patches/308-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch b/package/kernel/mac80211/patches/311-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch similarity index 90% rename from package/kernel/mac80211/patches/308-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch rename to package/kernel/mac80211/patches/311-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch index 929da25d75..9863dffc90 100644 --- a/package/kernel/mac80211/patches/308-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch +++ b/package/kernel/mac80211/patches/311-ath9k-clear-potentially-stale-EOSP-status-bit-in-int.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -945,7 +945,8 @@ ath_tx_get_tid_subframe(struct ath_softc +@@ -1004,7 +1004,8 @@ ath_tx_get_tid_subframe(struct ath_softc bf->bf_lastbf = bf; tx_info = IEEE80211_SKB_CB(skb); diff --git a/package/kernel/mac80211/patches/309-ath9k-report-tx-status-on-EOSP.patch b/package/kernel/mac80211/patches/312-ath9k-report-tx-status-on-EOSP.patch similarity index 100% rename from package/kernel/mac80211/patches/309-ath9k-report-tx-status-on-EOSP.patch rename to package/kernel/mac80211/patches/312-ath9k-report-tx-status-on-EOSP.patch diff --git a/package/kernel/mac80211/patches/312-mac80211-Use-rhltable-instead-of-rhashtable.patch b/package/kernel/mac80211/patches/312-mac80211-Use-rhltable-instead-of-rhashtable.patch deleted file mode 100644 index 4c5fff1274..0000000000 --- a/package/kernel/mac80211/patches/312-mac80211-Use-rhltable-instead-of-rhashtable.patch +++ /dev/null @@ -1,275 +0,0 @@ -From: Herbert Xu -Date: Mon, 19 Sep 2016 19:00:10 +0800 -Subject: [PATCH] mac80211: Use rhltable instead of rhashtable - -mac80211 currently uses rhashtable with insecure_elasticity set -to true. The latter is because of duplicate objects. What's -more, mac80211 walks the rhashtable chains by hand which is broken -as rhashtable may contain multiple tables due to resizing or -rehashing. - -This patch fixes it by converting it to the newly added rhltable -interface which is designed for use with duplicate objects. - -With rhltable a lookup returns a list of objects instead of a -single one. This is then fed into the existing for_each_sta_info -macro. - -This patch also deletes the sta_addr_hash function since rhashtable -defaults to jhash. - -Signed-off-by: Herbert Xu ---- - ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -1233,7 +1233,7 @@ struct ieee80211_local { - spinlock_t tim_lock; - unsigned long num_sta; - struct list_head sta_list; -- struct rhashtable sta_hash; -+ struct rhltable sta_hash; - struct timer_list sta_cleanup; - int sta_generation; - ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -4004,7 +4004,7 @@ static void __ieee80211_rx_handle_packet - __le16 fc; - struct ieee80211_rx_data rx; - struct ieee80211_sub_if_data *prev; -- struct rhash_head *tmp; -+ struct rhlist_head *tmp; - int err = 0; - - fc = ((struct ieee80211_hdr *)skb->data)->frame_control; -@@ -4047,13 +4047,10 @@ static void __ieee80211_rx_handle_packet - goto out; - } else if (ieee80211_is_data(fc)) { - struct sta_info *sta, *prev_sta; -- const struct bucket_table *tbl; - - prev_sta = NULL; - -- tbl = rht_dereference_rcu(local->sta_hash.tbl, &local->sta_hash); -- -- for_each_sta_info(local, tbl, hdr->addr2, sta, tmp) { -+ for_each_sta_info(local, hdr->addr2, sta, tmp) { - if (!prev_sta) { - prev_sta = sta; - continue; ---- a/net/mac80211/sta_info.c -+++ b/net/mac80211/sta_info.c -@@ -67,12 +67,10 @@ - - static const struct rhashtable_params sta_rht_params = { - .nelem_hint = 3, /* start small */ -- .insecure_elasticity = true, /* Disable chain-length checks. */ - .automatic_shrinking = true, - .head_offset = offsetof(struct sta_info, hash_node), - .key_offset = offsetof(struct sta_info, addr), - .key_len = ETH_ALEN, -- .hashfn = sta_addr_hash, - .max_size = CPTCFG_MAC80211_STA_HASH_MAX_SIZE, - }; - -@@ -80,8 +78,8 @@ static const struct rhashtable_params st - static int sta_info_hash_del(struct ieee80211_local *local, - struct sta_info *sta) - { -- return rhashtable_remove_fast(&local->sta_hash, &sta->hash_node, -- sta_rht_params); -+ return rhltable_remove(&local->sta_hash, &sta->hash_node, -+ sta_rht_params); - } - - static void __cleanup_single_sta(struct sta_info *sta) -@@ -157,19 +155,22 @@ static void cleanup_single_sta(struct st - sta_info_free(local, sta); - } - -+struct rhlist_head *sta_info_hash_lookup(struct ieee80211_local *local, -+ const u8 *addr) -+{ -+ return rhltable_lookup(&local->sta_hash, addr, sta_rht_params); -+} -+ - /* protected by RCU */ - struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata, - const u8 *addr) - { - struct ieee80211_local *local = sdata->local; -+ struct rhlist_head *tmp; - struct sta_info *sta; -- struct rhash_head *tmp; -- const struct bucket_table *tbl; - - rcu_read_lock(); -- tbl = rht_dereference_rcu(local->sta_hash.tbl, &local->sta_hash); -- -- for_each_sta_info(local, tbl, addr, sta, tmp) { -+ for_each_sta_info(local, addr, sta, tmp) { - if (sta->sdata == sdata) { - rcu_read_unlock(); - /* this is safe as the caller must already hold -@@ -190,14 +191,11 @@ struct sta_info *sta_info_get_bss(struct - const u8 *addr) - { - struct ieee80211_local *local = sdata->local; -+ struct rhlist_head *tmp; - struct sta_info *sta; -- struct rhash_head *tmp; -- const struct bucket_table *tbl; - - rcu_read_lock(); -- tbl = rht_dereference_rcu(local->sta_hash.tbl, &local->sta_hash); -- -- for_each_sta_info(local, tbl, addr, sta, tmp) { -+ for_each_sta_info(local, addr, sta, tmp) { - if (sta->sdata == sdata || - (sta->sdata->bss && sta->sdata->bss == sdata->bss)) { - rcu_read_unlock(); -@@ -263,8 +261,8 @@ void sta_info_free(struct ieee80211_loca - static int sta_info_hash_add(struct ieee80211_local *local, - struct sta_info *sta) - { -- return rhashtable_insert_fast(&local->sta_hash, &sta->hash_node, -- sta_rht_params); -+ return rhltable_insert(&local->sta_hash, &sta->hash_node, -+ sta_rht_params); - } - - static void sta_deliver_ps_frames(struct work_struct *wk) -@@ -453,9 +451,9 @@ static int sta_info_insert_check(struct - is_multicast_ether_addr(sta->sta.addr))) - return -EINVAL; - -- /* Strictly speaking this isn't necessary as we hold the mutex, but -- * the rhashtable code can't really deal with that distinction. We -- * do require the mutex for correctness though. -+ /* The RCU read lock is required by rhashtable due to -+ * asynchronous resize/rehash. We also require the mutex -+ * for correctness. - */ - rcu_read_lock(); - lockdep_assert_held(&sdata->local->sta_mtx); -@@ -1043,16 +1041,11 @@ static void sta_info_cleanup(unsigned lo - round_jiffies(jiffies + STA_INFO_CLEANUP_INTERVAL)); - } - --u32 sta_addr_hash(const void *key, u32 length, u32 seed) --{ -- return jhash(key, ETH_ALEN, seed); --} -- - int sta_info_init(struct ieee80211_local *local) - { - int err; - -- err = rhashtable_init(&local->sta_hash, &sta_rht_params); -+ err = rhltable_init(&local->sta_hash, &sta_rht_params); - if (err) - return err; - -@@ -1068,7 +1061,7 @@ int sta_info_init(struct ieee80211_local - void sta_info_stop(struct ieee80211_local *local) - { - del_timer_sync(&local->sta_cleanup); -- rhashtable_destroy(&local->sta_hash); -+ rhltable_destroy(&local->sta_hash); - } - - -@@ -1138,17 +1131,14 @@ struct ieee80211_sta *ieee80211_find_sta - const u8 *localaddr) - { - struct ieee80211_local *local = hw_to_local(hw); -+ struct rhlist_head *tmp; - struct sta_info *sta; -- struct rhash_head *tmp; -- const struct bucket_table *tbl; -- -- tbl = rht_dereference_rcu(local->sta_hash.tbl, &local->sta_hash); - - /* - * Just return a random station if localaddr is NULL - * ... first in list. - */ -- for_each_sta_info(local, tbl, addr, sta, tmp) { -+ for_each_sta_info(local, addr, sta, tmp) { - if (localaddr && - !ether_addr_equal(sta->sdata->vif.addr, localaddr)) - continue; ---- a/net/mac80211/sta_info.h -+++ b/net/mac80211/sta_info.h -@@ -455,7 +455,7 @@ struct sta_info { - /* General information, mostly static */ - struct list_head list, free_list; - struct rcu_head rcu_head; -- struct rhash_head hash_node; -+ struct rhlist_head hash_node; - u8 addr[ETH_ALEN]; - struct ieee80211_local *local; - struct ieee80211_sub_if_data *sdata; -@@ -638,6 +638,9 @@ rcu_dereference_protected_tid_tx(struct - */ - #define STA_INFO_CLEANUP_INTERVAL (10 * HZ) - -+struct rhlist_head *sta_info_hash_lookup(struct ieee80211_local *local, -+ const u8 *addr); -+ - /* - * Get a STA info, must be under RCU read lock. - */ -@@ -647,17 +650,9 @@ struct sta_info *sta_info_get(struct iee - struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata, - const u8 *addr); - --u32 sta_addr_hash(const void *key, u32 length, u32 seed); -- --#define _sta_bucket_idx(_tbl, _a) \ -- rht_bucket_index(_tbl, sta_addr_hash(_a, ETH_ALEN, (_tbl)->hash_rnd)) -- --#define for_each_sta_info(local, tbl, _addr, _sta, _tmp) \ -- rht_for_each_entry_rcu(_sta, _tmp, tbl, \ -- _sta_bucket_idx(tbl, _addr), \ -- hash_node) \ -- /* compare address and run code only if it matches */ \ -- if (ether_addr_equal(_sta->addr, (_addr))) -+#define for_each_sta_info(local, _addr, _sta, _tmp) \ -+ rhl_for_each_entry_rcu(_sta, _tmp, \ -+ sta_info_hash_lookup(local, _addr), hash_node) - - /* - * Get STA info by index, BROKEN! ---- a/net/mac80211/status.c -+++ b/net/mac80211/status.c -@@ -759,8 +759,8 @@ void ieee80211_tx_status(struct ieee8021 - struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); - __le16 fc; - struct ieee80211_supported_band *sband; -+ struct rhlist_head *tmp; - struct sta_info *sta; -- struct rhash_head *tmp; - int retry_count; - int rates_idx; - bool send_to_cooked; -@@ -768,7 +768,6 @@ void ieee80211_tx_status(struct ieee8021 - struct ieee80211_bar *bar; - int shift = 0; - int tid = IEEE80211_NUM_TIDS; -- const struct bucket_table *tbl; - - rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count); - -@@ -777,9 +776,7 @@ void ieee80211_tx_status(struct ieee8021 - sband = local->hw.wiphy->bands[info->band]; - fc = hdr->frame_control; - -- tbl = rht_dereference_rcu(local->sta_hash.tbl, &local->sta_hash); -- -- for_each_sta_info(local, tbl, hdr->addr1, sta, tmp) { -+ for_each_sta_info(local, hdr->addr1, sta, tmp) { - /* skip wrong virtual interface */ - if (!ether_addr_equal(hdr->addr2, sta->sdata->vif.addr)) - continue; diff --git a/package/kernel/mac80211/patches/310-ath9k-fix-block-ack-window-tracking-issues.patch b/package/kernel/mac80211/patches/313-ath9k-fix-block-ack-window-tracking-issues.patch similarity index 85% rename from package/kernel/mac80211/patches/310-ath9k-fix-block-ack-window-tracking-issues.patch rename to package/kernel/mac80211/patches/313-ath9k-fix-block-ack-window-tracking-issues.patch index 2993cbab74..fb8df08afe 100644 --- a/package/kernel/mac80211/patches/310-ath9k-fix-block-ack-window-tracking-issues.patch +++ b/package/kernel/mac80211/patches/313-ath9k-fix-block-ack-window-tracking-issues.patch @@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, struct ath_txq *txq, struct ath_atx_tid *tid, -@@ -300,7 +300,7 @@ static void ath_tx_flush_tid(struct ath_ +@@ -311,7 +311,7 @@ static void ath_tx_flush_tid(struct ath_ } if (fi->baw_tracked) { @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau sendbar = true; } -@@ -316,10 +316,15 @@ static void ath_tx_flush_tid(struct ath_ +@@ -327,10 +327,15 @@ static void ath_tx_flush_tid(struct ath_ } static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid, @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau index = ATH_BA_INDEX(tid->seq_start, seqno); cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); -@@ -340,6 +345,9 @@ static void ath_tx_addto_baw(struct ath_ +@@ -351,6 +356,9 @@ static void ath_tx_addto_baw(struct ath_ u16 seqno = bf->bf_state.seqno; int index, cindex; @@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau index = ATH_BA_INDEX(tid->seq_start, seqno); cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); __set_bit(cindex, tid->tx_buf); -@@ -616,7 +624,7 @@ static void ath_tx_complete_aggr(struct +@@ -627,7 +635,7 @@ static void ath_tx_complete_aggr(struct * complete the acked-ones/xretried ones; update * block-ack window */ @@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) { memcpy(tx_info->control.rates, rates, sizeof(rates)); -@@ -646,7 +654,7 @@ static void ath_tx_complete_aggr(struct +@@ -657,7 +665,7 @@ static void ath_tx_complete_aggr(struct * run out of tx buf. */ if (!tbf) { @@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau ath_tx_complete_buf(sc, bf, txq, &bf_head, NULL, ts, -@@ -987,11 +995,14 @@ ath_tx_get_tid_subframe(struct ath_softc +@@ -1046,11 +1054,14 @@ ath_tx_get_tid_subframe(struct ath_softc INIT_LIST_HEAD(&bf_head); list_add(&bf->list, &bf_head); @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau return bf; } -@@ -1049,8 +1060,6 @@ ath_tx_form_aggr(struct ath_softc *sc, s +@@ -1108,8 +1119,6 @@ ath_tx_form_aggr(struct ath_softc *sc, s bf->bf_next = NULL; /* link buffers of this frame to the aggregate */ @@ -100,7 +100,7 @@ Signed-off-by: Felix Fietkau bf->bf_state.ndelim = ndelim; list_add_tail(&bf->list, bf_q); -@@ -1686,10 +1695,8 @@ void ath9k_release_buffered_frames(struc +@@ -1745,10 +1754,8 @@ void ath9k_release_buffered_frames(struc ath9k_set_moredata(sc, bf, true); list_add_tail(&bf->list, &bf_q); ath_set_rates(tid->an->vif, tid->an->sta, bf, true); diff --git a/package/kernel/mac80211/patches/313-mac80211-fix-sequence-number-allocation-regression.patch b/package/kernel/mac80211/patches/313-mac80211-fix-sequence-number-allocation-regression.patch deleted file mode 100644 index c1548be0d2..0000000000 --- a/package/kernel/mac80211/patches/313-mac80211-fix-sequence-number-allocation-regression.patch +++ /dev/null @@ -1,37 +0,0 @@ -From: Felix Fietkau -Date: Tue, 11 Oct 2016 11:24:07 +0200 -Subject: [PATCH] mac80211: fix sequence number allocation regression - -The recent commit that moved around TX handlers dropped the sequence -number allocation at the end of ieee80211_tx_dequeue and calls -ieee80211_tx_h_sequence instead (for the non-fast-xmit case). -However, it did not change the fast-xmit sequence allocation condition -in ieee80211_xmit_fast_finish, which skipped seqno alloc if intermediate -tx queues are being used. - -Drop the now obsolete condition. - -Fixes: bb42f2d13ffc ("mac80211: Move reorder-sensitive TX handlers to after TXQ dequeue") -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -3212,7 +3212,6 @@ static void ieee80211_xmit_fast_finish(s - struct sk_buff *skb) - { - struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); -- struct ieee80211_local *local = sdata->local; - struct ieee80211_hdr *hdr = (void *)skb->data; - u8 tid = IEEE80211_NUM_TIDS; - -@@ -3224,8 +3223,7 @@ static void ieee80211_xmit_fast_finish(s - if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) { - tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; - *ieee80211_get_qos_ctl(hdr) = tid; -- if (!ieee80211_get_txq(local, &sdata->vif, &sta->sta, skb)) -- hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid); -+ hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid); - } else { - info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ; - hdr->seq_ctrl = cpu_to_le16(sdata->sequence_number); diff --git a/package/kernel/mac80211/patches/314-ath9k-rename-tx_complete_work-to-hw_check_work.patch b/package/kernel/mac80211/patches/314-ath9k-rename-tx_complete_work-to-hw_check_work.patch new file mode 100644 index 0000000000..5465df3ccf --- /dev/null +++ b/package/kernel/mac80211/patches/314-ath9k-rename-tx_complete_work-to-hw_check_work.patch @@ -0,0 +1,175 @@ +From: Felix Fietkau +Date: Wed, 25 Jan 2017 12:57:05 +0100 +Subject: [PATCH] ath9k: rename tx_complete_work to hw_check_work + +Also include common MAC alive check. This should make the hang checks +more reliable for modes where beacons are not sent and is used as a +starting point for further hang check improvements + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/wireless/ath/ath9k/ath9k.h ++++ b/drivers/net/wireless/ath/ath9k/ath9k.h +@@ -108,7 +108,7 @@ int ath_descdma_setup(struct ath_softc * + #define ATH_AGGR_MIN_QDEPTH 2 + /* minimum h/w qdepth for non-aggregated traffic */ + #define ATH_NON_AGGR_MIN_QDEPTH 8 +-#define ATH_TX_COMPLETE_POLL_INT 1000 ++#define ATH_HW_CHECK_POLL_INT 1000 + #define ATH_TXFIFO_DEPTH 8 + #define ATH_TX_ERROR 0x01 + +@@ -745,7 +745,7 @@ void ath9k_csa_update(struct ath_softc * + #define ATH_PAPRD_TIMEOUT 100 /* msecs */ + #define ATH_PLL_WORK_INTERVAL 100 + +-void ath_tx_complete_poll_work(struct work_struct *work); ++void ath_hw_check_work(struct work_struct *work); + void ath_reset_work(struct work_struct *work); + bool ath_hw_check(struct ath_softc *sc); + void ath_hw_pll_work(struct work_struct *work); +@@ -1053,7 +1053,7 @@ struct ath_softc { + #ifdef CPTCFG_ATH9K_DEBUGFS + struct ath9k_debug debug; + #endif +- struct delayed_work tx_complete_work; ++ struct delayed_work hw_check_work; + struct delayed_work hw_pll_work; + struct timer_list sleep_timer; + +--- a/drivers/net/wireless/ath/ath9k/init.c ++++ b/drivers/net/wireless/ath/ath9k/init.c +@@ -681,6 +681,7 @@ static int ath9k_init_softc(u16 devid, s + INIT_WORK(&sc->hw_reset_work, ath_reset_work); + INIT_WORK(&sc->paprd_work, ath_paprd_calibrate); + INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work); ++ INIT_DELAYED_WORK(&sc->hw_check_work, ath_hw_check_work); + + ath9k_init_channel_context(sc); + +--- a/drivers/net/wireless/ath/ath9k/link.c ++++ b/drivers/net/wireless/ath/ath9k/link.c +@@ -20,20 +20,13 @@ + * TX polling - checks if the TX engine is stuck somewhere + * and issues a chip reset if so. + */ +-void ath_tx_complete_poll_work(struct work_struct *work) ++static bool ath_tx_complete_check(struct ath_softc *sc) + { +- struct ath_softc *sc = container_of(work, struct ath_softc, +- tx_complete_work.work); + struct ath_txq *txq; + int i; +- bool needreset = false; +- + +- if (sc->tx99_state) { +- ath_dbg(ath9k_hw_common(sc->sc_ah), RESET, +- "skip tx hung detection on tx99\n"); +- return; +- } ++ if (sc->tx99_state) ++ return true; + + for (i = 0; i < IEEE80211_NUM_ACS; i++) { + txq = sc->tx.txq_map[i]; +@@ -41,25 +34,36 @@ void ath_tx_complete_poll_work(struct wo + ath_txq_lock(sc, txq); + if (txq->axq_depth) { + if (txq->axq_tx_inprogress) { +- needreset = true; + ath_txq_unlock(sc, txq); +- break; +- } else { +- txq->axq_tx_inprogress = true; ++ goto reset; + } ++ ++ txq->axq_tx_inprogress = true; + } + ath_txq_unlock(sc, txq); + } + +- if (needreset) { +- ath_dbg(ath9k_hw_common(sc->sc_ah), RESET, +- "tx hung, resetting the chip\n"); +- ath9k_queue_reset(sc, RESET_TYPE_TX_HANG); ++ return true; ++ ++reset: ++ ath_dbg(ath9k_hw_common(sc->sc_ah), RESET, ++ "tx hung, resetting the chip\n"); ++ ath9k_queue_reset(sc, RESET_TYPE_TX_HANG); ++ return false; ++ ++} ++ ++void ath_hw_check_work(struct work_struct *work) ++{ ++ struct ath_softc *sc = container_of(work, struct ath_softc, ++ hw_check_work.work); ++ ++ if (!ath_hw_check(sc) || ++ !ath_tx_complete_check(sc)) + return; +- } + +- ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, +- msecs_to_jiffies(ATH_TX_COMPLETE_POLL_INT)); ++ ieee80211_queue_delayed_work(sc->hw, &sc->hw_check_work, ++ msecs_to_jiffies(ATH_HW_CHECK_POLL_INT)); + } + + /* +--- a/drivers/net/wireless/ath/ath9k/main.c ++++ b/drivers/net/wireless/ath/ath9k/main.c +@@ -181,7 +181,7 @@ void ath9k_ps_restore(struct ath_softc * + static void __ath_cancel_work(struct ath_softc *sc) + { + cancel_work_sync(&sc->paprd_work); +- cancel_delayed_work_sync(&sc->tx_complete_work); ++ cancel_delayed_work_sync(&sc->hw_check_work); + cancel_delayed_work_sync(&sc->hw_pll_work); + + #ifdef CPTCFG_ATH9K_BTCOEX_SUPPORT +@@ -198,7 +198,8 @@ void ath_cancel_work(struct ath_softc *s + + void ath_restart_work(struct ath_softc *sc) + { +- ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0); ++ ieee80211_queue_delayed_work(sc->hw, &sc->hw_check_work, ++ ATH_HW_CHECK_POLL_INT); + + if (AR_SREV_9340(sc->sc_ah) || AR_SREV_9330(sc->sc_ah)) + ieee80211_queue_delayed_work(sc->hw, &sc->hw_pll_work, +@@ -2091,7 +2092,7 @@ void __ath9k_flush(struct ieee80211_hw * + int timeout; + bool drain_txq; + +- cancel_delayed_work_sync(&sc->tx_complete_work); ++ cancel_delayed_work_sync(&sc->hw_check_work); + + if (ah->ah_flags & AH_UNPLUGGED) { + ath_dbg(common, ANY, "Device has been unplugged!\n"); +@@ -2129,7 +2130,8 @@ void __ath9k_flush(struct ieee80211_hw * + ath9k_ps_restore(sc); + } + +- ieee80211_queue_delayed_work(hw, &sc->tx_complete_work, 0); ++ ieee80211_queue_delayed_work(hw, &sc->hw_check_work, ++ ATH_HW_CHECK_POLL_INT); + } + + static bool ath9k_tx_frames_pending(struct ieee80211_hw *hw) +--- a/drivers/net/wireless/ath/ath9k/xmit.c ++++ b/drivers/net/wireless/ath/ath9k/xmit.c +@@ -2916,8 +2916,6 @@ int ath_tx_init(struct ath_softc *sc, in + return error; + } + +- INIT_DELAYED_WORK(&sc->tx_complete_work, ath_tx_complete_poll_work); +- + if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) + error = ath_tx_edma_init(sc); + diff --git a/package/kernel/mac80211/patches/315-ath9k_hw-check-if-the-chip-failed-to-wake-up.patch b/package/kernel/mac80211/patches/315-ath9k_hw-check-if-the-chip-failed-to-wake-up.patch new file mode 100644 index 0000000000..b0cb74ad05 --- /dev/null +++ b/package/kernel/mac80211/patches/315-ath9k_hw-check-if-the-chip-failed-to-wake-up.patch @@ -0,0 +1,30 @@ +From: Felix Fietkau +Date: Wed, 25 Jan 2017 12:58:17 +0100 +Subject: [PATCH] ath9k_hw: check if the chip failed to wake up + +In an RFC patch, Sven Eckelmann and Simon Wunderlich reported: + +"QCA 802.11n chips (especially AR9330/AR9340) sometimes end up in a +state in which a read of AR_CFG always returns 0xdeadbeef. +This should not happen when when the power_mode of the device is +ATH9K_PM_AWAKE." + +Include the check for the default register state in the existing MAC +hang check. + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/wireless/ath/ath9k/hw.c ++++ b/drivers/net/wireless/ath/ath9k/hw.c +@@ -1624,6 +1624,10 @@ bool ath9k_hw_check_alive(struct ath_hw + int count = 50; + u32 reg, last_val; + ++ /* Check if chip failed to wake up */ ++ if (REG_READ(ah, AR_CFG) == 0xdeadbeef) ++ return false; ++ + if (AR_SREV_9300(ah)) + return !ath9k_hw_detect_mac_hang(ah); + diff --git a/package/kernel/mac80211/patches/316-ath9k-fix-race-condition-in-enabling-disabling-IRQs.patch b/package/kernel/mac80211/patches/316-ath9k-fix-race-condition-in-enabling-disabling-IRQs.patch new file mode 100644 index 0000000000..7a41206132 --- /dev/null +++ b/package/kernel/mac80211/patches/316-ath9k-fix-race-condition-in-enabling-disabling-IRQs.patch @@ -0,0 +1,197 @@ +From: Felix Fietkau +Date: Wed, 25 Jan 2017 15:10:37 +0100 +Subject: [PATCH] ath9k: fix race condition in enabling/disabling IRQs + +The code currently relies on refcounting to disable IRQs from within the +IRQ handler and re-enabling them again after the tasklet has run. + +However, due to race conditions sometimes the IRQ handler might be +called twice, or the tasklet may not run at all (if interrupted in the +middle of a reset). + +This can cause nasty imbalances in the irq-disable refcount which will +get the driver permanently stuck until the entire radio has been stopped +and started again (ath_reset will not recover from this). + +Instead of using this fragile logic, change the code to ensure that +running the irq handler during tasklet processing is safe, and leave the +refcount untouched. + +Cc: stable@vger.kernel.org +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/wireless/ath/ath9k/ath9k.h ++++ b/drivers/net/wireless/ath/ath9k/ath9k.h +@@ -998,6 +998,7 @@ struct ath_softc { + struct survey_info *cur_survey; + struct survey_info survey[ATH9K_NUM_CHANNELS]; + ++ spinlock_t intr_lock; + struct tasklet_struct intr_tq; + struct tasklet_struct bcon_tasklet; + struct ath_hw *sc_ah; +--- a/drivers/net/wireless/ath/ath9k/init.c ++++ b/drivers/net/wireless/ath/ath9k/init.c +@@ -669,6 +669,7 @@ static int ath9k_init_softc(u16 devid, s + common->bt_ant_diversity = 1; + + spin_lock_init(&common->cc_lock); ++ spin_lock_init(&sc->intr_lock); + spin_lock_init(&sc->sc_serial_rw); + spin_lock_init(&sc->sc_pm_lock); + spin_lock_init(&sc->chan_lock); +--- a/drivers/net/wireless/ath/ath9k/mac.c ++++ b/drivers/net/wireless/ath/ath9k/mac.c +@@ -810,21 +810,12 @@ void ath9k_hw_disable_interrupts(struct + } + EXPORT_SYMBOL(ath9k_hw_disable_interrupts); + +-void ath9k_hw_enable_interrupts(struct ath_hw *ah) ++static void __ath9k_hw_enable_interrupts(struct ath_hw *ah) + { + struct ath_common *common = ath9k_hw_common(ah); + u32 sync_default = AR_INTR_SYNC_DEFAULT; + u32 async_mask; + +- if (!(ah->imask & ATH9K_INT_GLOBAL)) +- return; +- +- if (!atomic_inc_and_test(&ah->intr_ref_cnt)) { +- ath_dbg(common, INTERRUPT, "Do not enable IER ref count %d\n", +- atomic_read(&ah->intr_ref_cnt)); +- return; +- } +- + if (AR_SREV_9340(ah) || AR_SREV_9550(ah) || AR_SREV_9531(ah) || + AR_SREV_9561(ah)) + sync_default &= ~AR_INTR_SYNC_HOST1_FATAL; +@@ -846,6 +837,39 @@ void ath9k_hw_enable_interrupts(struct a + ath_dbg(common, INTERRUPT, "AR_IMR 0x%x IER 0x%x\n", + REG_READ(ah, AR_IMR), REG_READ(ah, AR_IER)); + } ++ ++void ath9k_hw_resume_interrupts(struct ath_hw *ah) ++{ ++ struct ath_common *common = ath9k_hw_common(ah); ++ ++ if (!(ah->imask & ATH9K_INT_GLOBAL)) ++ return; ++ ++ if (atomic_read(&ah->intr_ref_cnt) != 0) { ++ ath_dbg(common, INTERRUPT, "Do not enable IER ref count %d\n", ++ atomic_read(&ah->intr_ref_cnt)); ++ return; ++ } ++ ++ __ath9k_hw_enable_interrupts(ah); ++} ++EXPORT_SYMBOL(ath9k_hw_resume_interrupts); ++ ++void ath9k_hw_enable_interrupts(struct ath_hw *ah) ++{ ++ struct ath_common *common = ath9k_hw_common(ah); ++ ++ if (!(ah->imask & ATH9K_INT_GLOBAL)) ++ return; ++ ++ if (!atomic_inc_and_test(&ah->intr_ref_cnt)) { ++ ath_dbg(common, INTERRUPT, "Do not enable IER ref count %d\n", ++ atomic_read(&ah->intr_ref_cnt)); ++ return; ++ } ++ ++ __ath9k_hw_enable_interrupts(ah); ++} + EXPORT_SYMBOL(ath9k_hw_enable_interrupts); + + void ath9k_hw_set_interrupts(struct ath_hw *ah) +--- a/drivers/net/wireless/ath/ath9k/mac.h ++++ b/drivers/net/wireless/ath/ath9k/mac.h +@@ -744,6 +744,7 @@ void ath9k_hw_set_interrupts(struct ath_ + void ath9k_hw_enable_interrupts(struct ath_hw *ah); + void ath9k_hw_disable_interrupts(struct ath_hw *ah); + void ath9k_hw_kill_interrupts(struct ath_hw *ah); ++void ath9k_hw_resume_interrupts(struct ath_hw *ah); + + void ar9002_hw_attach_mac_ops(struct ath_hw *ah); + +--- a/drivers/net/wireless/ath/ath9k/main.c ++++ b/drivers/net/wireless/ath/ath9k/main.c +@@ -374,21 +374,20 @@ void ath9k_tasklet(unsigned long data) + struct ath_common *common = ath9k_hw_common(ah); + enum ath_reset_type type; + unsigned long flags; +- u32 status = sc->intrstatus; ++ u32 status; + u32 rxmask; + ++ spin_lock_irqsave(&sc->intr_lock, flags); ++ status = sc->intrstatus; ++ sc->intrstatus = 0; ++ spin_unlock_irqrestore(&sc->intr_lock, flags); ++ + ath9k_ps_wakeup(sc); + spin_lock(&sc->sc_pcu_lock); + + if (status & ATH9K_INT_FATAL) { + type = RESET_TYPE_FATAL_INT; + ath9k_queue_reset(sc, type); +- +- /* +- * Increment the ref. counter here so that +- * interrupts are enabled in the reset routine. +- */ +- atomic_inc(&ah->intr_ref_cnt); + ath_dbg(common, RESET, "FATAL: Skipping interrupts\n"); + goto out; + } +@@ -404,11 +403,6 @@ void ath9k_tasklet(unsigned long data) + type = RESET_TYPE_BB_WATCHDOG; + ath9k_queue_reset(sc, type); + +- /* +- * Increment the ref. counter here so that +- * interrupts are enabled in the reset routine. +- */ +- atomic_inc(&ah->intr_ref_cnt); + ath_dbg(common, RESET, + "BB_WATCHDOG: Skipping interrupts\n"); + goto out; +@@ -421,7 +415,6 @@ void ath9k_tasklet(unsigned long data) + if ((sc->gtt_cnt >= MAX_GTT_CNT) && !ath9k_hw_check_alive(ah)) { + type = RESET_TYPE_TX_GTT; + ath9k_queue_reset(sc, type); +- atomic_inc(&ah->intr_ref_cnt); + ath_dbg(common, RESET, + "GTT: Skipping interrupts\n"); + goto out; +@@ -478,7 +471,7 @@ void ath9k_tasklet(unsigned long data) + ath9k_btcoex_handle_interrupt(sc, status); + + /* re-enable hardware interrupt */ +- ath9k_hw_enable_interrupts(ah); ++ ath9k_hw_resume_interrupts(ah); + out: + spin_unlock(&sc->sc_pcu_lock); + ath9k_ps_restore(sc); +@@ -542,7 +535,9 @@ irqreturn_t ath_isr(int irq, void *dev) + return IRQ_NONE; + + /* Cache the status */ +- sc->intrstatus = status; ++ spin_lock(&sc->intr_lock); ++ sc->intrstatus |= status; ++ spin_unlock(&sc->intr_lock); + + if (status & SCHED_INTR) + sched = true; +@@ -588,7 +583,7 @@ chip_reset: + + if (sched) { + /* turn off every interrupt */ +- ath9k_hw_disable_interrupts(ah); ++ ath9k_hw_kill_interrupts(ah); + tasklet_schedule(&sc->intr_tq); + } + diff --git a/package/kernel/mac80211/patches/317-Revert-ath9k_hw-implement-temperature-compensation-s.patch b/package/kernel/mac80211/patches/317-Revert-ath9k_hw-implement-temperature-compensation-s.patch deleted file mode 100644 index 687df35a9e..0000000000 --- a/package/kernel/mac80211/patches/317-Revert-ath9k_hw-implement-temperature-compensation-s.patch +++ /dev/null @@ -1,101 +0,0 @@ -From: Felix Fietkau -Date: Tue, 11 Oct 2016 19:45:41 +0200 -Subject: [PATCH] Revert "ath9k_hw: implement temperature compensation support - for AR9003+" - -This reverts commit 171f6402e4aa5cd3b8407f82501f7ea21fa54ccc. -Some users report that this commit causes a regression in performance -under some conditions. - -Signed-off-by: Felix Fietkau ---- - ---- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c -+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c -@@ -33,7 +33,6 @@ struct coeff { - - enum ar9003_cal_types { - IQ_MISMATCH_CAL = BIT(0), -- TEMP_COMP_CAL = BIT(1), - }; - - static void ar9003_hw_setup_calibration(struct ath_hw *ah, -@@ -59,12 +58,6 @@ static void ar9003_hw_setup_calibration( - /* Kick-off cal */ - REG_SET_BIT(ah, AR_PHY_TIMING4, AR_PHY_TIMING4_DO_CAL); - break; -- case TEMP_COMP_CAL: -- ath_dbg(common, CALIBRATE, -- "starting Temperature Compensation Calibration\n"); -- REG_SET_BIT(ah, AR_CH0_THERM, AR_CH0_THERM_LOCAL); -- REG_SET_BIT(ah, AR_CH0_THERM, AR_CH0_THERM_START); -- break; - default: - ath_err(common, "Invalid calibration type\n"); - break; -@@ -93,8 +86,7 @@ static bool ar9003_hw_per_calibration(st - /* - * Accumulate cal measures for active chains - */ -- if (cur_caldata->calCollect) -- cur_caldata->calCollect(ah); -+ cur_caldata->calCollect(ah); - ah->cal_samples++; - - if (ah->cal_samples >= cur_caldata->calNumSamples) { -@@ -107,8 +99,7 @@ static bool ar9003_hw_per_calibration(st - /* - * Process accumulated data - */ -- if (cur_caldata->calPostProc) -- cur_caldata->calPostProc(ah, numChains); -+ cur_caldata->calPostProc(ah, numChains); - - /* Calibration has finished. */ - caldata->CalValid |= cur_caldata->calType; -@@ -323,16 +314,9 @@ static const struct ath9k_percal_data iq - ar9003_hw_iqcalibrate - }; - --static const struct ath9k_percal_data temp_cal_single_sample = { -- TEMP_COMP_CAL, -- MIN_CAL_SAMPLES, -- PER_MAX_LOG_COUNT, --}; -- - static void ar9003_hw_init_cal_settings(struct ath_hw *ah) - { - ah->iq_caldata.calData = &iq_cal_single_sample; -- ah->temp_caldata.calData = &temp_cal_single_sample; - - if (AR_SREV_9300_20_OR_LATER(ah)) { - ah->enabled_cals |= TX_IQ_CAL; -@@ -340,7 +324,7 @@ static void ar9003_hw_init_cal_settings( - ah->enabled_cals |= TX_IQ_ON_AGC_CAL; - } - -- ah->supp_cals = IQ_MISMATCH_CAL | TEMP_COMP_CAL; -+ ah->supp_cals = IQ_MISMATCH_CAL; - } - - #define OFF_UPPER_LT 24 -@@ -1399,9 +1383,6 @@ static void ar9003_hw_init_cal_common(st - INIT_CAL(&ah->iq_caldata); - INSERT_CAL(ah, &ah->iq_caldata); - -- INIT_CAL(&ah->temp_caldata); -- INSERT_CAL(ah, &ah->temp_caldata); -- - /* Initialize current pointer to first element in list */ - ah->cal_list_curr = ah->cal_list; - ---- a/drivers/net/wireless/ath/ath9k/hw.h -+++ b/drivers/net/wireless/ath/ath9k/hw.h -@@ -830,7 +830,6 @@ struct ath_hw { - /* Calibration */ - u32 supp_cals; - struct ath9k_cal_list iq_caldata; -- struct ath9k_cal_list temp_caldata; - struct ath9k_cal_list adcgain_caldata; - struct ath9k_cal_list adcdc_caldata; - struct ath9k_cal_list *cal_list; diff --git a/package/kernel/mac80211/patches/317-rt2x00-avoid-introducing-a-USB-dependency-in-the-rt2.patch b/package/kernel/mac80211/patches/317-rt2x00-avoid-introducing-a-USB-dependency-in-the-rt2.patch new file mode 100644 index 0000000000..c0274ddde9 --- /dev/null +++ b/package/kernel/mac80211/patches/317-rt2x00-avoid-introducing-a-USB-dependency-in-the-rt2.patch @@ -0,0 +1,73 @@ +From: Stanislaw Gruszka +Date: Thu, 2 Feb 2017 10:57:40 +0100 +Subject: [PATCH] rt2x00: avoid introducing a USB dependency in the + rt2x00lib module + +As reported by Felix: + +Though protected by an ifdef, introducing an usb symbol dependency in +the rt2x00lib module is a major inconvenience for distributions that +package kernel modules split into individual packages. + +Get rid of this unnecessary dependency by calling the usb related +function from a more suitable place. + +Cc: Vishal Thanki +Reported-by: Felix Fietkau +Fixes: 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB") +Signed-off-by: Stanislaw Gruszka +--- + +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +@@ -1436,21 +1436,6 @@ void rt2x00lib_remove_dev(struct rt2x00_ + cancel_work_sync(&rt2x00dev->intf_work); + cancel_delayed_work_sync(&rt2x00dev->autowakeup_work); + cancel_work_sync(&rt2x00dev->sleep_work); +-#if IS_ENABLED(CPTCFG_RT2X00_LIB_USB) +- if (rt2x00_is_usb(rt2x00dev)) { +- usb_kill_anchored_urbs(rt2x00dev->anchor); +- hrtimer_cancel(&rt2x00dev->txstatus_timer); +- cancel_work_sync(&rt2x00dev->rxdone_work); +- cancel_work_sync(&rt2x00dev->txdone_work); +- } +-#endif +- if (rt2x00dev->workqueue) +- destroy_workqueue(rt2x00dev->workqueue); +- +- /* +- * Free the tx status fifo. +- */ +- kfifo_free(&rt2x00dev->txstatus_fifo); + + /* + * Kill the tx status tasklet. +@@ -1466,6 +1451,14 @@ void rt2x00lib_remove_dev(struct rt2x00_ + */ + rt2x00lib_uninitialize(rt2x00dev); + ++ if (rt2x00dev->workqueue) ++ destroy_workqueue(rt2x00dev->workqueue); ++ ++ /* ++ * Free the tx status fifo. ++ */ ++ kfifo_free(&rt2x00dev->txstatus_fifo); ++ + /* + * Free extra components + */ +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +@@ -744,6 +744,11 @@ void rt2x00usb_uninitialize(struct rt2x0 + { + struct data_queue *queue; + ++ usb_kill_anchored_urbs(rt2x00dev->anchor); ++ hrtimer_cancel(&rt2x00dev->txstatus_timer); ++ cancel_work_sync(&rt2x00dev->rxdone_work); ++ cancel_work_sync(&rt2x00dev->txdone_work); ++ + queue_for_each(rt2x00dev, queue) + rt2x00usb_free_entries(queue); + } diff --git a/package/kernel/mac80211/patches/318-0001-brcmfmac-check-brcmf_bus_get_memdump-result-for-erro.patch b/package/kernel/mac80211/patches/318-0001-brcmfmac-check-brcmf_bus_get_memdump-result-for-erro.patch new file mode 100644 index 0000000000..4ae4c606c5 --- /dev/null +++ b/package/kernel/mac80211/patches/318-0001-brcmfmac-check-brcmf_bus_get_memdump-result-for-erro.patch @@ -0,0 +1,52 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 30 Jan 2017 16:09:51 +0100 +Subject: [PATCH] brcmfmac: check brcmf_bus_get_memdump result for error +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This method may be unsupported (see: USB bus) or may just fail (see: +SDIO bus). +While at it rework logic in brcmf_sdio_bus_get_memdump function to avoid +too many conditional code nesting levels. + +Signed-off-by: Rafał Miłecki +Acked-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c +@@ -32,16 +32,25 @@ static int brcmf_debug_create_memdump(st + { + void *dump; + size_t ramsize; ++ int err; + + ramsize = brcmf_bus_get_ramsize(bus); +- if (ramsize) { +- dump = vzalloc(len + ramsize); +- if (!dump) +- return -ENOMEM; +- memcpy(dump, data, len); +- brcmf_bus_get_memdump(bus, dump + len, ramsize); +- dev_coredumpv(bus->dev, dump, len + ramsize, GFP_KERNEL); ++ if (!ramsize) ++ return -ENOTSUPP; ++ ++ dump = vzalloc(len + ramsize); ++ if (!dump) ++ return -ENOMEM; ++ ++ memcpy(dump, data, len); ++ err = brcmf_bus_get_memdump(bus, dump + len, ramsize); ++ if (err) { ++ vfree(dump); ++ return err; + } ++ ++ dev_coredumpv(bus->dev, dump, len + ramsize, GFP_KERNEL); ++ + return 0; + } + diff --git a/package/kernel/mac80211/patches/318-mac80211-fix-up-mismerge-of-ieee80211_tx_dequeue.patch b/package/kernel/mac80211/patches/318-mac80211-fix-up-mismerge-of-ieee80211_tx_dequeue.patch deleted file mode 100644 index 2e742e4484..0000000000 --- a/package/kernel/mac80211/patches/318-mac80211-fix-up-mismerge-of-ieee80211_tx_dequeue.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Bob Copeland -Date: Wed, 12 Oct 2016 08:24:54 -0400 -Subject: [PATCH] mac80211: fix up mismerge of ieee80211_tx_dequeue - -Looks like this spinlock wound up on the wrong side of the -linearize, and I also lost the part that re-enters the loop. -Fix up to match mac80211-next. - -Signed-off-by: Bob Copeland ---- - ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -3457,17 +3457,17 @@ begin: - skb_queue_splice_tail(&tx.skbs, &txqi->frags); - } - --out: -- spin_unlock_bh(&fq->lock); -- - if (skb && skb_has_frag_list(skb) && - !ieee80211_hw_check(&local->hw, TX_FRAG_LIST)) { - if (skb_linearize(skb)) { - ieee80211_free_txskb(&local->hw, skb); -- return NULL; -+ goto begin; - } - } - -+out: -+ spin_unlock_bh(&fq->lock); -+ - return skb; - } - EXPORT_SYMBOL(ieee80211_tx_dequeue); diff --git a/package/kernel/mac80211/patches/319-0002-brcmfmac-be-more-verbose-when-PSM-s-watchdog-fires.patch b/package/kernel/mac80211/patches/319-0002-brcmfmac-be-more-verbose-when-PSM-s-watchdog-fires.patch new file mode 100644 index 0000000000..2a3b83864e --- /dev/null +++ b/package/kernel/mac80211/patches/319-0002-brcmfmac-be-more-verbose-when-PSM-s-watchdog-fires.patch @@ -0,0 +1,38 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 30 Jan 2017 16:09:52 +0100 +Subject: [PATCH] brcmfmac: be more verbose when PSM's watchdog fires +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +It's important to inform user so he knows things went wrong. He may also +want to get memory dump for further debugging purposes. + +Signed-off-by: Rafał Miłecki +Acked-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c +@@ -58,10 +58,18 @@ static int brcmf_debug_psm_watchdog_noti + const struct brcmf_event_msg *evtmsg, + void *data) + { ++ int err; ++ + brcmf_dbg(TRACE, "enter: bsscfgidx=%d\n", ifp->bsscfgidx); + +- return brcmf_debug_create_memdump(ifp->drvr->bus_if, data, +- evtmsg->datalen); ++ brcmf_err("PSM's watchdog has fired!\n"); ++ ++ err = brcmf_debug_create_memdump(ifp->drvr->bus_if, data, ++ evtmsg->datalen); ++ if (err) ++ brcmf_err("Failed to get memory dump, %d\n", err); ++ ++ return err; + } + + void brcmf_debugfs_init(void) diff --git a/package/kernel/mac80211/patches/319-0003-brcmfmac-use-wiphy_read_of_freq_limits-to-respect-li.patch b/package/kernel/mac80211/patches/319-0003-brcmfmac-use-wiphy_read_of_freq_limits-to-respect-li.patch new file mode 100644 index 0000000000..6448bad5e9 --- /dev/null +++ b/package/kernel/mac80211/patches/319-0003-brcmfmac-use-wiphy_read_of_freq_limits-to-respect-li.patch @@ -0,0 +1,44 @@ +From 0f83ff69735651cc7a3d150466a5257ff829b62b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 17 Jan 2017 23:35:50 +0100 +Subject: [PATCH] brcmfmac: use wiphy_read_of_freq_limits to respect limits + from DT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This new helper reads extra frequency limits specified in DT and +disables unavailable chanels. This is useful for devices (like home +routers) with chipsets limited e.g. by board design. + +In order to respect info read from DT we simply need to check for +IEEE80211_CHAN_DISABLED bit when constructing channel info. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -5908,6 +5908,9 @@ static int brcmf_construct_chaninfo(stru + continue; + } + ++ if (channel->orig_flags & IEEE80211_CHAN_DISABLED) ++ continue; ++ + /* assuming the chanspecs order is HT20, + * HT40 upper, HT40 lower, and VHT80. + */ +@@ -6509,6 +6512,9 @@ static int brcmf_setup_wiphy(struct wiph + wiphy->bands[NL80211_BAND_5GHZ] = band; + } + } ++ ++ wiphy_read_of_freq_limits(wiphy); ++ + return 0; + } + diff --git a/package/kernel/mac80211/patches/319-0004-brcmfmac-merge-two-brcmf_err-macros-into-one.patch b/package/kernel/mac80211/patches/319-0004-brcmfmac-merge-two-brcmf_err-macros-into-one.patch new file mode 100644 index 0000000000..defd5792ea --- /dev/null +++ b/package/kernel/mac80211/patches/319-0004-brcmfmac-merge-two-brcmf_err-macros-into-one.patch @@ -0,0 +1,43 @@ +From 9587a01a7ead9efc5032c16e0d9668de58be1186 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 2 Feb 2017 22:33:13 +0100 +Subject: [PATCH] brcmfmac: merge two brcmf_err macros into one +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This allows simplifying the code by adding a simple IS_ENABLED check for +CONFIG_BRCMDB symbol. + +Signed-off-by: Rafał Miłecki +Acked-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h +@@ -45,20 +45,16 @@ + #undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#ifndef CPTCFG_BRCM_TRACING + /* Macro for error messages. net_ratelimit() is used when driver + * debugging is not selected. When debugging the driver error + * messages are as important as other tracing or even more so. + */ +-#ifndef CPTCFG_BRCM_TRACING +-#ifdef CPTCFG_BRCMDBG +-#define brcmf_err(fmt, ...) pr_err("%s: " fmt, __func__, ##__VA_ARGS__) +-#else + #define brcmf_err(fmt, ...) \ + do { \ +- if (net_ratelimit()) \ ++ if (IS_ENABLED(CPTCFG_BRCMDBG) || net_ratelimit()) \ + pr_err("%s: " fmt, __func__, ##__VA_ARGS__); \ + } while (0) +-#endif + #else + __printf(2, 3) + void __brcmf_err(const char *func, const char *fmt, ...); diff --git a/package/kernel/mac80211/patches/319-0005-brcmfmac-switch-to-C-function-__brcmf_err-for-printi.patch b/package/kernel/mac80211/patches/319-0005-brcmfmac-switch-to-C-function-__brcmf_err-for-printi.patch new file mode 100644 index 0000000000..5baf6960ec --- /dev/null +++ b/package/kernel/mac80211/patches/319-0005-brcmfmac-switch-to-C-function-__brcmf_err-for-printi.patch @@ -0,0 +1,69 @@ +From 087fa712a00685dac4bcc64b7c3dc8ae6bee8026 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 2 Feb 2017 22:33:14 +0100 +Subject: [PATCH] brcmfmac: switch to C function (__brcmf_err) for printing + errors +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This will allow extending code and using more detailed messages e.g. +with the help of dev_err. + +Signed-off-by: Rafał Miłecki +Acked-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + .../net/wireless/broadcom/brcm80211/brcmfmac/common.c | 16 ++++++++++++++++ + drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h | 6 +++--- + 2 files changed, 19 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +@@ -218,6 +218,22 @@ done: + return err; + } + ++#ifndef CPTCFG_BRCM_TRACING ++void __brcmf_err(const char *func, const char *fmt, ...) ++{ ++ struct va_format vaf; ++ va_list args; ++ ++ va_start(args, fmt); ++ ++ vaf.fmt = fmt; ++ vaf.va = &args; ++ pr_err("%s: %pV", func, &vaf); ++ ++ va_end(args); ++} ++#endif ++ + #if defined(CPTCFG_BRCM_TRACING) || defined(CPTCFG_BRCMDBG) + void __brcmf_dbg(u32 level, const char *func, const char *fmt, ...) + { +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h +@@ -45,6 +45,8 @@ + #undef pr_fmt + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++__printf(2, 3) ++void __brcmf_err(const char *func, const char *fmt, ...); + #ifndef CPTCFG_BRCM_TRACING + /* Macro for error messages. net_ratelimit() is used when driver + * debugging is not selected. When debugging the driver error +@@ -53,11 +55,9 @@ + #define brcmf_err(fmt, ...) \ + do { \ + if (IS_ENABLED(CPTCFG_BRCMDBG) || net_ratelimit()) \ +- pr_err("%s: " fmt, __func__, ##__VA_ARGS__); \ ++ __brcmf_err(__func__, fmt, ##__VA_ARGS__); \ + } while (0) + #else +-__printf(2, 3) +-void __brcmf_err(const char *func, const char *fmt, ...); + #define brcmf_err(fmt, ...) \ + __brcmf_err(__func__, fmt, ##__VA_ARGS__) + #endif diff --git a/package/kernel/mac80211/patches/319-0006-brcmfmac-merge-two-remaining-brcmf_err-macros.patch b/package/kernel/mac80211/patches/319-0006-brcmfmac-merge-two-remaining-brcmf_err-macros.patch new file mode 100644 index 0000000000..3aaddb800d --- /dev/null +++ b/package/kernel/mac80211/patches/319-0006-brcmfmac-merge-two-remaining-brcmf_err-macros.patch @@ -0,0 +1,46 @@ +From d0630555650a394cf5743268820511f527a561a5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 2 Feb 2017 22:33:15 +0100 +Subject: [PATCH] brcmfmac: merge two remaining brcmf_err macros +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Now we always have __brcmf_err function we can do perfectly fine with +just one macro. + +Signed-off-by: Rafał Miłecki +Acked-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h | 14 +++++--------- + 1 file changed, 5 insertions(+), 9 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h +@@ -47,20 +47,16 @@ + + __printf(2, 3) + void __brcmf_err(const char *func, const char *fmt, ...); +-#ifndef CPTCFG_BRCM_TRACING +-/* Macro for error messages. net_ratelimit() is used when driver +- * debugging is not selected. When debugging the driver error +- * messages are as important as other tracing or even more so. ++/* Macro for error messages. When debugging / tracing the driver all error ++ * messages are important to us. + */ + #define brcmf_err(fmt, ...) \ + do { \ +- if (IS_ENABLED(CPTCFG_BRCMDBG) || net_ratelimit()) \ ++ if (IS_ENABLED(CPTCFG_BRCMDBG) || \ ++ IS_ENABLED(CPTCFG_BRCM_TRACING) || \ ++ net_ratelimit()) \ + __brcmf_err(__func__, fmt, ##__VA_ARGS__); \ + } while (0) +-#else +-#define brcmf_err(fmt, ...) \ +- __brcmf_err(__func__, fmt, ##__VA_ARGS__) +-#endif + + #if defined(DEBUG) || defined(CPTCFG_BRCM_TRACING) + __printf(3, 4) diff --git a/package/kernel/mac80211/patches/319-mac80211-avoid-extra-memcpy-in-A-MSDU-head-creation.patch b/package/kernel/mac80211/patches/319-mac80211-avoid-extra-memcpy-in-A-MSDU-head-creation.patch deleted file mode 100644 index fb6bd30243..0000000000 --- a/package/kernel/mac80211/patches/319-mac80211-avoid-extra-memcpy-in-A-MSDU-head-creation.patch +++ /dev/null @@ -1,55 +0,0 @@ -From: Michael Braun -Date: Sat, 15 Oct 2016 13:28:18 +0200 -Subject: [PATCH] mac80211: avoid extra memcpy in A-MSDU head creation - -Signed-off-by: Michael Braun -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -3069,11 +3069,11 @@ static bool ieee80211_amsdu_prepare_head - struct ieee80211_local *local = sdata->local; - struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); - struct ieee80211_hdr *hdr; -- struct ethhdr amsdu_hdr; -+ struct ethhdr *amsdu_hdr; - int hdr_len = fast_tx->hdr_len - sizeof(rfc1042_header); - int subframe_len = skb->len - hdr_len; - void *data; -- u8 *qc; -+ u8 *qc, *h_80211_src, *h_80211_dst; - - if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) - return false; -@@ -3081,19 +3081,22 @@ static bool ieee80211_amsdu_prepare_head - if (info->control.flags & IEEE80211_TX_CTRL_AMSDU) - return true; - -- if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(amsdu_hdr), -+ if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(*amsdu_hdr), - &subframe_len)) - return false; - -- amsdu_hdr.h_proto = cpu_to_be16(subframe_len); -- memcpy(amsdu_hdr.h_source, skb->data + fast_tx->sa_offs, ETH_ALEN); -- memcpy(amsdu_hdr.h_dest, skb->data + fast_tx->da_offs, ETH_ALEN); -+ data = skb_push(skb, sizeof(*amsdu_hdr)); -+ memmove(data, data + sizeof(*amsdu_hdr), hdr_len); -+ hdr = data; -+ amsdu_hdr = data + hdr_len; -+ /* h_80211_src/dst is addr* field within hdr */ -+ h_80211_src = data + fast_tx->sa_offs; -+ h_80211_dst = data + fast_tx->da_offs; - -- data = skb_push(skb, sizeof(amsdu_hdr)); -- memmove(data, data + sizeof(amsdu_hdr), hdr_len); -- memcpy(data + hdr_len, &amsdu_hdr, sizeof(amsdu_hdr)); -+ amsdu_hdr->h_proto = cpu_to_be16(subframe_len); -+ ether_addr_copy(amsdu_hdr->h_source, h_80211_src); -+ ether_addr_copy(amsdu_hdr->h_dest, h_80211_dst); - -- hdr = data; - qc = ieee80211_get_qos_ctl(hdr); - *qc |= IEEE80211_QOS_CTL_A_MSDU_PRESENT; - diff --git a/package/kernel/mac80211/patches/320-ath9k-clean-up-and-fix-ath_tx_count_airtime.patch b/package/kernel/mac80211/patches/320-ath9k-clean-up-and-fix-ath_tx_count_airtime.patch new file mode 100644 index 0000000000..a6a3bfca6d --- /dev/null +++ b/package/kernel/mac80211/patches/320-ath9k-clean-up-and-fix-ath_tx_count_airtime.patch @@ -0,0 +1,107 @@ +From: Felix Fietkau +Date: Sun, 12 Feb 2017 13:13:05 +0100 +Subject: [PATCH] ath9k: clean up and fix ath_tx_count_airtime + +ath_tx_count_airtime is doing a lot of unnecessary work: + +- Redundant station lookup +- Redundant rcu_read_lock/unlock +- Useless memcpy of bf->rates +- Useless NULL check of bf->bf_mpdu +- Redundant lookup of the skb tid + +Additionally, it tries to look up the mac80211 queue index from the txq, +which fails if the frame was delivered via the power save queue. + +This patch fixes all of these issues by passing down the right set of +pointers instead of doing extra work + +Cc: stable@vger.kernel.org +Fixes: 63fefa050477 ("ath9k: Introduce airtime fairness scheduling between stations") +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/wireless/ath/ath9k/xmit.c ++++ b/drivers/net/wireless/ath/ath9k/xmit.c +@@ -723,51 +723,31 @@ static bool bf_is_ampdu_not_probing(stru + return bf_isampdu(bf) && !(info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE); + } + +-static void ath_tx_count_airtime(struct ath_softc *sc, struct ath_txq *txq, +- struct ath_buf *bf, struct ath_tx_status *ts) ++static void ath_tx_count_airtime(struct ath_softc *sc, struct ath_node *an, ++ struct ath_atx_tid *tid, struct ath_buf *bf, ++ struct ath_tx_status *ts) + { +- struct ath_node *an; +- struct ath_acq *acq = &sc->cur_chan->acq[txq->mac80211_qnum]; +- struct sk_buff *skb; +- struct ieee80211_hdr *hdr; +- struct ieee80211_hw *hw = sc->hw; +- struct ieee80211_tx_rate rates[4]; +- struct ieee80211_sta *sta; +- int i; ++ struct ath_txq *txq = tid->txq; + u32 airtime = 0; +- +- skb = bf->bf_mpdu; +- if(!skb) +- return; +- +- hdr = (struct ieee80211_hdr *)skb->data; +- memcpy(rates, bf->rates, sizeof(rates)); +- +- rcu_read_lock(); +- +- sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr1, hdr->addr2); +- if(!sta) +- goto exit; +- +- +- an = (struct ath_node *) sta->drv_priv; ++ int i; + + airtime += ts->duration * (ts->ts_longretry + 1); ++ for(i = 0; i < ts->ts_rateindex; i++) { ++ int rate_dur = ath9k_hw_get_duration(sc->sc_ah, bf->bf_desc, i); ++ airtime += rate_dur * bf->rates[i].count; ++ } + +- for(i=0; i < ts->ts_rateindex; i++) +- airtime += ath9k_hw_get_duration(sc->sc_ah, bf->bf_desc, i) * rates[i].count; ++ if (sc->airtime_flags & AIRTIME_USE_TX) { ++ int q = txq->mac80211_qnum; ++ struct ath_acq *acq = &sc->cur_chan->acq[q]; + +- if (!!(sc->airtime_flags & AIRTIME_USE_TX)) { + spin_lock_bh(&acq->lock); +- an->airtime_deficit[txq->mac80211_qnum] -= airtime; +- if (an->airtime_deficit[txq->mac80211_qnum] <= 0) +- __ath_tx_queue_tid(sc, ath_get_skb_tid(sc, an, skb)); ++ an->airtime_deficit[q] -= airtime; ++ if (an->airtime_deficit[q] <= 0) ++ __ath_tx_queue_tid(sc, tid); + spin_unlock_bh(&acq->lock); + } + ath_debug_airtime(sc, an, 0, airtime); +- +-exit: +- rcu_read_unlock(); + } + + static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq, +@@ -791,13 +771,13 @@ static void ath_tx_process_buffer(struct + + ts->duration = ath9k_hw_get_duration(sc->sc_ah, bf->bf_desc, + ts->ts_rateindex); +- ath_tx_count_airtime(sc, txq, bf, ts); + + hdr = (struct ieee80211_hdr *) bf->bf_mpdu->data; + sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr1, hdr->addr2); + if (sta) { + struct ath_node *an = (struct ath_node *)sta->drv_priv; + tid = ath_get_skb_tid(sc, an, bf->bf_mpdu); ++ ath_tx_count_airtime(sc, an, tid, bf, ts); + if (ts->ts_status & (ATH9K_TXERR_FILT | ATH9K_TXERR_XRETRY)) + tid->clear_ps_filter = true; + } diff --git a/package/kernel/mac80211/patches/320-mac80211-fix-A-MSDU-outer-SA-DA.patch b/package/kernel/mac80211/patches/320-mac80211-fix-A-MSDU-outer-SA-DA.patch deleted file mode 100644 index 7700254cd1..0000000000 --- a/package/kernel/mac80211/patches/320-mac80211-fix-A-MSDU-outer-SA-DA.patch +++ /dev/null @@ -1,73 +0,0 @@ -From: Michael Braun -Date: Sat, 15 Oct 2016 13:28:19 +0200 -Subject: [PATCH] mac80211: fix A-MSDU outer SA/DA - -According to IEEE 802.11-2012 section 8.3.2 table 8-19, the outer SA/DA -of A-MSDU frames need to be changed depending on FromDS/ToDS values. - -Signed-off-by: Michael Braun -[use ether_addr_copy and add alignment annotations] -Signed-off-by: Johannes Berg ---- - ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -1438,7 +1438,7 @@ enum ieee80211_vif_flags { - struct ieee80211_vif { - enum nl80211_iftype type; - struct ieee80211_bss_conf bss_conf; -- u8 addr[ETH_ALEN]; -+ u8 addr[ETH_ALEN] __aligned(2); - bool p2p; - bool csa_active; - bool mu_mimo_owner; ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -443,7 +443,7 @@ struct ieee80211_if_managed { - struct ieee80211_mgd_auth_data *auth_data; - struct ieee80211_mgd_assoc_data *assoc_data; - -- u8 bssid[ETH_ALEN]; -+ u8 bssid[ETH_ALEN] __aligned(2); - - u16 aid; - ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -3074,6 +3074,7 @@ static bool ieee80211_amsdu_prepare_head - int subframe_len = skb->len - hdr_len; - void *data; - u8 *qc, *h_80211_src, *h_80211_dst; -+ const u8 *bssid; - - if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) - return false; -@@ -3097,6 +3098,28 @@ static bool ieee80211_amsdu_prepare_head - ether_addr_copy(amsdu_hdr->h_source, h_80211_src); - ether_addr_copy(amsdu_hdr->h_dest, h_80211_dst); - -+ /* according to IEEE 802.11-2012 8.3.2 table 8-19, the outer SA/DA -+ * fields needs to be changed to BSSID for A-MSDU frames depending -+ * on FromDS/ToDS values. -+ */ -+ switch (sdata->vif.type) { -+ case NL80211_IFTYPE_STATION: -+ bssid = sdata->u.mgd.bssid; -+ break; -+ case NL80211_IFTYPE_AP: -+ case NL80211_IFTYPE_AP_VLAN: -+ bssid = sdata->vif.addr; -+ break; -+ default: -+ bssid = NULL; -+ } -+ -+ if (bssid && ieee80211_has_fromds(hdr->frame_control)) -+ ether_addr_copy(h_80211_src, bssid); -+ -+ if (bssid && ieee80211_has_tods(hdr->frame_control)) -+ ether_addr_copy(h_80211_dst, bssid); -+ - qc = ieee80211_get_qos_ctl(hdr); - *qc |= IEEE80211_QOS_CTL_A_MSDU_PRESENT; - diff --git a/package/kernel/mac80211/patches/321-Revert-mac80211-allow-using-AP_LINK_PS-with-mac80211.patch b/package/kernel/mac80211/patches/321-Revert-mac80211-allow-using-AP_LINK_PS-with-mac80211.patch deleted file mode 100644 index ace20e706b..0000000000 --- a/package/kernel/mac80211/patches/321-Revert-mac80211-allow-using-AP_LINK_PS-with-mac80211.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Felix Fietkau -Date: Thu, 3 Nov 2016 12:10:34 +0100 -Subject: [PATCH] Revert "mac80211: allow using AP_LINK_PS with - mac80211-generated TIM IE" - -This reverts commit c68df2e7be0c1238ea3c281fd744a204ef3b15a0. - -__sta_info_recalc_tim turns into a no-op if local->ops->set_tim is not -set. This prevents the beacon TIM bit from being set for all drivers -that do not implement this op (almost all of them), thus thoroughly -essential AP mode powersave functionality. - -Cc: Emmanuel Grumbach -Fixes: c68df2e7be0c ("mac80211: allow using AP_LINK_PS with mac80211-generated TIM IE") -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/sta_info.c -+++ b/net/mac80211/sta_info.c -@@ -688,7 +688,7 @@ static void __sta_info_recalc_tim(struct - } - - /* No need to do anything if the driver does all */ -- if (!local->ops->set_tim) -+ if (ieee80211_hw_check(&local->hw, AP_LINK_PS)) - return; - - if (sta->dead) diff --git a/package/kernel/mac80211/patches/321-mac80211-fix-CSA-in-IBSS-mode.patch b/package/kernel/mac80211/patches/321-mac80211-fix-CSA-in-IBSS-mode.patch new file mode 100644 index 0000000000..13765b2900 --- /dev/null +++ b/package/kernel/mac80211/patches/321-mac80211-fix-CSA-in-IBSS-mode.patch @@ -0,0 +1,34 @@ +From: Koen Vandeputte +Date: Wed, 8 Feb 2017 15:29:45 +0100 +Subject: [PATCH] mac80211: fix CSA in IBSS mode +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add the missing IBSS capability flag during capability init as it needs +to be inserted into the generated beacon in order for CSA to work. + +Signed-off-by: Piotr Gawlowicz +Signed-off-by: Mikołaj Chwalisz +Tested-by: Koen Vandeputte +--- + +--- a/net/mac80211/ibss.c ++++ b/net/mac80211/ibss.c +@@ -487,14 +487,14 @@ int ieee80211_ibss_csa_beacon(struct iee + struct beacon_data *presp, *old_presp; + struct cfg80211_bss *cbss; + const struct cfg80211_bss_ies *ies; +- u16 capability = 0; ++ u16 capability = WLAN_CAPABILITY_IBSS; + u64 tsf; + int ret = 0; + + sdata_assert_lock(sdata); + + if (ifibss->privacy) +- capability = WLAN_CAPABILITY_PRIVACY; ++ capability |= WLAN_CAPABILITY_PRIVACY; + + cbss = cfg80211_get_bss(sdata->local->hw.wiphy, ifibss->chandef.chan, + ifibss->bssid, ifibss->ssid, diff --git a/package/kernel/mac80211/patches/322-mac80211-don-t-handle-filtered-frames-within-a-BA-se.patch b/package/kernel/mac80211/patches/322-mac80211-don-t-handle-filtered-frames-within-a-BA-se.patch new file mode 100644 index 0000000000..66e1bfb4c1 --- /dev/null +++ b/package/kernel/mac80211/patches/322-mac80211-don-t-handle-filtered-frames-within-a-BA-se.patch @@ -0,0 +1,28 @@ +From: Felix Fietkau +Date: Wed, 22 Feb 2017 16:13:17 +0100 +Subject: [PATCH] mac80211: don't handle filtered frames within a BA session + +When running a BA session, the driver (or the hardware) already takes +care of retransmitting failed frames, since it has to keep the receiver +reorder window in sync. + +Adding another layer of retransmit around that does not improve +anything. In fact, it can only lead to some strong reordering with huge +latency. + +Cc: stable@vger.kernel.org +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/status.c ++++ b/net/mac80211/status.c +@@ -51,7 +51,8 @@ static void ieee80211_handle_filtered_fr + struct ieee80211_hdr *hdr = (void *)skb->data; + int ac; + +- if (info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER) { ++ if (info->flags & (IEEE80211_TX_CTL_NO_PS_BUFFER | ++ IEEE80211_TX_CTL_AMPDU)) { + ieee80211_free_txskb(&local->hw, skb); + return; + } diff --git a/package/kernel/mac80211/patches/322-mac80211-update-A-MPDU-flag-on-tx-dequeue.patch b/package/kernel/mac80211/patches/322-mac80211-update-A-MPDU-flag-on-tx-dequeue.patch deleted file mode 100644 index 1898d23584..0000000000 --- a/package/kernel/mac80211/patches/322-mac80211-update-A-MPDU-flag-on-tx-dequeue.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Felix Fietkau -Date: Fri, 4 Nov 2016 10:13:34 +0100 -Subject: [PATCH] mac80211: update A-MPDU flag on tx dequeue - -The sequence number counter is used to derive the starting sequence -number. Since that counter is updated on tx dequeue, the A-MPDU flag -needs to be up to date at the tme of dequeue as well. - -This patch prevents sending more A-MPDU frames after the session has -been terminated and also ensures that aggregation starts right after the -session has been established - -Fixes: bb42f2d13ffc ("mac80211: Move reorder-sensitive TX handlers to after TXQ dequeue") -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -3462,6 +3462,11 @@ begin: - goto begin; - } - -+ if (test_bit(IEEE80211_TXQ_AMPDU, &txqi->flags)) -+ info->flags |= IEEE80211_TX_CTL_AMPDU; -+ else -+ info->flags &= ~IEEE80211_TX_CTL_AMPDU; -+ - if (info->control.flags & IEEE80211_TX_CTRL_FAST_XMIT) { - struct sta_info *sta = container_of(txq->sta, struct sta_info, - sta); diff --git a/package/kernel/mac80211/patches/323-mac80211-remove-bogus-skb-vif-assignment.patch b/package/kernel/mac80211/patches/323-mac80211-remove-bogus-skb-vif-assignment.patch deleted file mode 100644 index 66449aca2b..0000000000 --- a/package/kernel/mac80211/patches/323-mac80211-remove-bogus-skb-vif-assignment.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Felix Fietkau -Date: Fri, 4 Nov 2016 10:17:38 +0100 -Subject: [PATCH] mac80211: remove bogus skb vif assignment - -The call to ieee80211_txq_enqueue overwrites the vif pointer with the -codel enqueue time, so setting it just before that call makes no sense. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -1500,7 +1500,6 @@ static bool ieee80211_queue_skb(struct i - struct sta_info *sta, - struct sk_buff *skb) - { -- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); - struct fq *fq = &local->fq; - struct ieee80211_vif *vif; - struct txq_info *txqi; -@@ -1525,8 +1524,6 @@ static bool ieee80211_queue_skb(struct i - if (!txqi) - return false; - -- info->control.vif = vif; -- - spin_lock_bh(&fq->lock); - ieee80211_txq_enqueue(local, txqi, skb); - spin_unlock_bh(&fq->lock); diff --git a/package/kernel/mac80211/patches/324-mac80211-fix-A-MSDU-aggregation-with-fast-xmit-txq.patch b/package/kernel/mac80211/patches/324-mac80211-fix-A-MSDU-aggregation-with-fast-xmit-txq.patch deleted file mode 100644 index 579f112f71..0000000000 --- a/package/kernel/mac80211/patches/324-mac80211-fix-A-MSDU-aggregation-with-fast-xmit-txq.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Felix Fietkau -Date: Fri, 4 Nov 2016 10:18:51 +0100 -Subject: [PATCH] mac80211: fix A-MSDU aggregation with fast-xmit + txq - -A-MSDU aggregation alters the QoS header after a frame has been -enqueued, so it needs to be ready before enqueue and not overwritten -again afterwards - -Fixes: bb42f2d13ffc ("mac80211: Move reorder-sensitive TX handlers to after TXQ dequeue") -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -3245,7 +3245,6 @@ static void ieee80211_xmit_fast_finish(s - - if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) { - tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; -- *ieee80211_get_qos_ctl(hdr) = tid; - hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid); - } else { - info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ; -@@ -3370,6 +3369,11 @@ static bool ieee80211_xmit_fast(struct i - (tid_tx ? IEEE80211_TX_CTL_AMPDU : 0); - info->control.flags = IEEE80211_TX_CTRL_FAST_XMIT; - -+ if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) { -+ tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; -+ *ieee80211_get_qos_ctl(hdr) = tid; -+ } -+ - __skb_queue_head_init(&tx.skbs); - - tx.flags = IEEE80211_TX_UNICAST; diff --git a/package/kernel/mac80211/patches/325-ath9k-fix-ath9k_hw_gpio_get-to-return-0-or-1-on-succ.patch b/package/kernel/mac80211/patches/325-ath9k-fix-ath9k_hw_gpio_get-to-return-0-or-1-on-succ.patch deleted file mode 100644 index 012a49de9b..0000000000 --- a/package/kernel/mac80211/patches/325-ath9k-fix-ath9k_hw_gpio_get-to-return-0-or-1-on-succ.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Matthias Schiffer -Date: Tue, 15 Nov 2016 16:08:29 +0100 -Subject: [PATCH] ath9k: fix ath9k_hw_gpio_get() to return 0 or 1 on success - -Commit b2d70d4944c1 ("ath9k: make GPIO API to support both of WMAC and -SOC") refactored ath9k_hw_gpio_get() to support both WMAC and SOC GPIOs, -changing the return on success from 1 to BIT(gpio). This broke some callers -like ath_is_rfkill_set(). - -Instead of fixing all callers, change ath9k_hw_gpio_get() back to only -return 0 or 1. - -Fixes: b2d70d4944c1 ("ath9k: make GPIO API to support both of WMAC and SOC") -Signed-off-by: Matthias Schiffer ---- - drivers/net/wireless/ath/ath9k/hw.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/net/wireless/ath/ath9k/hw.c -+++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -2813,7 +2813,7 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah, - WARN_ON(1); - } - -- return val; -+ return !!val; - } - EXPORT_SYMBOL(ath9k_hw_gpio_get); - diff --git a/package/kernel/mac80211/patches/326-Documentation-dt-net-add-ath9k-wireless-device-bindi.patch b/package/kernel/mac80211/patches/326-Documentation-dt-net-add-ath9k-wireless-device-bindi.patch deleted file mode 100644 index 72a459c9e6..0000000000 --- a/package/kernel/mac80211/patches/326-Documentation-dt-net-add-ath9k-wireless-device-bindi.patch +++ /dev/null @@ -1,67 +0,0 @@ -From b263e0bb9d4585ca3ec04d7257ca5308d21333bb Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Sun, 16 Oct 2016 22:59:05 +0200 -Subject: [PATCH 1/3] Documentation: dt: net: add ath9k wireless device binding - -Add documentation how devicetree can be used to configure ath9k based -devices. - -Signed-off-by: Martin Blumenstingl -Acked-by: Rob Herring -Signed-off-by: Kalle Valo ---- - .../devicetree/bindings/net/wireless/qca,ath9k.txt | 48 ++++++++++++++++++++++ - 1 file changed, 48 insertions(+) - create mode 100644 Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt - ---- /dev/null -+++ b/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt -@@ -0,0 +1,48 @@ -+* Qualcomm Atheros ath9k wireless devices -+ -+This node provides properties for configuring the ath9k wireless device. The -+node is expected to be specified as a child node of the PCI controller to -+which the wireless chip is connected. -+ -+Required properties: -+- compatible: For PCI and PCIe devices this should be an identifier following -+ the format as defined in "PCI Bus Binding to Open Firmware" -+ Revision 2.1. One of the possible formats is "pciVVVV,DDDD" -+ where VVVV is the PCI vendor ID and DDDD is PCI device ID. -+ Typically QCA's PCI vendor ID 168c is used while the PCI device -+ ID depends on the chipset - see the following (possibly -+ incomplete) list: -+ - 0023 for AR5416 -+ - 0024 for AR5418 -+ - 0027 for AR9160 -+ - 0029 for AR9220 and AR9223 -+ - 002a for AR9280 and AR9283 -+ - 002b for AR9285 -+ - 002c for AR2427 -+ - 002d for AR9227 -+ - 002e for AR9287 -+ - 0030 for AR9380, AR9381 and AR9382 -+ - 0032 for AR9485 -+ - 0033 for AR9580 and AR9590 -+ - 0034 for AR9462 -+ - 0036 for AR9565 -+ - 0037 for AR9485 -+- reg: Address and length of the register set for the device. -+ -+Optional properties: -+- qca,no-eeprom: Indicates that there is no physical EEPROM connected to the -+ ath9k wireless chip (in this case the calibration / -+ EEPROM data will be loaded from userspace using the -+ kernel firmware loader). -+- mac-address: See ethernet.txt in the parent directory -+- local-mac-address: See ethernet.txt in the parent directory -+ -+ -+In this example, the node is defined as child node of the PCI controller: -+&pci0 { -+ wifi@168c,002d { -+ compatible = "pci168c,002d"; -+ reg = <0x7000 0 0 0 0x1000>; -+ qca,no-eeprom; -+ }; -+}; diff --git a/package/kernel/mac80211/patches/327-ath9k-add-a-helper-to-get-the-string-representation-.patch b/package/kernel/mac80211/patches/327-ath9k-add-a-helper-to-get-the-string-representation-.patch deleted file mode 100644 index c191495b84..0000000000 --- a/package/kernel/mac80211/patches/327-ath9k-add-a-helper-to-get-the-string-representation-.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 25b8b2d57def4854558c135228a52326a7d346ad Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Sun, 16 Oct 2016 22:59:06 +0200 -Subject: [PATCH 2/3] ath9k: add a helper to get the string representation of - ath_bus_type - -This can be used when the ath_bus_type has to be presented in a log -message or firmware filename. - -Signed-off-by: Martin Blumenstingl -Signed-off-by: Kalle Valo ---- - drivers/net/wireless/ath/ath.h | 6 ++++++ - drivers/net/wireless/ath/main.c | 7 +++++++ - 2 files changed, 13 insertions(+) - ---- a/drivers/net/wireless/ath/ath.h -+++ b/drivers/net/wireless/ath/ath.h -@@ -327,4 +327,10 @@ static inline const char *ath_opmode_to_ - } - #endif - -+extern const char *ath_bus_type_strings[]; -+static inline const char *ath_bus_type_to_string(enum ath_bus_type bustype) -+{ -+ return ath_bus_type_strings[bustype]; -+} -+ - #endif /* ATH_H */ ---- a/drivers/net/wireless/ath/main.c -+++ b/drivers/net/wireless/ath/main.c -@@ -90,3 +90,10 @@ void ath_printk(const char *level, const - va_end(args); - } - EXPORT_SYMBOL(ath_printk); -+ -+const char *ath_bus_type_strings[] = { -+ [ATH_PCI] = "pci", -+ [ATH_AHB] = "ahb", -+ [ATH_USB] = "usb", -+}; -+EXPORT_SYMBOL(ath_bus_type_strings); diff --git a/package/kernel/mac80211/patches/328-ath9k-parse-the-device-configuration-from-an-OF-node.patch b/package/kernel/mac80211/patches/328-ath9k-parse-the-device-configuration-from-an-OF-node.patch deleted file mode 100644 index b260858d45..0000000000 --- a/package/kernel/mac80211/patches/328-ath9k-parse-the-device-configuration-from-an-OF-node.patch +++ /dev/null @@ -1,85 +0,0 @@ -From cea03be5a848823cb8052e2e7b93cb2249d5f60c Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Sun, 16 Oct 2016 22:59:07 +0200 -Subject: [PATCH 3/3] ath9k: parse the device configuration from an OF node - -This allows setting the MAC address and specifying that the firmware -will be requested from userspace (because there might not be a hardware -EEPROM connected to the chip) for ath9k based PCI devices using -the device tree. - -There is some out-of-tree code to "convert devicetree to -ath9k_platform_data" (for example in OpenWrt and LEDE) which becomes -obsolete with this patch. - -Signed-off-by: Martin Blumenstingl -Signed-off-by: Kalle Valo ---- - drivers/net/wireless/ath/ath9k/init.c | 42 +++++++++++++++++++++++++++++++++++ - 1 file changed, 42 insertions(+) - ---- a/drivers/net/wireless/ath/ath9k/init.c -+++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -20,6 +20,8 @@ - #include - #include - #include -+#include -+#include - #include - #include - -@@ -554,6 +556,42 @@ static int ath9k_init_platform(struct at - return 0; - } - -+static int ath9k_of_init(struct ath_softc *sc) -+{ -+ struct device_node *np = sc->dev->of_node; -+ struct ath_hw *ah = sc->sc_ah; -+ struct ath_common *common = ath9k_hw_common(ah); -+ enum ath_bus_type bus_type = common->bus_ops->ath_bus_type; -+ const char *mac; -+ char eeprom_name[100]; -+ int ret; -+ -+ if (!of_device_is_available(np)) -+ return 0; -+ -+ ath_dbg(common, CONFIG, "parsing configuration from OF node\n"); -+ -+ if (of_property_read_bool(np, "qca,no-eeprom")) { -+ /* ath9k-eeprom--.bin */ -+ scnprintf(eeprom_name, sizeof(eeprom_name), -+ "ath9k-eeprom-%s-%s.bin", -+ ath_bus_type_to_string(bus_type), dev_name(ah->dev)); -+ -+ ret = ath9k_eeprom_request(sc, eeprom_name); -+ if (ret) -+ return ret; -+ } -+ -+ mac = of_get_mac_address(np); -+ if (mac) -+ ether_addr_copy(common->macaddr, mac); -+ -+ ah->ah_flags &= ~AH_USE_EEPROM; -+ ah->ah_flags |= AH_NO_EEP_SWAP; -+ -+ return 0; -+} -+ - static int ath9k_init_softc(u16 devid, struct ath_softc *sc, - const struct ath_bus_ops *bus_ops) - { -@@ -610,6 +648,10 @@ static int ath9k_init_softc(u16 devid, s - if (ret) - return ret; - -+ ret = ath9k_of_init(sc); -+ if (ret) -+ return ret; -+ - if (ath9k_led_active_high != -1) - ah->config.led_active_high = ath9k_led_active_high == 1; - diff --git a/package/kernel/mac80211/patches/329-ath9k-unlock-rcu-read-when-returning-early.patch b/package/kernel/mac80211/patches/329-ath9k-unlock-rcu-read-when-returning-early.patch deleted file mode 100644 index b8ba355899..0000000000 --- a/package/kernel/mac80211/patches/329-ath9k-unlock-rcu-read-when-returning-early.patch +++ /dev/null @@ -1,65 +0,0 @@ -From: Tobias Klausmann -Date: Mon, 12 Dec 2016 19:50:01 +0100 -Subject: [PATCH] ath9k: unlock rcu read when returning early - -Starting with ath9k: use ieee80211_tx_status_noskb where possible -[d94a461d7a7df68991fb9663531173f60ef89c68] the driver uses rcu_read_lock() && -rcu_read_unlock() yet on returning early in ath_tx_edma_tasklet() the unlock is -missing leading to stalls and suspicious RCU usage: - - =============================== - [ INFO: suspicious RCU usage. ] - 4.9.0-rc8 #11 Not tainted - ------------------------------- - kernel/rcu/tree.c:705 Illegal idle entry in RCU read-side critical section.! - - other info that might help us debug this: - - RCU used illegally from idle CPU! - rcu_scheduler_active = 1, debug_locks = 0 - RCU used illegally from extended quiescent state! - 1 lock held by swapper/7/0: - #0: - ( - rcu_read_lock - ){......} - , at: - [] ath_tx_edma_tasklet+0x0/0x450 [ath9k] - - stack backtrace: - CPU: 7 PID: 0 Comm: swapper/7 Not tainted 4.9.0-rc8 #11 - Hardware name: Acer Aspire V3-571G/VA50_HC_CR, BIOS V2.21 12/16/2013 - ffff88025efc3f38 ffffffff8132b1e5 ffff88017ede4540 0000000000000001 - ffff88025efc3f68 ffffffff810a25f7 ffff88025efcee60 ffff88017edebdd8 - ffff88025eeb5400 0000000000000091 ffff88025efc3f88 ffffffff810c3cd4 - Call Trace: - - [] dump_stack+0x68/0x93 - [] lockdep_rcu_suspicious+0xd7/0x110 - [] rcu_eqs_enter_common.constprop.85+0x154/0x200 - [] rcu_irq_exit+0x44/0xa0 - [] irq_exit+0x61/0xd0 - [] do_IRQ+0x65/0x110 - [] common_interrupt+0x89/0x89 - - [] ? cpuidle_enter_state+0x151/0x200 - [] cpuidle_enter+0x12/0x20 - [] call_cpuidle+0x1e/0x40 - [] cpu_startup_entry+0x146/0x220 - [] start_secondary+0x148/0x170 - -Signed-off-by: Tobias Klausmann -Signed-off-by: Felix Fietkau ---- - ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -2757,7 +2757,7 @@ void ath_tx_edma_tasklet(struct ath_soft - fifo_list = &txq->txq_fifo[txq->txq_tailidx]; - if (list_empty(fifo_list)) { - ath_txq_unlock(sc, txq); -- return; -+ break; - } - - bf = list_first_entry(fifo_list, struct ath_buf, list); diff --git a/package/kernel/mac80211/patches/334-mac80211-minstrel_ht-move-supported-bitrate-mask-out.patch b/package/kernel/mac80211/patches/334-mac80211-minstrel_ht-move-supported-bitrate-mask-out.patch deleted file mode 100644 index 5e5992e6b4..0000000000 --- a/package/kernel/mac80211/patches/334-mac80211-minstrel_ht-move-supported-bitrate-mask-out.patch +++ /dev/null @@ -1,196 +0,0 @@ -From: Felix Fietkau -Date: Wed, 14 Dec 2016 19:33:23 +0100 -Subject: [PATCH] mac80211: minstrel_ht: move supported bitrate mask out of - group data - -Improves dcache footprint by ensuring that fewer cache lines need to be -touched. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/rc80211_minstrel_ht.c -+++ b/net/mac80211/rc80211_minstrel_ht.c -@@ -301,7 +301,7 @@ minstrel_ht_get_stats(struct minstrel_pr - break; - - /* short preamble */ -- if (!(mi->groups[group].supported & BIT(idx))) -+ if (!(mi->supported[group] & BIT(idx))) - idx += 4; - } - return &mi->groups[group].rates[idx]; -@@ -486,7 +486,7 @@ minstrel_ht_prob_rate_reduce_streams(str - MCS_GROUP_RATES].streams; - for (group = 0; group < ARRAY_SIZE(minstrel_mcs_groups); group++) { - mg = &mi->groups[group]; -- if (!mg->supported || group == MINSTREL_CCK_GROUP) -+ if (!mi->supported[group] || group == MINSTREL_CCK_GROUP) - continue; - - tmp_idx = mg->max_group_prob_rate % MCS_GROUP_RATES; -@@ -540,7 +540,7 @@ minstrel_ht_update_stats(struct minstrel - for (group = 0; group < ARRAY_SIZE(minstrel_mcs_groups); group++) { - - mg = &mi->groups[group]; -- if (!mg->supported) -+ if (!mi->supported[group]) - continue; - - mi->sample_count++; -@@ -550,7 +550,7 @@ minstrel_ht_update_stats(struct minstrel - tmp_group_tp_rate[j] = group; - - for (i = 0; i < MCS_GROUP_RATES; i++) { -- if (!(mg->supported & BIT(i))) -+ if (!(mi->supported[group] & BIT(i))) - continue; - - index = MCS_GROUP_RATES * group + i; -@@ -636,7 +636,7 @@ minstrel_set_next_sample_idx(struct mins - mi->sample_group %= ARRAY_SIZE(minstrel_mcs_groups); - mg = &mi->groups[mi->sample_group]; - -- if (!mg->supported) -+ if (!mi->supported[mi->sample_group]) - continue; - - if (++mg->index >= MCS_GROUP_RATES) { -@@ -657,7 +657,7 @@ minstrel_downgrade_rate(struct minstrel_ - while (group > 0) { - group--; - -- if (!mi->groups[group].supported) -+ if (!mi->supported[group]) - continue; - - if (minstrel_mcs_groups[group].streams > -@@ -994,7 +994,7 @@ minstrel_get_sample_rate(struct minstrel - sample_idx = sample_table[mg->column][mg->index]; - minstrel_set_next_sample_idx(mi); - -- if (!(mg->supported & BIT(sample_idx))) -+ if (!(mi->supported[sample_group] & BIT(sample_idx))) - return -1; - - mrs = &mg->rates[sample_idx]; -@@ -1052,7 +1052,7 @@ static void - minstrel_ht_check_cck_shortpreamble(struct minstrel_priv *mp, - struct minstrel_ht_sta *mi, bool val) - { -- u8 supported = mi->groups[MINSTREL_CCK_GROUP].supported; -+ u8 supported = mi->supported[MINSTREL_CCK_GROUP]; - - if (!supported || !mi->cck_supported_short) - return; -@@ -1061,7 +1061,7 @@ minstrel_ht_check_cck_shortpreamble(stru - return; - - supported ^= mi->cck_supported_short | (mi->cck_supported_short << 4); -- mi->groups[MINSTREL_CCK_GROUP].supported = supported; -+ mi->supported[MINSTREL_CCK_GROUP] = supported; - } - - static void -@@ -1154,7 +1154,7 @@ minstrel_ht_update_cck(struct minstrel_p - mi->cck_supported_short |= BIT(i); - } - -- mi->groups[MINSTREL_CCK_GROUP].supported = mi->cck_supported; -+ mi->supported[MINSTREL_CCK_GROUP] = mi->cck_supported; - } - - static void -@@ -1233,7 +1233,7 @@ minstrel_ht_update_caps(void *priv, stru - u32 gflags = minstrel_mcs_groups[i].flags; - int bw, nss; - -- mi->groups[i].supported = 0; -+ mi->supported[i] = 0; - if (i == MINSTREL_CCK_GROUP) { - minstrel_ht_update_cck(mp, mi, sband, sta); - continue; -@@ -1265,8 +1265,8 @@ minstrel_ht_update_caps(void *priv, stru - if (use_vht && minstrel_vht_only) - continue; - #endif -- mi->groups[i].supported = mcs->rx_mask[nss - 1]; -- if (mi->groups[i].supported) -+ mi->supported[i] = mcs->rx_mask[nss - 1]; -+ if (mi->supported[i]) - n_supported++; - continue; - } -@@ -1292,10 +1292,10 @@ minstrel_ht_update_caps(void *priv, stru - else - bw = BW_20; - -- mi->groups[i].supported = minstrel_get_valid_vht_rates(bw, nss, -+ mi->supported[i] = minstrel_get_valid_vht_rates(bw, nss, - vht_cap->vht_mcs.tx_mcs_map); - -- if (mi->groups[i].supported) -+ if (mi->supported[i]) - n_supported++; - } - ---- a/net/mac80211/rc80211_minstrel_ht.h -+++ b/net/mac80211/rc80211_minstrel_ht.h -@@ -52,9 +52,6 @@ struct minstrel_mcs_group_data { - u8 index; - u8 column; - -- /* bitfield of supported MCS rates of this group */ -- u16 supported; -- - /* sorted rate set within a MCS group*/ - u16 max_group_tp_rate[MAX_THR_RATES]; - u16 max_group_prob_rate; -@@ -101,6 +98,9 @@ struct minstrel_ht_sta { - u8 cck_supported; - u8 cck_supported_short; - -+ /* Bitfield of supported MCS rates of all groups */ -+ u16 supported[MINSTREL_GROUPS_NB]; -+ - /* MCS rate group info and statistics */ - struct minstrel_mcs_group_data groups[MINSTREL_GROUPS_NB]; - }; ---- a/net/mac80211/rc80211_minstrel_ht_debugfs.c -+++ b/net/mac80211/rc80211_minstrel_ht_debugfs.c -@@ -24,7 +24,7 @@ minstrel_ht_stats_dump(struct minstrel_h - char gimode = 'L'; - u32 gflags; - -- if (!mi->groups[i].supported) -+ if (!mi->supported[i]) - return p; - - mg = &minstrel_mcs_groups[i]; -@@ -42,7 +42,7 @@ minstrel_ht_stats_dump(struct minstrel_h - static const int bitrates[4] = { 10, 20, 55, 110 }; - int idx = i * MCS_GROUP_RATES + j; - -- if (!(mi->groups[i].supported & BIT(j))) -+ if (!(mi->supported[i] & BIT(j))) - continue; - - if (gflags & IEEE80211_TX_RC_MCS) { -@@ -170,7 +170,7 @@ minstrel_ht_stats_csv_dump(struct minstr - char gimode = 'L'; - u32 gflags; - -- if (!mi->groups[i].supported) -+ if (!mi->supported[i]) - return p; - - mg = &minstrel_mcs_groups[i]; -@@ -188,7 +188,7 @@ minstrel_ht_stats_csv_dump(struct minstr - static const int bitrates[4] = { 10, 20, 55, 110 }; - int idx = i * MCS_GROUP_RATES + j; - -- if (!(mi->groups[i].supported & BIT(j))) -+ if (!(mi->supported[i] & BIT(j))) - continue; - - if (gflags & IEEE80211_TX_RC_MCS) { diff --git a/package/kernel/mac80211/patches/335-mac80211-minstrel_ht-move-short-preamble-check-out-o.patch b/package/kernel/mac80211/patches/335-mac80211-minstrel_ht-move-short-preamble-check-out-o.patch deleted file mode 100644 index 7a6e8cdb91..0000000000 --- a/package/kernel/mac80211/patches/335-mac80211-minstrel_ht-move-short-preamble-check-out-o.patch +++ /dev/null @@ -1,70 +0,0 @@ -From: Felix Fietkau -Date: Wed, 14 Dec 2016 20:06:08 +0100 -Subject: [PATCH] mac80211: minstrel_ht: move short preamble check out of - get_rate - -Test short preamble support in minstrel_ht_update_caps instead of -looking at the per-packet flag. Makes the code more efficient. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/rc80211_minstrel_ht.c -+++ b/net/mac80211/rc80211_minstrel_ht.c -@@ -14,6 +14,7 @@ - #include - #include - #include "rate.h" -+#include "sta_info.h" - #include "rc80211_minstrel.h" - #include "rc80211_minstrel_ht.h" - -@@ -1049,22 +1050,6 @@ minstrel_get_sample_rate(struct minstrel - } - - static void --minstrel_ht_check_cck_shortpreamble(struct minstrel_priv *mp, -- struct minstrel_ht_sta *mi, bool val) --{ -- u8 supported = mi->supported[MINSTREL_CCK_GROUP]; -- -- if (!supported || !mi->cck_supported_short) -- return; -- -- if (supported & (mi->cck_supported_short << (val * 4))) -- return; -- -- supported ^= mi->cck_supported_short | (mi->cck_supported_short << 4); -- mi->supported[MINSTREL_CCK_GROUP] = supported; --} -- --static void - minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, - struct ieee80211_tx_rate_control *txrc) - { -@@ -1087,7 +1072,6 @@ minstrel_ht_get_rate(void *priv, struct - minstrel_aggr_check(sta, txrc->skb); - - info->flags |= mi->tx_flags; -- minstrel_ht_check_cck_shortpreamble(mp, mi, txrc->short_preamble); - - #ifdef CPTCFG_MAC80211_DEBUGFS - if (mp->fixed_rate_idx != -1) -@@ -1168,6 +1152,7 @@ minstrel_ht_update_caps(void *priv, stru - struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs; - u16 ht_cap = sta->ht_cap.cap; - struct ieee80211_sta_vht_cap *vht_cap = &sta->vht_cap; -+ struct sta_info *sinfo = container_of(sta, struct sta_info, sta); - int use_vht; - int n_supported = 0; - int ack_dur; -@@ -1302,6 +1287,9 @@ minstrel_ht_update_caps(void *priv, stru - if (!n_supported) - goto use_legacy; - -+ if (test_sta_flag(sinfo, WLAN_STA_SHORT_PREAMBLE)) -+ mi->cck_supported_short |= mi->cck_supported_short << 4; -+ - /* create an initial rate table with the lowest supported rates */ - minstrel_ht_update_stats(mp, mi); - minstrel_ht_update_rates(mp, mi); diff --git a/package/kernel/mac80211/patches/336-mac80211-minstrel_ht-make-att_hist-and-succ_hist-u32.patch b/package/kernel/mac80211/patches/336-mac80211-minstrel_ht-make-att_hist-and-succ_hist-u32.patch deleted file mode 100644 index 40d03001c6..0000000000 --- a/package/kernel/mac80211/patches/336-mac80211-minstrel_ht-make-att_hist-and-succ_hist-u32.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Felix Fietkau -Date: Wed, 14 Dec 2016 20:09:14 +0100 -Subject: [PATCH] mac80211: minstrel_ht: make att_hist and succ_hist u32 - instead of u64 - -They are only used for debugging purposes and take a very long time to -overflow. Visibly reduces the size of the per-sta rate control data. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/rc80211_minstrel.h -+++ b/net/mac80211/rc80211_minstrel.h -@@ -59,7 +59,7 @@ struct minstrel_rate_stats { - u16 success, last_success; - - /* total attempts/success counters */ -- u64 att_hist, succ_hist; -+ u32 att_hist, succ_hist; - - /* statistis of packet delivery probability - * cur_prob - current prob within last update intervall diff --git a/package/kernel/mac80211/patches/337-mac80211-check-for-MCS-in-ieee80211_duration-before-.patch b/package/kernel/mac80211/patches/337-mac80211-check-for-MCS-in-ieee80211_duration-before-.patch deleted file mode 100644 index 066e1d1445..0000000000 --- a/package/kernel/mac80211/patches/337-mac80211-check-for-MCS-in-ieee80211_duration-before-.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Felix Fietkau -Date: Wed, 14 Dec 2016 20:12:25 +0100 -Subject: [PATCH] mac80211: check for MCS in ieee80211_duration before fetching - chanctx - -Makes the code a bit more efficient - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -63,6 +63,10 @@ static __le16 ieee80211_duration(struct - struct ieee80211_chanctx_conf *chanctx_conf; - u32 rate_flags = 0; - -+ /* assume HW handles this */ -+ if (tx->rate.flags & (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS)) -+ return 0; -+ - rcu_read_lock(); - chanctx_conf = rcu_dereference(tx->sdata->vif.chanctx_conf); - if (chanctx_conf) { -@@ -71,10 +75,6 @@ static __le16 ieee80211_duration(struct - } - rcu_read_unlock(); - -- /* assume HW handles this */ -- if (tx->rate.flags & (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS)) -- return 0; -- - /* uh huh? */ - if (WARN_ON_ONCE(tx->rate.idx < 0)) - return 0; diff --git a/package/kernel/mac80211/patches/338-mac80211-minstrel-remove-cur_prob-from-debugfs.patch b/package/kernel/mac80211/patches/338-mac80211-minstrel-remove-cur_prob-from-debugfs.patch deleted file mode 100644 index f25b0a8a8c..0000000000 --- a/package/kernel/mac80211/patches/338-mac80211-minstrel-remove-cur_prob-from-debugfs.patch +++ /dev/null @@ -1,192 +0,0 @@ -From: Felix Fietkau -Date: Wed, 14 Dec 2016 20:13:58 +0100 -Subject: [PATCH] mac80211: minstrel: remove cur_prob from debugfs - -This field is redundant, because it is simply last success divided by -last attempt count. Removing it from the rate stats struct saves about -1.2 KiB per HT station. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/rc80211_minstrel.c -+++ b/net/mac80211/rc80211_minstrel.c -@@ -159,21 +159,23 @@ minstrel_update_rates(struct minstrel_pr - void - minstrel_calc_rate_stats(struct minstrel_rate_stats *mrs) - { -+ unsigned int cur_prob; -+ - if (unlikely(mrs->attempts > 0)) { - mrs->sample_skipped = 0; -- mrs->cur_prob = MINSTREL_FRAC(mrs->success, mrs->attempts); -+ cur_prob = MINSTREL_FRAC(mrs->success, mrs->attempts); - if (unlikely(!mrs->att_hist)) { -- mrs->prob_ewma = mrs->cur_prob; -+ mrs->prob_ewma = cur_prob; - } else { - /* update exponential weighted moving variance */ - mrs->prob_ewmsd = minstrel_ewmsd(mrs->prob_ewmsd, -- mrs->cur_prob, -+ cur_prob, - mrs->prob_ewma, - EWMA_LEVEL); - - /*update exponential weighted moving avarage */ - mrs->prob_ewma = minstrel_ewma(mrs->prob_ewma, -- mrs->cur_prob, -+ cur_prob, - EWMA_LEVEL); - } - mrs->att_hist += mrs->attempts; ---- a/net/mac80211/rc80211_minstrel.h -+++ b/net/mac80211/rc80211_minstrel.h -@@ -62,10 +62,8 @@ struct minstrel_rate_stats { - u32 att_hist, succ_hist; - - /* statistis of packet delivery probability -- * cur_prob - current prob within last update intervall - * prob_ewma - exponential weighted moving average of prob - * prob_ewmsd - exp. weighted moving standard deviation of prob */ -- unsigned int cur_prob; - unsigned int prob_ewma; - u16 prob_ewmsd; - ---- a/net/mac80211/rc80211_minstrel_debugfs.c -+++ b/net/mac80211/rc80211_minstrel_debugfs.c -@@ -75,7 +75,7 @@ minstrel_stats_open(struct inode *inode, - { - struct minstrel_sta_info *mi = inode->i_private; - struct minstrel_debugfs_info *ms; -- unsigned int i, tp_max, tp_avg, prob, eprob; -+ unsigned int i, tp_max, tp_avg, eprob; - char *p; - - ms = kmalloc(2048, GFP_KERNEL); -@@ -86,9 +86,9 @@ minstrel_stats_open(struct inode *inode, - p = ms->buf; - p += sprintf(p, "\n"); - p += sprintf(p, -- "best __________rate_________ ________statistics________ ________last_______ ______sum-of________\n"); -+ "best __________rate_________ ________statistics________ ____last_____ ______sum-of________\n"); - p += sprintf(p, -- "rate [name idx airtime max_tp] [avg(tp) avg(prob) sd(prob)] [prob.|retry|suc|att] [#success | #attempts]\n"); -+ "rate [name idx airtime max_tp] [avg(tp) avg(prob) sd(prob)] [retry|suc|att] [#success | #attempts]\n"); - - for (i = 0; i < mi->n_rates; i++) { - struct minstrel_rate *mr = &mi->r[i]; -@@ -107,17 +107,15 @@ minstrel_stats_open(struct inode *inode, - - tp_max = minstrel_get_tp_avg(mr, MINSTREL_FRAC(100,100)); - tp_avg = minstrel_get_tp_avg(mr, mrs->prob_ewma); -- prob = MINSTREL_TRUNC(mrs->cur_prob * 1000); - eprob = MINSTREL_TRUNC(mrs->prob_ewma * 1000); - - p += sprintf(p, "%4u.%1u %4u.%1u %3u.%1u %3u.%1u" -- " %3u.%1u %3u %3u %-3u " -+ " %3u %3u %-3u " - "%9llu %-9llu\n", - tp_max / 10, tp_max % 10, - tp_avg / 10, tp_avg % 10, - eprob / 10, eprob % 10, - mrs->prob_ewmsd / 10, mrs->prob_ewmsd % 10, -- prob / 10, prob % 10, - mrs->retry_count, - mrs->last_success, - mrs->last_attempts, -@@ -148,7 +146,7 @@ minstrel_stats_csv_open(struct inode *in - { - struct minstrel_sta_info *mi = inode->i_private; - struct minstrel_debugfs_info *ms; -- unsigned int i, tp_max, tp_avg, prob, eprob; -+ unsigned int i, tp_max, tp_avg, eprob; - char *p; - - ms = kmalloc(2048, GFP_KERNEL); -@@ -175,16 +173,14 @@ minstrel_stats_csv_open(struct inode *in - - tp_max = minstrel_get_tp_avg(mr, MINSTREL_FRAC(100,100)); - tp_avg = minstrel_get_tp_avg(mr, mrs->prob_ewma); -- prob = MINSTREL_TRUNC(mrs->cur_prob * 1000); - eprob = MINSTREL_TRUNC(mrs->prob_ewma * 1000); - -- p += sprintf(p, "%u.%u,%u.%u,%u.%u,%u.%u,%u.%u,%u,%u,%u," -+ p += sprintf(p, "%u.%u,%u.%u,%u.%u,%u.%u,%u,%u,%u," - "%llu,%llu,%d,%d\n", - tp_max / 10, tp_max % 10, - tp_avg / 10, tp_avg % 10, - eprob / 10, eprob % 10, - mrs->prob_ewmsd / 10, mrs->prob_ewmsd % 10, -- prob / 10, prob % 10, - mrs->retry_count, - mrs->last_success, - mrs->last_attempts, ---- a/net/mac80211/rc80211_minstrel_ht_debugfs.c -+++ b/net/mac80211/rc80211_minstrel_ht_debugfs.c -@@ -19,7 +19,7 @@ static char * - minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p) - { - const struct mcs_group *mg; -- unsigned int j, tp_max, tp_avg, prob, eprob, tx_time; -+ unsigned int j, tp_max, tp_avg, eprob, tx_time; - char htmode = '2'; - char gimode = 'L'; - u32 gflags; -@@ -83,17 +83,15 @@ minstrel_ht_stats_dump(struct minstrel_h - - tp_max = minstrel_ht_get_tp_avg(mi, i, j, MINSTREL_FRAC(100, 100)); - tp_avg = minstrel_ht_get_tp_avg(mi, i, j, mrs->prob_ewma); -- prob = MINSTREL_TRUNC(mrs->cur_prob * 1000); - eprob = MINSTREL_TRUNC(mrs->prob_ewma * 1000); - - p += sprintf(p, "%4u.%1u %4u.%1u %3u.%1u %3u.%1u" -- " %3u.%1u %3u %3u %-3u " -+ " %3u %3u %-3u " - "%9llu %-9llu\n", - tp_max / 10, tp_max % 10, - tp_avg / 10, tp_avg % 10, - eprob / 10, eprob % 10, - mrs->prob_ewmsd / 10, mrs->prob_ewmsd % 10, -- prob / 10, prob % 10, - mrs->retry_count, - mrs->last_success, - mrs->last_attempts, -@@ -130,9 +128,9 @@ minstrel_ht_stats_open(struct inode *ino - - p += sprintf(p, "\n"); - p += sprintf(p, -- " best ____________rate__________ ________statistics________ ________last_______ ______sum-of________\n"); -+ " best ____________rate__________ ________statistics________ _____last____ ______sum-of________\n"); - p += sprintf(p, -- "mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob) sd(prob)] [prob.|retry|suc|att] [#success | #attempts]\n"); -+ "mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob) sd(prob)] [retry|suc|att] [#success | #attempts]\n"); - - p = minstrel_ht_stats_dump(mi, MINSTREL_CCK_GROUP, p); - for (i = 0; i < MINSTREL_CCK_GROUP; i++) -@@ -165,7 +163,7 @@ static char * - minstrel_ht_stats_csv_dump(struct minstrel_ht_sta *mi, int i, char *p) - { - const struct mcs_group *mg; -- unsigned int j, tp_max, tp_avg, prob, eprob, tx_time; -+ unsigned int j, tp_max, tp_avg, eprob, tx_time; - char htmode = '2'; - char gimode = 'L'; - u32 gflags; -@@ -226,16 +224,14 @@ minstrel_ht_stats_csv_dump(struct minstr - - tp_max = minstrel_ht_get_tp_avg(mi, i, j, MINSTREL_FRAC(100, 100)); - tp_avg = minstrel_ht_get_tp_avg(mi, i, j, mrs->prob_ewma); -- prob = MINSTREL_TRUNC(mrs->cur_prob * 1000); - eprob = MINSTREL_TRUNC(mrs->prob_ewma * 1000); - -- p += sprintf(p, "%u.%u,%u.%u,%u.%u,%u.%u,%u.%u,%u,%u," -+ p += sprintf(p, "%u.%u,%u.%u,%u.%u,%u.%u,%u,%u," - "%u,%llu,%llu,", - tp_max / 10, tp_max % 10, - tp_avg / 10, tp_avg % 10, - eprob / 10, eprob % 10, - mrs->prob_ewmsd / 10, mrs->prob_ewmsd % 10, -- prob / 10, prob % 10, - mrs->retry_count, - mrs->last_success, - mrs->last_attempts, diff --git a/package/kernel/mac80211/patches/339-mac80211-minstrel-reduce-MINSTREL_SCALE.patch b/package/kernel/mac80211/patches/339-mac80211-minstrel-reduce-MINSTREL_SCALE.patch deleted file mode 100644 index 0416cf5900..0000000000 --- a/package/kernel/mac80211/patches/339-mac80211-minstrel-reduce-MINSTREL_SCALE.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Felix Fietkau -Date: Wed, 14 Dec 2016 20:15:33 +0100 -Subject: [PATCH] mac80211: minstrel: reduce MINSTREL_SCALE - -The loss of a bit of extra precision does not hurt the calculation, 12 -bits is still enough to calculate probabilities well. Reducing the scale -makes it easier to avoid overflows - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/rc80211_minstrel.h -+++ b/net/mac80211/rc80211_minstrel.h -@@ -14,7 +14,7 @@ - #define SAMPLE_COLUMNS 10 /* number of columns in sample table */ - - /* scaled fraction values */ --#define MINSTREL_SCALE 16 -+#define MINSTREL_SCALE 12 - #define MINSTREL_FRAC(val, div) (((val) << MINSTREL_SCALE) / div) - #define MINSTREL_TRUNC(val) ((val) >> MINSTREL_SCALE) - diff --git a/package/kernel/mac80211/patches/340-mac80211-minstrel-store-probability-variance-instead.patch b/package/kernel/mac80211/patches/340-mac80211-minstrel-store-probability-variance-instead.patch deleted file mode 100644 index f679a43224..0000000000 --- a/package/kernel/mac80211/patches/340-mac80211-minstrel-store-probability-variance-instead.patch +++ /dev/null @@ -1,186 +0,0 @@ -From: Felix Fietkau -Date: Wed, 14 Dec 2016 20:17:06 +0100 -Subject: [PATCH] mac80211: minstrel: store probability variance instead of - standard deviation - -This avoids the costly int_sqrt calls in the statistics update and moves -it to the debugfs code instead. -This also fixes an overflow in the previous standard deviation -calculation. - -Signed-off-by: Thomas Huehn -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/rc80211_minstrel.c -+++ b/net/mac80211/rc80211_minstrel.c -@@ -168,10 +168,10 @@ minstrel_calc_rate_stats(struct minstrel - mrs->prob_ewma = cur_prob; - } else { - /* update exponential weighted moving variance */ -- mrs->prob_ewmsd = minstrel_ewmsd(mrs->prob_ewmsd, -- cur_prob, -- mrs->prob_ewma, -- EWMA_LEVEL); -+ mrs->prob_ewmv = minstrel_ewmv(mrs->prob_ewmv, -+ cur_prob, -+ mrs->prob_ewma, -+ EWMA_LEVEL); - - /*update exponential weighted moving avarage */ - mrs->prob_ewma = minstrel_ewma(mrs->prob_ewma, ---- a/net/mac80211/rc80211_minstrel.h -+++ b/net/mac80211/rc80211_minstrel.h -@@ -36,21 +36,16 @@ minstrel_ewma(int old, int new, int weig - } - - /* -- * Perform EWMSD (Exponentially Weighted Moving Standard Deviation) calculation -+ * Perform EWMV (Exponentially Weighted Moving Variance) calculation - */ - static inline int --minstrel_ewmsd(int old_ewmsd, int cur_prob, int prob_ewma, int weight) -+minstrel_ewmv(int old_ewmv, int cur_prob, int prob_ewma, int weight) - { -- int diff, incr, tmp_var; -+ int diff, incr; - -- /* calculate exponential weighted moving variance */ -- diff = MINSTREL_TRUNC((cur_prob - prob_ewma) * 1000000); -+ diff = cur_prob - prob_ewma; - incr = (EWMA_DIV - weight) * diff / EWMA_DIV; -- tmp_var = old_ewmsd * old_ewmsd; -- tmp_var = weight * (tmp_var + diff * incr / 1000000) / EWMA_DIV; -- -- /* return standard deviation */ -- return (u16) int_sqrt(tmp_var); -+ return weight * (old_ewmv + MINSTREL_TRUNC(diff * incr)) / EWMA_DIV; - } - - struct minstrel_rate_stats { -@@ -65,7 +60,7 @@ struct minstrel_rate_stats { - * prob_ewma - exponential weighted moving average of prob - * prob_ewmsd - exp. weighted moving standard deviation of prob */ - unsigned int prob_ewma; -- u16 prob_ewmsd; -+ u16 prob_ewmv; - - /* maximum retry counts */ - u8 retry_count; -@@ -151,6 +146,14 @@ struct minstrel_debugfs_info { - char buf[]; - }; - -+/* Get EWMSD (Exponentially Weighted Moving Standard Deviation) * 10 */ -+static inline int -+minstrel_get_ewmsd10(struct minstrel_rate_stats *mrs) -+{ -+ unsigned int ewmv = mrs->prob_ewmv; -+ return int_sqrt(MINSTREL_TRUNC(ewmv * 1000 * 1000)); -+} -+ - extern const struct rate_control_ops mac80211_minstrel; - void minstrel_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir); - void minstrel_remove_sta_debugfs(void *priv, void *priv_sta); ---- a/net/mac80211/rc80211_minstrel_debugfs.c -+++ b/net/mac80211/rc80211_minstrel_debugfs.c -@@ -93,6 +93,7 @@ minstrel_stats_open(struct inode *inode, - for (i = 0; i < mi->n_rates; i++) { - struct minstrel_rate *mr = &mi->r[i]; - struct minstrel_rate_stats *mrs = &mi->r[i].stats; -+ unsigned int prob_ewmsd; - - *(p++) = (i == mi->max_tp_rate[0]) ? 'A' : ' '; - *(p++) = (i == mi->max_tp_rate[1]) ? 'B' : ' '; -@@ -108,6 +109,7 @@ minstrel_stats_open(struct inode *inode, - tp_max = minstrel_get_tp_avg(mr, MINSTREL_FRAC(100,100)); - tp_avg = minstrel_get_tp_avg(mr, mrs->prob_ewma); - eprob = MINSTREL_TRUNC(mrs->prob_ewma * 1000); -+ prob_ewmsd = minstrel_get_ewmsd10(mrs); - - p += sprintf(p, "%4u.%1u %4u.%1u %3u.%1u %3u.%1u" - " %3u %3u %-3u " -@@ -115,7 +117,7 @@ minstrel_stats_open(struct inode *inode, - tp_max / 10, tp_max % 10, - tp_avg / 10, tp_avg % 10, - eprob / 10, eprob % 10, -- mrs->prob_ewmsd / 10, mrs->prob_ewmsd % 10, -+ prob_ewmsd / 10, prob_ewmsd % 10, - mrs->retry_count, - mrs->last_success, - mrs->last_attempts, -@@ -159,6 +161,7 @@ minstrel_stats_csv_open(struct inode *in - for (i = 0; i < mi->n_rates; i++) { - struct minstrel_rate *mr = &mi->r[i]; - struct minstrel_rate_stats *mrs = &mi->r[i].stats; -+ unsigned int prob_ewmsd; - - p += sprintf(p, "%s" ,((i == mi->max_tp_rate[0]) ? "A" : "")); - p += sprintf(p, "%s" ,((i == mi->max_tp_rate[1]) ? "B" : "")); -@@ -174,13 +177,14 @@ minstrel_stats_csv_open(struct inode *in - tp_max = minstrel_get_tp_avg(mr, MINSTREL_FRAC(100,100)); - tp_avg = minstrel_get_tp_avg(mr, mrs->prob_ewma); - eprob = MINSTREL_TRUNC(mrs->prob_ewma * 1000); -+ prob_ewmsd = minstrel_get_ewmsd10(mrs); - - p += sprintf(p, "%u.%u,%u.%u,%u.%u,%u.%u,%u,%u,%u," - "%llu,%llu,%d,%d\n", - tp_max / 10, tp_max % 10, - tp_avg / 10, tp_avg % 10, - eprob / 10, eprob % 10, -- mrs->prob_ewmsd / 10, mrs->prob_ewmsd % 10, -+ prob_ewmsd / 10, prob_ewmsd % 10, - mrs->retry_count, - mrs->last_success, - mrs->last_attempts, ---- a/net/mac80211/rc80211_minstrel_ht_debugfs.c -+++ b/net/mac80211/rc80211_minstrel_ht_debugfs.c -@@ -41,6 +41,7 @@ minstrel_ht_stats_dump(struct minstrel_h - struct minstrel_rate_stats *mrs = &mi->groups[i].rates[j]; - static const int bitrates[4] = { 10, 20, 55, 110 }; - int idx = i * MCS_GROUP_RATES + j; -+ unsigned int prob_ewmsd; - - if (!(mi->supported[i] & BIT(j))) - continue; -@@ -84,6 +85,7 @@ minstrel_ht_stats_dump(struct minstrel_h - tp_max = minstrel_ht_get_tp_avg(mi, i, j, MINSTREL_FRAC(100, 100)); - tp_avg = minstrel_ht_get_tp_avg(mi, i, j, mrs->prob_ewma); - eprob = MINSTREL_TRUNC(mrs->prob_ewma * 1000); -+ prob_ewmsd = minstrel_get_ewmsd10(mrs); - - p += sprintf(p, "%4u.%1u %4u.%1u %3u.%1u %3u.%1u" - " %3u %3u %-3u " -@@ -91,7 +93,7 @@ minstrel_ht_stats_dump(struct minstrel_h - tp_max / 10, tp_max % 10, - tp_avg / 10, tp_avg % 10, - eprob / 10, eprob % 10, -- mrs->prob_ewmsd / 10, mrs->prob_ewmsd % 10, -+ prob_ewmsd / 10, prob_ewmsd % 10, - mrs->retry_count, - mrs->last_success, - mrs->last_attempts, -@@ -185,6 +187,7 @@ minstrel_ht_stats_csv_dump(struct minstr - struct minstrel_rate_stats *mrs = &mi->groups[i].rates[j]; - static const int bitrates[4] = { 10, 20, 55, 110 }; - int idx = i * MCS_GROUP_RATES + j; -+ unsigned int prob_ewmsd; - - if (!(mi->supported[i] & BIT(j))) - continue; -@@ -225,13 +228,14 @@ minstrel_ht_stats_csv_dump(struct minstr - tp_max = minstrel_ht_get_tp_avg(mi, i, j, MINSTREL_FRAC(100, 100)); - tp_avg = minstrel_ht_get_tp_avg(mi, i, j, mrs->prob_ewma); - eprob = MINSTREL_TRUNC(mrs->prob_ewma * 1000); -+ prob_ewmsd = minstrel_get_ewmsd10(mrs); - - p += sprintf(p, "%u.%u,%u.%u,%u.%u,%u.%u,%u,%u," - "%u,%llu,%llu,", - tp_max / 10, tp_max % 10, - tp_avg / 10, tp_avg % 10, - eprob / 10, eprob % 10, -- mrs->prob_ewmsd / 10, mrs->prob_ewmsd % 10, -+ prob_ewmsd / 10, prob_ewmsd % 10, - mrs->retry_count, - mrs->last_success, - mrs->last_attempts, diff --git a/package/kernel/mac80211/patches/341-mac80211-minstrel-make-prob_ewma-u16-instead-of-u32.patch b/package/kernel/mac80211/patches/341-mac80211-minstrel-make-prob_ewma-u16-instead-of-u32.patch deleted file mode 100644 index 570cd19ee4..0000000000 --- a/package/kernel/mac80211/patches/341-mac80211-minstrel-make-prob_ewma-u16-instead-of-u32.patch +++ /dev/null @@ -1,20 +0,0 @@ -From: Felix Fietkau -Date: Wed, 14 Dec 2016 20:19:56 +0100 -Subject: [PATCH] mac80211: minstrel: make prob_ewma u16 instead of u32 - -Saves about 1.2 KiB memory per station - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/rc80211_minstrel.h -+++ b/net/mac80211/rc80211_minstrel.h -@@ -59,7 +59,7 @@ struct minstrel_rate_stats { - /* statistis of packet delivery probability - * prob_ewma - exponential weighted moving average of prob - * prob_ewmsd - exp. weighted moving standard deviation of prob */ -- unsigned int prob_ewma; -+ u16 prob_ewma; - u16 prob_ewmv; - - /* maximum retry counts */ diff --git a/package/kernel/mac80211/patches/342-mac80211-minstrel_ht-remove-obsolete-if-for-3-stream.patch b/package/kernel/mac80211/patches/342-mac80211-minstrel_ht-remove-obsolete-if-for-3-stream.patch deleted file mode 100644 index 39d3c99e74..0000000000 --- a/package/kernel/mac80211/patches/342-mac80211-minstrel_ht-remove-obsolete-if-for-3-stream.patch +++ /dev/null @@ -1,80 +0,0 @@ -From: Felix Fietkau -Date: Wed, 14 Dec 2016 20:23:29 +0100 -Subject: [PATCH] mac80211: minstrel_ht: remove obsolete #if for >= 3 streams - -This was added during early development when 3x3 hardware was not very -common yet. This is completely unnecessary now. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/rc80211_minstrel_ht.c -+++ b/net/mac80211/rc80211_minstrel_ht.c -@@ -155,67 +155,47 @@ MODULE_PARM_DESC(minstrel_vht_only, - const struct mcs_group minstrel_mcs_groups[] = { - MCS_GROUP(1, 0, BW_20), - MCS_GROUP(2, 0, BW_20), --#if MINSTREL_MAX_STREAMS >= 3 - MCS_GROUP(3, 0, BW_20), --#endif - - MCS_GROUP(1, 1, BW_20), - MCS_GROUP(2, 1, BW_20), --#if MINSTREL_MAX_STREAMS >= 3 - MCS_GROUP(3, 1, BW_20), --#endif - - MCS_GROUP(1, 0, BW_40), - MCS_GROUP(2, 0, BW_40), --#if MINSTREL_MAX_STREAMS >= 3 - MCS_GROUP(3, 0, BW_40), --#endif - - MCS_GROUP(1, 1, BW_40), - MCS_GROUP(2, 1, BW_40), --#if MINSTREL_MAX_STREAMS >= 3 - MCS_GROUP(3, 1, BW_40), --#endif - - CCK_GROUP, - - #ifdef CPTCFG_MAC80211_RC_MINSTREL_VHT - VHT_GROUP(1, 0, BW_20), - VHT_GROUP(2, 0, BW_20), --#if MINSTREL_MAX_STREAMS >= 3 - VHT_GROUP(3, 0, BW_20), --#endif - - VHT_GROUP(1, 1, BW_20), - VHT_GROUP(2, 1, BW_20), --#if MINSTREL_MAX_STREAMS >= 3 - VHT_GROUP(3, 1, BW_20), --#endif - - VHT_GROUP(1, 0, BW_40), - VHT_GROUP(2, 0, BW_40), --#if MINSTREL_MAX_STREAMS >= 3 - VHT_GROUP(3, 0, BW_40), --#endif - - VHT_GROUP(1, 1, BW_40), - VHT_GROUP(2, 1, BW_40), --#if MINSTREL_MAX_STREAMS >= 3 - VHT_GROUP(3, 1, BW_40), --#endif - - VHT_GROUP(1, 0, BW_80), - VHT_GROUP(2, 0, BW_80), --#if MINSTREL_MAX_STREAMS >= 3 - VHT_GROUP(3, 0, BW_80), --#endif - - VHT_GROUP(1, 1, BW_80), - VHT_GROUP(2, 1, BW_80), --#if MINSTREL_MAX_STREAMS >= 3 - VHT_GROUP(3, 1, BW_80), - #endif --#endif - }; - - static u8 sample_table[SAMPLE_COLUMNS][MCS_GROUP_RATES] __read_mostly; diff --git a/package/kernel/mac80211/patches/343-cfg80211-limit-scan-results-cache-size.patch b/package/kernel/mac80211/patches/343-cfg80211-limit-scan-results-cache-size.patch deleted file mode 100644 index f26548a3df..0000000000 --- a/package/kernel/mac80211/patches/343-cfg80211-limit-scan-results-cache-size.patch +++ /dev/null @@ -1,150 +0,0 @@ -From: Johannes Berg -Date: Tue, 15 Nov 2016 12:05:11 +0100 -Subject: [PATCH] cfg80211: limit scan results cache size - -It's possible to make scanning consume almost arbitrary amounts -of memory, e.g. by sending beacon frames with random BSSIDs at -high rates while somebody is scanning. - -Limit the number of BSS table entries we're willing to cache to -1000, limiting maximum memory usage to maybe 4-5MB, but lower -in practice - that would be the case for having both full-sized -beacon and probe response frames for each entry; this seems not -possible in practice, so a limit of 1000 entries will likely be -closer to 0.5 MB. - -Cc: stable@vger.kernel.org -Signed-off-by: Johannes Berg ---- - ---- a/net/wireless/core.h -+++ b/net/wireless/core.h -@@ -71,6 +71,7 @@ struct cfg80211_registered_device { - struct list_head bss_list; - struct rb_root bss_tree; - u32 bss_generation; -+ u32 bss_entries; - struct cfg80211_scan_request *scan_req; /* protected by RTNL */ - struct sk_buff *scan_msg; - struct cfg80211_sched_scan_request __rcu *sched_scan_req; ---- a/net/wireless/scan.c -+++ b/net/wireless/scan.c -@@ -57,6 +57,19 @@ - * also linked into the probe response struct. - */ - -+/* -+ * Limit the number of BSS entries stored in mac80211. Each one is -+ * a bit over 4k at most, so this limits to roughly 4-5M of memory. -+ * If somebody wants to really attack this though, they'd likely -+ * use small beacons, and only one type of frame, limiting each of -+ * the entries to a much smaller size (in order to generate more -+ * entries in total, so overhead is bigger.) -+ */ -+static int bss_entries_limit = 1000; -+module_param(bss_entries_limit, int, 0644); -+MODULE_PARM_DESC(bss_entries_limit, -+ "limit to number of scan BSS entries (per wiphy, default 1000)"); -+ - #define IEEE80211_SCAN_RESULT_EXPIRE (30 * HZ) - - static void bss_free(struct cfg80211_internal_bss *bss) -@@ -137,6 +150,10 @@ static bool __cfg80211_unlink_bss(struct - - list_del_init(&bss->list); - rb_erase(&bss->rbn, &rdev->bss_tree); -+ rdev->bss_entries--; -+ WARN_ONCE((rdev->bss_entries == 0) ^ list_empty(&rdev->bss_list), -+ "rdev bss entries[%d]/list[empty:%d] corruption\n", -+ rdev->bss_entries, list_empty(&rdev->bss_list)); - bss_ref_put(rdev, bss); - return true; - } -@@ -163,6 +180,40 @@ static void __cfg80211_bss_expire(struct - rdev->bss_generation++; - } - -+static bool cfg80211_bss_expire_oldest(struct cfg80211_registered_device *rdev) -+{ -+ struct cfg80211_internal_bss *bss, *oldest = NULL; -+ bool ret; -+ -+ lockdep_assert_held(&rdev->bss_lock); -+ -+ list_for_each_entry(bss, &rdev->bss_list, list) { -+ if (atomic_read(&bss->hold)) -+ continue; -+ -+ if (!list_empty(&bss->hidden_list) && -+ !bss->pub.hidden_beacon_bss) -+ continue; -+ -+ if (oldest && time_before(oldest->ts, bss->ts)) -+ continue; -+ oldest = bss; -+ } -+ -+ if (WARN_ON(!oldest)) -+ return false; -+ -+ /* -+ * The callers make sure to increase rdev->bss_generation if anything -+ * gets removed (and a new entry added), so there's no need to also do -+ * it here. -+ */ -+ -+ ret = __cfg80211_unlink_bss(rdev, oldest); -+ WARN_ON(!ret); -+ return ret; -+} -+ - void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev, - bool send_message) - { -@@ -689,6 +740,7 @@ static bool cfg80211_combine_bsses(struc - const u8 *ie; - int i, ssidlen; - u8 fold = 0; -+ u32 n_entries = 0; - - ies = rcu_access_pointer(new->pub.beacon_ies); - if (WARN_ON(!ies)) -@@ -712,6 +764,12 @@ static bool cfg80211_combine_bsses(struc - /* This is the bad part ... */ - - list_for_each_entry(bss, &rdev->bss_list, list) { -+ /* -+ * we're iterating all the entries anyway, so take the -+ * opportunity to validate the list length accounting -+ */ -+ n_entries++; -+ - if (!ether_addr_equal(bss->pub.bssid, new->pub.bssid)) - continue; - if (bss->pub.channel != new->pub.channel) -@@ -740,6 +798,10 @@ static bool cfg80211_combine_bsses(struc - new->pub.beacon_ies); - } - -+ WARN_ONCE(n_entries != rdev->bss_entries, -+ "rdev bss entries[%d]/list[len:%d] corruption\n", -+ rdev->bss_entries, n_entries); -+ - return true; - } - -@@ -894,7 +956,14 @@ cfg80211_bss_update(struct cfg80211_regi - } - } - -+ if (rdev->bss_entries >= bss_entries_limit && -+ !cfg80211_bss_expire_oldest(rdev)) { -+ kfree(new); -+ goto drop; -+ } -+ - list_add_tail(&new->list, &rdev->bss_list); -+ rdev->bss_entries++; - rb_insert_bss(rdev, new); - found = new; - } diff --git a/package/kernel/mac80211/patches/346-ath5k-drop-bogus-warning-on-drv_set_key-with-unsuppo.patch b/package/kernel/mac80211/patches/346-ath5k-drop-bogus-warning-on-drv_set_key-with-unsuppo.patch deleted file mode 100644 index 243907cb26..0000000000 --- a/package/kernel/mac80211/patches/346-ath5k-drop-bogus-warning-on-drv_set_key-with-unsuppo.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Felix Fietkau -Date: Tue, 27 Dec 2016 12:15:14 +0100 -Subject: [PATCH] ath5k: drop bogus warning on drv_set_key with unsupported - cipher - -Simply return -EOPNOTSUPP instead. - -Cc: stable@vger.kernel.org -Signed-off-by: Felix Fietkau ---- - ---- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c -+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c -@@ -502,8 +502,7 @@ ath5k_set_key(struct ieee80211_hw *hw, e - break; - return -EOPNOTSUPP; - default: -- WARN_ON(1); -- return -EINVAL; -+ return -EOPNOTSUPP; - } - - mutex_lock(&ah->lock); diff --git a/package/kernel/mac80211/patches/347-0001-cfg80211-move-function-checking-range-fit-to-util.c.patch b/package/kernel/mac80211/patches/347-0001-cfg80211-move-function-checking-range-fit-to-util.c.patch deleted file mode 100644 index 4a50d37b2e..0000000000 --- a/package/kernel/mac80211/patches/347-0001-cfg80211-move-function-checking-range-fit-to-util.c.patch +++ /dev/null @@ -1,101 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Wed, 4 Jan 2017 18:58:30 +0100 -Subject: [PATCH] cfg80211: move function checking range fit to util.c -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -It is needed for another cfg80211 helper that will be out of reg.c so -move it to common util.c file and make it non-static. - -Signed-off-by: Rafał Miłecki -Signed-off-by: Johannes Berg ---- - ---- a/net/wireless/core.h -+++ b/net/wireless/core.h -@@ -429,6 +429,9 @@ int cfg80211_change_iface(struct cfg8021 - void cfg80211_process_rdev_events(struct cfg80211_registered_device *rdev); - void cfg80211_process_wdev_events(struct wireless_dev *wdev); - -+bool cfg80211_does_bw_fit_range(const struct ieee80211_freq_range *freq_range, -+ u32 center_freq_khz, u32 bw_khz); -+ - /** - * cfg80211_chandef_dfs_usable - checks if chandef is DFS usable - * @wiphy: the wiphy to validate against ---- a/net/wireless/reg.c -+++ b/net/wireless/reg.c -@@ -748,21 +748,6 @@ static bool is_valid_rd(const struct iee - return true; - } - --static bool reg_does_bw_fit(const struct ieee80211_freq_range *freq_range, -- u32 center_freq_khz, u32 bw_khz) --{ -- u32 start_freq_khz, end_freq_khz; -- -- start_freq_khz = center_freq_khz - (bw_khz/2); -- end_freq_khz = center_freq_khz + (bw_khz/2); -- -- if (start_freq_khz >= freq_range->start_freq_khz && -- end_freq_khz <= freq_range->end_freq_khz) -- return true; -- -- return false; --} -- - /** - * freq_in_rule_band - tells us if a frequency is in a frequency band - * @freq_range: frequency rule we want to query -@@ -1070,7 +1055,7 @@ freq_reg_info_regd(u32 center_freq, - if (!band_rule_found) - band_rule_found = freq_in_rule_band(fr, center_freq); - -- bw_fits = reg_does_bw_fit(fr, center_freq, bw); -+ bw_fits = cfg80211_does_bw_fit_range(fr, center_freq, bw); - - if (band_rule_found && bw_fits) - return rr; -@@ -1138,11 +1123,13 @@ static uint32_t reg_rule_to_chan_bw_flag - max_bandwidth_khz = reg_get_max_bandwidth(regd, reg_rule); - - /* If we get a reg_rule we can assume that at least 5Mhz fit */ -- if (!reg_does_bw_fit(freq_range, MHZ_TO_KHZ(chan->center_freq), -- MHZ_TO_KHZ(10))) -+ if (!cfg80211_does_bw_fit_range(freq_range, -+ MHZ_TO_KHZ(chan->center_freq), -+ MHZ_TO_KHZ(10))) - bw_flags |= IEEE80211_CHAN_NO_10MHZ; -- if (!reg_does_bw_fit(freq_range, MHZ_TO_KHZ(chan->center_freq), -- MHZ_TO_KHZ(20))) -+ if (!cfg80211_does_bw_fit_range(freq_range, -+ MHZ_TO_KHZ(chan->center_freq), -+ MHZ_TO_KHZ(20))) - bw_flags |= IEEE80211_CHAN_NO_20MHZ; - - if (max_bandwidth_khz < MHZ_TO_KHZ(10)) ---- a/net/wireless/util.c -+++ b/net/wireless/util.c -@@ -1788,6 +1788,21 @@ void cfg80211_free_nan_func(struct cfg80 - } - EXPORT_SYMBOL(cfg80211_free_nan_func); - -+bool cfg80211_does_bw_fit_range(const struct ieee80211_freq_range *freq_range, -+ u32 center_freq_khz, u32 bw_khz) -+{ -+ u32 start_freq_khz, end_freq_khz; -+ -+ start_freq_khz = center_freq_khz - (bw_khz / 2); -+ end_freq_khz = center_freq_khz + (bw_khz / 2); -+ -+ if (start_freq_khz >= freq_range->start_freq_khz && -+ end_freq_khz <= freq_range->end_freq_khz) -+ return true; -+ -+ return false; -+} -+ - /* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */ - /* Ethernet-II snap header (RFC1042 for most EtherTypes) */ - const unsigned char rfc1042_header[] __aligned(2) = diff --git a/package/kernel/mac80211/patches/347-0002-cfg80211-support-ieee80211-freq-limit-DT-property.patch b/package/kernel/mac80211/patches/347-0002-cfg80211-support-ieee80211-freq-limit-DT-property.patch deleted file mode 100644 index 3e1aae72db..0000000000 --- a/package/kernel/mac80211/patches/347-0002-cfg80211-support-ieee80211-freq-limit-DT-property.patch +++ /dev/null @@ -1,211 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Wed, 4 Jan 2017 18:58:31 +0100 -Subject: [PATCH] cfg80211: support ieee80211-freq-limit DT property -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This patch adds a helper for reading that new property and applying -limitations of supported channels specified this way. -It is used with devices that normally support a wide wireless band but -in a given config are limited to some part of it (usually due to board -design). For example a dual-band chipset may be able to support one band -only because of used antennas. -It's also common that tri-band routers have separated radios for lower -and higher part of 5 GHz band and it may be impossible to say which is -which without a DT info. - -Signed-off-by: Rafał Miłecki -[add new function to documentation, fix link] -Signed-off-by: Johannes Berg ---- - create mode 100644 net/wireless/of.c - ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -311,6 +311,34 @@ struct ieee80211_supported_band { - struct ieee80211_sta_vht_cap vht_cap; - }; - -+/** -+ * wiphy_read_of_freq_limits - read frequency limits from device tree -+ * -+ * @wiphy: the wireless device to get extra limits for -+ * -+ * Some devices may have extra limitations specified in DT. This may be useful -+ * for chipsets that normally support more bands but are limited due to board -+ * design (e.g. by antennas or external power amplifier). -+ * -+ * This function reads info from DT and uses it to *modify* channels (disable -+ * unavailable ones). It's usually a *bad* idea to use it in drivers with -+ * shared channel data as DT limitations are device specific. You should make -+ * sure to call it only if channels in wiphy are copied and can be modified -+ * without affecting other devices. -+ * -+ * As this function access device node it has to be called after set_wiphy_dev. -+ * It also modifies channels so they have to be set first. -+ * If using this helper, call it before wiphy_register(). -+ */ -+#ifdef CONFIG_OF -+void wiphy_read_of_freq_limits(struct wiphy *wiphy); -+#else /* CONFIG_OF */ -+static inline void wiphy_read_of_freq_limits(struct wiphy *wiphy) -+{ -+} -+#endif /* !CONFIG_OF */ -+ -+ - /* - * Wireless hardware/device configuration structures and methods - */ ---- a/net/wireless/Makefile -+++ b/net/wireless/Makefile -@@ -11,6 +11,7 @@ obj-$(CONFIG_WEXT_PRIV) += wext-priv.o - - cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o - cfg80211-y += mlme.o ibss.o sme.o chan.o ethtool.o mesh.o ap.o trace.o ocb.o -+cfg80211-$(CONFIG_OF) += of.o - cfg80211-$(CPTCFG_CFG80211_DEBUGFS) += debugfs.o - cfg80211-$(CPTCFG_CFG80211_WEXT) += wext-compat.o wext-sme.o - cfg80211-$(CPTCFG_CFG80211_INTERNAL_REGDB) += regdb.o ---- /dev/null -+++ b/net/wireless/of.c -@@ -0,0 +1,138 @@ -+/* -+ * Copyright (C) 2017 Rafał Miłecki -+ * -+ * Permission to use, copy, modify, and/or distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+#include -+#include -+#include "core.h" -+ -+static bool wiphy_freq_limits_valid_chan(struct wiphy *wiphy, -+ struct ieee80211_freq_range *freq_limits, -+ unsigned int n_freq_limits, -+ struct ieee80211_channel *chan) -+{ -+ u32 bw = MHZ_TO_KHZ(20); -+ int i; -+ -+ for (i = 0; i < n_freq_limits; i++) { -+ struct ieee80211_freq_range *limit = &freq_limits[i]; -+ -+ if (cfg80211_does_bw_fit_range(limit, -+ MHZ_TO_KHZ(chan->center_freq), -+ bw)) -+ return true; -+ } -+ -+ return false; -+} -+ -+static void wiphy_freq_limits_apply(struct wiphy *wiphy, -+ struct ieee80211_freq_range *freq_limits, -+ unsigned int n_freq_limits) -+{ -+ enum nl80211_band band; -+ int i; -+ -+ if (WARN_ON(!n_freq_limits)) -+ return; -+ -+ for (band = 0; band < NUM_NL80211_BANDS; band++) { -+ struct ieee80211_supported_band *sband = wiphy->bands[band]; -+ -+ if (!sband) -+ continue; -+ -+ for (i = 0; i < sband->n_channels; i++) { -+ struct ieee80211_channel *chan = &sband->channels[i]; -+ -+ if (chan->flags & IEEE80211_CHAN_DISABLED) -+ continue; -+ -+ if (!wiphy_freq_limits_valid_chan(wiphy, freq_limits, -+ n_freq_limits, -+ chan)) { -+ pr_debug("Disabling freq %d MHz as it's out of OF limits\n", -+ chan->center_freq); -+ chan->flags |= IEEE80211_CHAN_DISABLED; -+ } -+ } -+ } -+} -+ -+void wiphy_read_of_freq_limits(struct wiphy *wiphy) -+{ -+ struct device *dev = wiphy_dev(wiphy); -+ struct device_node *np; -+ struct property *prop; -+ struct ieee80211_freq_range *freq_limits; -+ unsigned int n_freq_limits; -+ const __be32 *p; -+ int len, i; -+ int err = 0; -+ -+ if (!dev) -+ return; -+ np = dev_of_node(dev); -+ if (!np) -+ return; -+ -+ prop = of_find_property(np, "ieee80211-freq-limit", &len); -+ if (!prop) -+ return; -+ -+ if (!len || len % sizeof(u32) || len / sizeof(u32) % 2) { -+ dev_err(dev, "ieee80211-freq-limit wrong format"); -+ return; -+ } -+ n_freq_limits = len / sizeof(u32) / 2; -+ -+ freq_limits = kcalloc(n_freq_limits, sizeof(*freq_limits), GFP_KERNEL); -+ if (!freq_limits) { -+ err = -ENOMEM; -+ goto out_kfree; -+ } -+ -+ p = NULL; -+ for (i = 0; i < n_freq_limits; i++) { -+ struct ieee80211_freq_range *limit = &freq_limits[i]; -+ -+ p = of_prop_next_u32(prop, p, &limit->start_freq_khz); -+ if (!p) { -+ err = -EINVAL; -+ goto out_kfree; -+ } -+ -+ p = of_prop_next_u32(prop, p, &limit->end_freq_khz); -+ if (!p) { -+ err = -EINVAL; -+ goto out_kfree; -+ } -+ -+ if (!limit->start_freq_khz || -+ !limit->end_freq_khz || -+ limit->start_freq_khz >= limit->end_freq_khz) { -+ err = -EINVAL; -+ goto out_kfree; -+ } -+ } -+ -+ wiphy_freq_limits_apply(wiphy, freq_limits, n_freq_limits); -+ -+out_kfree: -+ kfree(freq_limits); -+ if (err) -+ dev_err(dev, "Failed to get limits: %d\n", err); -+} -+EXPORT_SYMBOL(wiphy_read_of_freq_limits); diff --git a/package/kernel/mac80211/patches/400-ath_move_debug_code.patch b/package/kernel/mac80211/patches/400-ath_move_debug_code.patch index a5e1f067c5..ed65053d77 100644 --- a/package/kernel/mac80211/patches/400-ath_move_debug_code.patch +++ b/package/kernel/mac80211/patches/400-ath_move_debug_code.patch @@ -11,7 +11,7 @@ -ath-$(CPTCFG_ATH_DEBUG) += debug.o ath-$(CPTCFG_ATH_TRACEPOINTS) += trace.o - ccflags-y += -D__CHECK_ENDIAN__ + CFLAGS_trace.o := -I$(src) --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h @@ -318,14 +318,7 @@ void _ath_dbg(struct ath_common *common, diff --git a/package/kernel/mac80211/patches/402-ath_regd_optional.patch b/package/kernel/mac80211/patches/402-ath_regd_optional.patch index 7a7c2d4174..0d6d3dbdbd 100644 --- a/package/kernel/mac80211/patches/402-ath_regd_optional.patch +++ b/package/kernel/mac80211/patches/402-ath_regd_optional.patch @@ -49,7 +49,7 @@ if (!wiphy->bands[NL80211_BAND_5GHZ]) return; -@@ -633,6 +647,10 @@ ath_regd_init_wiphy(struct ath_regulator +@@ -634,6 +648,10 @@ ath_regd_init_wiphy(struct ath_regulator const struct ieee80211_regdomain *regd; wiphy->reg_notifier = reg_notifier; @@ -74,7 +74,7 @@ ---help--- --- a/.local-symbols +++ b/.local-symbols -@@ -127,6 +127,7 @@ ADM8211= +@@ -130,6 +130,7 @@ ADM8211= ATH_COMMON= WLAN_VENDOR_ATH= ATH_DEBUG= diff --git a/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch b/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch index 1ef55456c5..469da90160 100644 --- a/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch +++ b/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch @@ -1,6 +1,6 @@ --- a/net/wireless/reg.c +++ b/net/wireless/reg.c -@@ -2411,6 +2411,8 @@ void regulatory_hint_country_ie(struct w +@@ -2398,6 +2398,8 @@ void regulatory_hint_country_ie(struct w enum environment_cap env = ENVIRON_ANY; struct regulatory_request *request = NULL, *lr; @@ -9,7 +9,7 @@ /* IE len must be evenly divisible by 2 */ if (country_ie_len & 0x01) return; -@@ -2617,6 +2619,7 @@ static void restore_regulatory_settings( +@@ -2604,6 +2606,7 @@ static void restore_regulatory_settings( void regulatory_hint_disconnect(void) { diff --git a/package/kernel/mac80211/patches/406-ath_relax_default_regd.patch b/package/kernel/mac80211/patches/406-ath_relax_default_regd.patch index 5b20b4518e..b6190b9363 100644 --- a/package/kernel/mac80211/patches/406-ath_relax_default_regd.patch +++ b/package/kernel/mac80211/patches/406-ath_relax_default_regd.patch @@ -39,7 +39,7 @@ bool ath_is_world_regd(struct ath_regulatory *reg) { return is_wwr_sku(ath_regd_get_eepromRD(reg)); -@@ -651,6 +659,9 @@ ath_regd_init_wiphy(struct ath_regulator +@@ -652,6 +660,9 @@ ath_regd_init_wiphy(struct ath_regulator if (IS_ENABLED(CPTCFG_ATH_USER_REGD)) return 0; diff --git a/package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch b/package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch index 0fc30bb868..86f96e8e97 100644 --- a/package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch +++ b/package/kernel/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch @@ -1,10 +1,10 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -773,6 +773,7 @@ static const struct ieee80211_iface_limi +@@ -777,6 +777,7 @@ static const struct ieee80211_iface_limi BIT(NL80211_IFTYPE_AP) }, { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO) }, + { .max = 1, .types = BIT(NL80211_IFTYPE_ADHOC) }, }; - static const struct ieee80211_iface_limit wds_limits[] = { + #ifdef CPTCFG_WIRELESS_WDS diff --git a/package/kernel/mac80211/patches/440-ath5k_channel_bw_debugfs.patch b/package/kernel/mac80211/patches/440-ath5k_channel_bw_debugfs.patch index 924b62e0d4..1d249a9723 100644 --- a/package/kernel/mac80211/patches/440-ath5k_channel_bw_debugfs.patch +++ b/package/kernel/mac80211/patches/440-ath5k_channel_bw_debugfs.patch @@ -11,7 +11,7 @@ drivers/net/wireless/ath/ath5k/debug.c | 86 ++++++++++++++++++++++++++++++++ --- a/drivers/net/wireless/ath/ath5k/debug.c +++ b/drivers/net/wireless/ath/ath5k/debug.c -@@ -823,6 +823,97 @@ static const struct file_operations fops +@@ -822,6 +822,97 @@ static const struct file_operations fops .llseek = default_llseek, }; @@ -109,7 +109,7 @@ drivers/net/wireless/ath/ath5k/debug.c | 86 ++++++++++++++++++++++++++++++++ /* debugfs: queues etc */ -@@ -1010,6 +1101,9 @@ ath5k_debug_init_device(struct ath5k_hw +@@ -1009,6 +1100,9 @@ ath5k_debug_init_device(struct ath5k_hw debugfs_create_file("beacon", S_IWUSR | S_IRUSR, phydir, ah, &fops_beacon); diff --git a/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch b/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch index 4f52c12389..d076e3c2eb 100644 --- a/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch +++ b/package/kernel/mac80211/patches/501-ath9k_ahb_init.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -1076,23 +1076,23 @@ static int __init ath9k_init(void) +@@ -1086,23 +1086,23 @@ static int __init ath9k_init(void) { int error; diff --git a/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch b/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch index 78b22e71a9..59daf4fe11 100644 --- a/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch +++ b/package/kernel/mac80211/patches/513-ath9k_add_pci_ids.patch @@ -20,7 +20,7 @@ #define AR9160_DEVID_PCI 0x0027 --- a/drivers/net/wireless/ath/ath9k/pci.c +++ b/drivers/net/wireless/ath/ath9k/pci.c -@@ -760,6 +760,7 @@ static const struct pci_device_id ath_pc +@@ -763,6 +763,7 @@ static const struct pci_device_id ath_pc .driver_data = ATH9K_PCI_BT_ANT_DIV }, #endif diff --git a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch index 6e4962b09d..9a0f6f5dbd 100644 --- a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch @@ -1,6 +1,6 @@ --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -2562,6 +2562,7 @@ struct cfg80211_nan_func { +@@ -2660,6 +2660,7 @@ struct cfg80211_nan_func { * (as advertised by the nl80211 feature flag.) * @get_tx_power: store the current TX power into the dbm variable; * return 0 if successful @@ -8,7 +8,7 @@ * * @set_wds_peer: set the WDS peer for a WDS interface * -@@ -2836,6 +2837,7 @@ struct cfg80211_ops { +@@ -2940,6 +2941,7 @@ struct cfg80211_ops { enum nl80211_tx_power_setting type, int mbm); int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, int *dbm); @@ -18,7 +18,7 @@ const u8 *addr); --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -1319,6 +1319,7 @@ enum ieee80211_smps_mode { +@@ -1325,6 +1325,7 @@ enum ieee80211_smps_mode { * * @power_level: requested transmit power (in dBm), backward compatibility * value only that is set to the minimum of all interfaces @@ -26,7 +26,7 @@ * * @chandef: the channel definition to tune to * @radar_enabled: whether radar detection is enabled -@@ -1339,6 +1340,7 @@ enum ieee80211_smps_mode { +@@ -1345,6 +1346,7 @@ enum ieee80211_smps_mode { struct ieee80211_conf { u32 flags; int power_level, dynamic_ps_timeout; @@ -36,9 +36,9 @@ u8 ps_dtim_period; --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h -@@ -1937,6 +1937,9 @@ enum nl80211_commands { - * @NL80211_ATTR_NAN_MATCH: used to report a match. This is a nested attribute. - * See &enum nl80211_nan_match_attributes. +@@ -2002,6 +2002,9 @@ enum nl80211_commands { + * u32 attribute with an &enum nl80211_timeout_reason value. This is used, + * e.g., with %NL80211_CMD_CONNECT event. * + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce + * transmit power to stay within regulatory limits. u32, dBi. @@ -46,9 +46,9 @@ * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -2336,6 +2339,8 @@ enum nl80211_attrs { - NL80211_ATTR_NAN_FUNC, - NL80211_ATTR_NAN_MATCH, +@@ -2413,6 +2416,8 @@ enum nl80211_attrs { + + NL80211_ATTR_TIMEOUT_REASON, + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + @@ -57,7 +57,7 @@ __NL80211_ATTR_AFTER_LAST, --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2406,6 +2406,19 @@ static int ieee80211_get_tx_power(struct +@@ -2396,6 +2396,19 @@ static int ieee80211_get_tx_power(struct return 0; } @@ -77,7 +77,7 @@ static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, const u8 *addr) { -@@ -3633,6 +3646,7 @@ const struct cfg80211_ops mac80211_confi +@@ -3627,6 +3640,7 @@ const struct cfg80211_ops mac80211_confi .set_wiphy_params = ieee80211_set_wiphy_params, .set_tx_power = ieee80211_set_tx_power, .get_tx_power = ieee80211_get_tx_power, @@ -87,7 +87,7 @@ CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1363,6 +1363,7 @@ struct ieee80211_local { +@@ -1370,6 +1370,7 @@ struct ieee80211_local { int dynamic_ps_forced_timeout; int user_power_level; /* in dBm, for all interfaces */ @@ -119,7 +119,7 @@ if (local->hw.conf.power_level != power) { changed |= IEEE80211_CONF_CHANGE_POWER; local->hw.conf.power_level = power; -@@ -588,6 +594,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ +@@ -589,6 +595,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ IEEE80211_RADIOTAP_MCS_HAVE_BW; local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI | IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH; @@ -129,15 +129,15 @@ local->user_power_level = IEEE80211_UNSET_POWER_LEVEL; --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -416,6 +416,7 @@ static const struct nla_policy nl80211_p - [NL80211_ATTR_NAN_MASTER_PREF] = { .type = NLA_U8 }, - [NL80211_ATTR_NAN_DUAL] = { .type = NLA_U8 }, - [NL80211_ATTR_NAN_FUNC] = { .type = NLA_NESTED }, +@@ -424,6 +424,7 @@ static const struct nla_policy nl80211_p + .len = sizeof(struct nl80211_bss_select_rssi_adjust) + }, + [NL80211_ATTR_TIMEOUT_REASON] = { .type = NLA_U32 }, + [NL80211_ATTR_WIPHY_ANTENNA_GAIN] = { .type = NLA_U32 }, }; /* policy for the key attributes */ -@@ -2353,6 +2354,20 @@ static int nl80211_set_wiphy(struct sk_b +@@ -2385,6 +2386,20 @@ static int nl80211_set_wiphy(struct sk_b if (result) return result; } diff --git a/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch b/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch index 3fbe316690..b3b51b4433 100644 --- a/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch +++ b/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -827,6 +827,9 @@ static inline int ath9k_dump_btcoex(stru +@@ -850,6 +850,9 @@ static inline int ath9k_dump_btcoex(stru #ifdef CPTCFG_MAC80211_LEDS void ath_init_leds(struct ath_softc *sc); void ath_deinit_leds(struct ath_softc *sc); @@ -10,9 +10,9 @@ #else static inline void ath_init_leds(struct ath_softc *sc) { -@@ -963,6 +966,13 @@ void ath_ant_comb_scan(struct ath_softc - - #define ATH9K_NUM_CHANCTX 2 /* supports 2 operating channels */ +@@ -991,6 +994,13 @@ void ath_ant_comb_scan(struct ath_softc + #define AIRTIME_USE_NEW_QUEUES BIT(2) + #define AIRTIME_ACTIVE(flags) (!!(flags & (AIRTIME_USE_TX|AIRTIME_USE_RX))) +struct ath_led { + struct list_head list; @@ -24,7 +24,7 @@ struct ath_softc { struct ieee80211_hw *hw; struct device *dev; -@@ -1015,9 +1025,8 @@ struct ath_softc { +@@ -1046,9 +1056,8 @@ struct ath_softc { spinlock_t chan_lock; #ifdef CPTCFG_MAC80211_LEDS @@ -103,8 +103,7 @@ + GFP_KERNEL); + if (!led) + return -ENOMEM; - -- ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val); ++ + led->gpio = gpio = (struct gpio_led *) (led + 1); + _name = (char *) (led->gpio + 1); + @@ -117,7 +116,8 @@ + ret = ath_add_led(sc, led); + if (unlikely(ret < 0)) + kfree(led); -+ + +- ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val); + return ret; } @@ -125,11 +125,11 @@ { - if (!sc->led_registered) - return; -- -- ath_led_brightness(&sc->led_cdev, LED_OFF); -- led_classdev_unregister(&sc->led_cdev); + struct ath_led *led; +- ath_led_brightness(&sc->led_cdev, LED_OFF); +- led_classdev_unregister(&sc->led_cdev); +- - ath9k_hw_gpio_free(sc->sc_ah, sc->sc_ah->led_pin); + while (!list_empty(&sc->leds)) { + led = list_first_entry(&sc->leds, struct ath_led, list); @@ -181,7 +181,7 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -988,7 +988,7 @@ int ath9k_init_device(u16 devid, struct +@@ -998,7 +998,7 @@ int ath9k_init_device(u16 devid, struct #ifdef CPTCFG_MAC80211_LEDS /* must be initialized before ieee80211_register_hw */ diff --git a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch index 08acc0e0c9..3e687792da 100644 --- a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch +++ b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch @@ -94,7 +94,7 @@ struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah, --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1838,6 +1838,20 @@ u32 ath9k_hw_get_tsf_offset(struct times +@@ -1842,6 +1842,20 @@ u32 ath9k_hw_get_tsf_offset(struct times } EXPORT_SYMBOL(ath9k_hw_get_tsf_offset); @@ -115,7 +115,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, struct ath9k_hw_cal_data *caldata, bool fastcc) { -@@ -2046,6 +2060,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st +@@ -2050,6 +2064,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st ar9003_hw_disable_phy_restart(ah); ath9k_hw_apply_gpio_override(ah); @@ -125,7 +125,7 @@ REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV, AR_BTCOEX_WL_LNADIV_FORCE_ON); --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -533,6 +533,11 @@ irqreturn_t ath_isr(int irq, void *dev) +@@ -527,6 +527,11 @@ irqreturn_t ath_isr(int irq, void *dev) if (test_bit(ATH_OP_HW_RESET, &common->op_flags)) return IRQ_HANDLED; diff --git a/package/kernel/mac80211/patches/543-ath9k_entropy_from_adc.patch b/package/kernel/mac80211/patches/543-ath9k_entropy_from_adc.patch index 237c3217a1..6f7370203b 100644 --- a/package/kernel/mac80211/patches/543-ath9k_entropy_from_adc.patch +++ b/package/kernel/mac80211/patches/543-ath9k_entropy_from_adc.patch @@ -55,7 +55,7 @@ ops->spectral_scan_config = ar9003_hw_spectral_scan_config; --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -761,7 +761,8 @@ static void ath9k_init_txpower_limits(st +@@ -765,7 +765,8 @@ static void ath9k_init_txpower_limits(st if (ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ) ath9k_init_band_txpower(sc, NL80211_BAND_5GHZ); @@ -65,7 +65,7 @@ } static const struct ieee80211_iface_limit if_limits[] = { -@@ -948,6 +949,18 @@ static void ath9k_set_hw_capab(struct at +@@ -958,6 +959,18 @@ static void ath9k_set_hw_capab(struct at SET_IEEE80211_PERM_ADDR(hw, common->macaddr); } @@ -84,7 +84,7 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, const struct ath_bus_ops *bus_ops) { -@@ -993,6 +1006,8 @@ int ath9k_init_device(u16 devid, struct +@@ -1003,6 +1016,8 @@ int ath9k_init_device(u16 devid, struct ARRAY_SIZE(ath9k_tpt_blink)); #endif diff --git a/package/kernel/mac80211/patches/544-ath9k-ar933x-usb-hang-workaround.patch b/package/kernel/mac80211/patches/544-ath9k-ar933x-usb-hang-workaround.patch index 200a3a28f6..680bb6d590 100644 --- a/package/kernel/mac80211/patches/544-ath9k-ar933x-usb-hang-workaround.patch +++ b/package/kernel/mac80211/patches/544-ath9k-ar933x-usb-hang-workaround.patch @@ -40,7 +40,7 @@ return true; } -@@ -1816,8 +1835,14 @@ static int ath9k_hw_do_fastcc(struct ath +@@ -1820,8 +1839,14 @@ static int ath9k_hw_do_fastcc(struct ath if (AR_SREV_9271(ah)) ar9002_hw_load_ani_reg(ah, chan); @@ -55,7 +55,7 @@ return -EINVAL; } -@@ -2071,6 +2096,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st +@@ -2075,6 +2100,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st ath9k_hw_set_radar_params(ah); } diff --git a/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch b/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch index 1330dfed8b..d4269282d9 100644 --- a/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch +++ b/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau #include "common.h" #include "debug.h" -@@ -973,6 +974,14 @@ struct ath_led { +@@ -1001,6 +1002,14 @@ struct ath_led { struct led_classdev cdev; }; @@ -33,7 +33,7 @@ Signed-off-by: Felix Fietkau struct ath_softc { struct ieee80211_hw *hw; struct device *dev; -@@ -1027,6 +1036,9 @@ struct ath_softc { +@@ -1058,6 +1067,9 @@ struct ath_softc { #ifdef CPTCFG_MAC80211_LEDS const char *led_default_trigger; struct list_head leds; @@ -123,6 +123,7 @@ Signed-off-by: Felix Fietkau + if (!gc) + return; + ++ gc->sc = sc; + snprintf(gc->label, sizeof(gc->label), "ath9k-%s", + wiphy_name(sc->hw->wiphy)); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0) @@ -146,7 +147,6 @@ Signed-off-by: Felix Fietkau + + gc->gchip.owner = NULL; + sc->gpiochip = gc; -+ gc->sc = sc; +} + +/* remove GPIO chip */ diff --git a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch index f86b0152ea..f40bac93c3 100644 --- a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch +++ b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -1038,6 +1038,7 @@ struct ath_softc { +@@ -1069,6 +1069,7 @@ struct ath_softc { struct list_head leds; #ifdef CONFIG_GPIOLIB struct ath9k_gpio_chip *gpiochip; diff --git a/package/kernel/mac80211/patches/550-ath9k-Add-a-define-for-the-EEPROM-eepmisc-endianness.patch b/package/kernel/mac80211/patches/550-ath9k-Add-a-define-for-the-EEPROM-eepmisc-endianness.patch deleted file mode 100644 index a17f95682f..0000000000 --- a/package/kernel/mac80211/patches/550-ath9k-Add-a-define-for-the-EEPROM-eepmisc-endianness.patch +++ /dev/null @@ -1,95 +0,0 @@ -From 9692ab1ff30ae0abc1000d11b2f929b6e2e4cb7f Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Mon, 3 Oct 2016 00:29:07 +0200 -Subject: [v2 PATCH 1/7] ath9k: Add a #define for the EEPROM "eepmisc" endianness - bit - -This replaces a magic number with a named #define. Additionally it -removes two "eeprom format" specific #defines for the "big endianness" -bit which are the same on all eeprom formats. - -Signed-off-by: Martin Blumenstingl ---- - drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 3 ++- - drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | 1 - - drivers/net/wireless/ath/ath9k/eeprom.h | 4 +++- - drivers/net/wireless/ath/ath9k/eeprom_4k.c | 2 +- - drivers/net/wireless/ath/ath9k/eeprom_9287.c | 2 +- - drivers/net/wireless/ath/ath9k/eeprom_def.c | 2 +- - 6 files changed, 8 insertions(+), 6 deletions(-) - ---- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c -+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c -@@ -3468,7 +3468,8 @@ static u32 ath9k_hw_ar9003_dump_eeprom(s - AR5416_OPFLAGS_N_5G_HT20)); - PR_EEP("Disable 5Ghz HT40", !!(pBase->opCapFlags.opFlags & - AR5416_OPFLAGS_N_5G_HT40)); -- PR_EEP("Big Endian", !!(pBase->opCapFlags.eepMisc & 0x01)); -+ PR_EEP("Big Endian", !!(pBase->opCapFlags.eepMisc & -+ AR5416_EEPMISC_BIG_ENDIAN)); - PR_EEP("RF Silent", pBase->rfSilent); - PR_EEP("BT option", pBase->blueToothOptions); - PR_EEP("Device Cap", pBase->deviceCap); ---- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h -+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h -@@ -38,7 +38,6 @@ - #define AR9300_NUM_CTLS_2G 12 - #define AR9300_NUM_BAND_EDGES_5G 8 - #define AR9300_NUM_BAND_EDGES_2G 4 --#define AR9300_EEPMISC_BIG_ENDIAN 0x01 - #define AR9300_EEPMISC_WOW 0x02 - #define AR9300_CUSTOMER_DATA_SIZE 20 - ---- a/drivers/net/wireless/ath/ath9k/eeprom.h -+++ b/drivers/net/wireless/ath/ath9k/eeprom.h -@@ -161,6 +161,9 @@ - #define AR5416_EEP_TXGAIN_ORIGINAL 0 - #define AR5416_EEP_TXGAIN_HIGH_POWER 1 - -+/* Endianness of EEPROM content */ -+#define AR5416_EEPMISC_BIG_ENDIAN 0x01 -+ - #define AR5416_EEP4K_START_LOC 64 - #define AR5416_EEP4K_NUM_2G_CAL_PIERS 3 - #define AR5416_EEP4K_NUM_2G_CCK_TARGET_POWERS 3 -@@ -191,7 +194,6 @@ - #define AR9287_NUM_CTLS 12 - #define AR9287_NUM_BAND_EDGES 4 - #define AR9287_PD_GAIN_ICEPTS 1 --#define AR9287_EEPMISC_BIG_ENDIAN 0x01 - #define AR9287_EEPMISC_WOW 0x02 - #define AR9287_MAX_CHAINS 2 - #define AR9287_ANT_16S 32 ---- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c -@@ -154,7 +154,7 @@ static u32 ath9k_hw_4k_dump_eeprom(struc - AR5416_OPFLAGS_N_5G_HT20)); - PR_EEP("Disable 5Ghz HT40", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_5G_HT40)); -- PR_EEP("Big Endian", !!(pBase->eepMisc & 0x01)); -+ PR_EEP("Big Endian", !!(pBase->eepMisc & AR5416_EEPMISC_BIG_ENDIAN)); - PR_EEP("Cal Bin Major Ver", (pBase->binBuildNumber >> 24) & 0xFF); - PR_EEP("Cal Bin Minor Ver", (pBase->binBuildNumber >> 16) & 0xFF); - PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF); ---- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c -@@ -150,7 +150,7 @@ static u32 ath9k_hw_ar9287_dump_eeprom(s - AR5416_OPFLAGS_N_5G_HT20)); - PR_EEP("Disable 5Ghz HT40", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_5G_HT40)); -- PR_EEP("Big Endian", !!(pBase->eepMisc & 0x01)); -+ PR_EEP("Big Endian", !!(pBase->eepMisc & AR5416_EEPMISC_BIG_ENDIAN)); - PR_EEP("Cal Bin Major Ver", (pBase->binBuildNumber >> 24) & 0xFF); - PR_EEP("Cal Bin Minor Ver", (pBase->binBuildNumber >> 16) & 0xFF); - PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF); ---- a/drivers/net/wireless/ath/ath9k/eeprom_def.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c -@@ -232,7 +232,7 @@ static u32 ath9k_hw_def_dump_eeprom(stru - AR5416_OPFLAGS_N_5G_HT20)); - PR_EEP("Disable 5Ghz HT40", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_5G_HT40)); -- PR_EEP("Big Endian", !!(pBase->eepMisc & 0x01)); -+ PR_EEP("Big Endian", !!(pBase->eepMisc & AR5416_EEPMISC_BIG_ENDIAN)); - PR_EEP("Cal Bin Major Ver", (pBase->binBuildNumber >> 24) & 0xFF); - PR_EEP("Cal Bin Minor Ver", (pBase->binBuildNumber >> 16) & 0xFF); - PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF); diff --git a/package/kernel/mac80211/patches/550-ath9k-disable-bands-via-dt.patch b/package/kernel/mac80211/patches/550-ath9k-disable-bands-via-dt.patch new file mode 100644 index 0000000000..55f040f170 --- /dev/null +++ b/package/kernel/mac80211/patches/550-ath9k-disable-bands-via-dt.patch @@ -0,0 +1,15 @@ +--- a/drivers/net/wireless/ath/ath9k/init.c ++++ b/drivers/net/wireless/ath/ath9k/init.c +@@ -571,6 +571,12 @@ static int ath9k_of_init(struct ath_soft + + ath_dbg(common, CONFIG, "parsing configuration from OF node\n"); + ++ if (of_property_read_bool(np, "qca,disable-2ghz")) ++ ah->disable_2ghz = true; ++ ++ if (of_property_read_bool(np, "qca,disable-5ghz")) ++ ah->disable_5ghz = true; ++ + if (of_property_read_bool(np, "qca,no-eeprom")) { + /* ath9k-eeprom--.bin */ + scnprintf(eeprom_name, sizeof(eeprom_name), diff --git a/package/kernel/mac80211/patches/551-ath9k-indicate-that-the-AR9003-EEPROM-template-value.patch b/package/kernel/mac80211/patches/551-ath9k-indicate-that-the-AR9003-EEPROM-template-value.patch deleted file mode 100644 index a4a3595531..0000000000 --- a/package/kernel/mac80211/patches/551-ath9k-indicate-that-the-AR9003-EEPROM-template-value.patch +++ /dev/null @@ -1,78 +0,0 @@ -From e88ab4a2649d0fbf675193fb2c176f65375bdd2d Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Mon, 3 Oct 2016 00:29:08 +0200 -Subject: [v2 PATCH 2/7] ath9k: indicate that the AR9003 EEPROM template values - are little endian - -The eepMisc field was not set explicitly. The default value of 0 means -that the values in the EEPROM (template) should be interpreted as little -endian. However, this is not clear until comparing the AR9003 code with -the other EEPROM formats. -To make the code easier to understand we explicitly state that the values -are little endian - there are no functional changes with this patch. - -Signed-off-by: Martin Blumenstingl ---- - drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 10 +++++----- - drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | 3 +++ - 2 files changed, 8 insertions(+), 5 deletions(-) - ---- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c -+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c -@@ -53,7 +53,7 @@ static const struct ar9300_eeprom ar9300 - .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */ - .opCapFlags = { - .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A, -- .eepMisc = 0, -+ .eepMisc = AR9300_EEPMISC_LITTLE_ENDIAN, - }, - .rfSilent = 0, - .blueToothOptions = 0, -@@ -631,7 +631,7 @@ static const struct ar9300_eeprom ar9300 - .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */ - .opCapFlags = { - .opFlags = AR5416_OPFLAGS_11A, -- .eepMisc = 0, -+ .eepMisc = AR9300_EEPMISC_LITTLE_ENDIAN, - }, - .rfSilent = 0, - .blueToothOptions = 0, -@@ -1210,7 +1210,7 @@ static const struct ar9300_eeprom ar9300 - .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */ - .opCapFlags = { - .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A, -- .eepMisc = 0, -+ .eepMisc = AR9300_EEPMISC_LITTLE_ENDIAN, - }, - .rfSilent = 0, - .blueToothOptions = 0, -@@ -1789,7 +1789,7 @@ static const struct ar9300_eeprom ar9300 - .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */ - .opCapFlags = { - .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A, -- .eepMisc = 0, -+ .eepMisc = AR9300_EEPMISC_LITTLE_ENDIAN, - }, - .rfSilent = 0, - .blueToothOptions = 0, -@@ -2367,7 +2367,7 @@ static const struct ar9300_eeprom ar9300 - .txrxMask = 0x33, /* 4 bits tx and 4 bits rx */ - .opCapFlags = { - .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A, -- .eepMisc = 0, -+ .eepMisc = AR9300_EEPMISC_LITTLE_ENDIAN, - }, - .rfSilent = 0, - .blueToothOptions = 0, ---- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h -+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h -@@ -69,6 +69,9 @@ - #define AR9300_BASE_ADDR 0x3ff - #define AR9300_BASE_ADDR_512 0x1ff - -+/* AR5416_EEPMISC_BIG_ENDIAN not set indicates little endian */ -+#define AR9300_EEPMISC_LITTLE_ENDIAN 0 -+ - #define AR9300_OTP_BASE \ - ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30000 : 0x14000) - #define AR9300_OTP_STATUS \ diff --git a/package/kernel/mac80211/patches/560-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/551-ath9k_ubnt_uap_plus_hsr.patch similarity index 98% rename from package/kernel/mac80211/patches/560-ath9k_ubnt_uap_plus_hsr.patch rename to package/kernel/mac80211/patches/551-ath9k_ubnt_uap_plus_hsr.patch index 723749259c..45284c71ee 100644 --- a/package/kernel/mac80211/patches/560-ath9k_ubnt_uap_plus_hsr.patch +++ b/package/kernel/mac80211/patches/551-ath9k_ubnt_uap_plus_hsr.patch @@ -343,7 +343,7 @@ u8 ath9k_parse_mpdudensity(u8 mpdudensity) { -@@ -652,6 +654,7 @@ void ath_reset_work(struct work_struct * +@@ -648,6 +650,7 @@ void ath_reset_work(struct work_struct * static int ath9k_start(struct ieee80211_hw *hw) { struct ath_softc *sc = hw->priv; @@ -351,7 +351,7 @@ struct ath_hw *ah = sc->sc_ah; struct ath_common *common = ath9k_hw_common(ah); struct ieee80211_channel *curchan = sc->cur_chan->chandef.chan; -@@ -730,6 +733,11 @@ static int ath9k_start(struct ieee80211_ +@@ -726,6 +729,11 @@ static int ath9k_start(struct ieee80211_ AR_GPIO_OUTPUT_MUX_AS_OUTPUT); } @@ -386,7 +386,7 @@ #endif /* _LINUX_ATH9K_PLATFORM_H */ --- a/.local-symbols +++ b/.local-symbols -@@ -153,6 +153,7 @@ ATH9K_WOW= +@@ -157,6 +157,7 @@ ATH9K_WOW= ATH9K_RFKILL= ATH9K_CHANNEL_CONTEXT= ATH9K_PCOEM= diff --git a/package/kernel/mac80211/patches/552-ath9k-Add-an-eeprom_ops-callback-for-retrieving-the-.patch b/package/kernel/mac80211/patches/552-ath9k-Add-an-eeprom_ops-callback-for-retrieving-the-.patch deleted file mode 100644 index 1b4dd3d134..0000000000 --- a/package/kernel/mac80211/patches/552-ath9k-Add-an-eeprom_ops-callback-for-retrieving-the-.patch +++ /dev/null @@ -1,117 +0,0 @@ -From e8f60fa28e619ad238457ac84fb292541be180d3 Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Mon, 3 Oct 2016 00:29:09 +0200 -Subject: [v2 PATCH 3/7] ath9k: Add an eeprom_ops callback for retrieving the - eepmisc value - -This allows deciding if we have to swap the EEPROM data (so it matches -the system's native endianness) even if no byte-swapping (swab16, based on -the first two bytes in the EEPROM) is needed. - -Signed-off-by: Martin Blumenstingl ---- - drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 8 +++++++- - drivers/net/wireless/ath/ath9k/eeprom.h | 1 + - drivers/net/wireless/ath/ath9k/eeprom_4k.c | 8 +++++++- - drivers/net/wireless/ath/ath9k/eeprom_9287.c | 8 +++++++- - drivers/net/wireless/ath/ath9k/eeprom_def.c | 8 +++++++- - 5 files changed, 29 insertions(+), 4 deletions(-) - ---- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c -+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c -@@ -5498,6 +5498,11 @@ unsigned int ar9003_get_paprd_scale_fact - } - } - -+static u8 ar9003_get_eepmisc(struct ath_hw *ah) -+{ -+ return ah->eeprom.map4k.baseEepHeader.eepMisc; -+} -+ - const struct eeprom_ops eep_ar9300_ops = { - .check_eeprom = ath9k_hw_ar9300_check_eeprom, - .get_eeprom = ath9k_hw_ar9300_get_eeprom, -@@ -5508,5 +5513,6 @@ const struct eeprom_ops eep_ar9300_ops = - .set_board_values = ath9k_hw_ar9300_set_board_values, - .set_addac = ath9k_hw_ar9300_set_addac, - .set_txpower = ath9k_hw_ar9300_set_txpower, -- .get_spur_channel = ath9k_hw_ar9300_get_spur_channel -+ .get_spur_channel = ath9k_hw_ar9300_get_spur_channel, -+ .get_eepmisc = ar9003_get_eepmisc - }; ---- a/drivers/net/wireless/ath/ath9k/eeprom.h -+++ b/drivers/net/wireless/ath/ath9k/eeprom.h -@@ -655,6 +655,7 @@ struct eeprom_ops { - u16 cfgCtl, u8 twiceAntennaReduction, - u8 powerLimit, bool test); - u16 (*get_spur_channel)(struct ath_hw *ah, u16 i, bool is2GHz); -+ u8 (*get_eepmisc)(struct ath_hw *ah); - }; - - void ath9k_hw_analog_shift_regwrite(struct ath_hw *ah, u32 reg, u32 val); ---- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c -@@ -1064,6 +1064,11 @@ static u16 ath9k_hw_4k_get_spur_channel( - return ah->eeprom.map4k.modalHeader.spurChans[i].spurChan; - } - -+static u8 ath9k_hw_4k_get_eepmisc(struct ath_hw *ah) -+{ -+ return ah->eeprom.map4k.baseEepHeader.eepMisc; -+} -+ - const struct eeprom_ops eep_4k_ops = { - .check_eeprom = ath9k_hw_4k_check_eeprom, - .get_eeprom = ath9k_hw_4k_get_eeprom, -@@ -1073,5 +1078,6 @@ const struct eeprom_ops eep_4k_ops = { - .get_eeprom_rev = ath9k_hw_4k_get_eeprom_rev, - .set_board_values = ath9k_hw_4k_set_board_values, - .set_txpower = ath9k_hw_4k_set_txpower, -- .get_spur_channel = ath9k_hw_4k_get_spur_channel -+ .get_spur_channel = ath9k_hw_4k_get_spur_channel, -+ .get_eepmisc = ath9k_hw_4k_get_eepmisc - }; ---- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c -@@ -986,6 +986,11 @@ static u16 ath9k_hw_ar9287_get_spur_chan - return ah->eeprom.map9287.modalHeader.spurChans[i].spurChan; - } - -+static u8 ath9k_hw_ar9287_get_eepmisc(struct ath_hw *ah) -+{ -+ return ah->eeprom.map9287.baseEepHeader.eepMisc; -+} -+ - const struct eeprom_ops eep_ar9287_ops = { - .check_eeprom = ath9k_hw_ar9287_check_eeprom, - .get_eeprom = ath9k_hw_ar9287_get_eeprom, -@@ -995,5 +1000,6 @@ const struct eeprom_ops eep_ar9287_ops = - .get_eeprom_rev = ath9k_hw_ar9287_get_eeprom_rev, - .set_board_values = ath9k_hw_ar9287_set_board_values, - .set_txpower = ath9k_hw_ar9287_set_txpower, -- .get_spur_channel = ath9k_hw_ar9287_get_spur_channel -+ .get_spur_channel = ath9k_hw_ar9287_get_spur_channel, -+ .get_eepmisc = ath9k_hw_ar9287_get_eepmisc - }; ---- a/drivers/net/wireless/ath/ath9k/eeprom_def.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c -@@ -1317,6 +1317,11 @@ static u16 ath9k_hw_def_get_spur_channel - return ah->eeprom.def.modalHeader[is2GHz].spurChans[i].spurChan; - } - -+static u8 ath9k_hw_def_get_eepmisc(struct ath_hw *ah) -+{ -+ return ah->eeprom.def.baseEepHeader.eepMisc; -+} -+ - const struct eeprom_ops eep_def_ops = { - .check_eeprom = ath9k_hw_def_check_eeprom, - .get_eeprom = ath9k_hw_def_get_eeprom, -@@ -1327,5 +1332,6 @@ const struct eeprom_ops eep_def_ops = { - .set_board_values = ath9k_hw_def_set_board_values, - .set_addac = ath9k_hw_def_set_addac, - .set_txpower = ath9k_hw_def_set_txpower, -- .get_spur_channel = ath9k_hw_def_get_spur_channel -+ .get_spur_channel = ath9k_hw_def_get_spur_channel, -+ .get_eepmisc = ath9k_hw_def_get_eepmisc - }; diff --git a/package/kernel/mac80211/patches/553-ath9k-replace-eeprom_param-EEP_MINOR_REV-with-get_ee.patch b/package/kernel/mac80211/patches/553-ath9k-replace-eeprom_param-EEP_MINOR_REV-with-get_ee.patch deleted file mode 100644 index 277aa6f61c..0000000000 --- a/package/kernel/mac80211/patches/553-ath9k-replace-eeprom_param-EEP_MINOR_REV-with-get_ee.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 9f247f908d5166e16e1cc6a50b0901e0f6733410 Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Mon, 3 Oct 2016 00:29:10 +0200 -Subject: [v2 PATCH 4/7] ath9k: replace eeprom_param EEP_MINOR_REV with - get_eeprom_rev - -get_eeprom(ah, EEP_MINOR_REV) and get_eeprom_rev(ah) are both doing the -same thing: returning the EEPROM revision (12 lowest bits). Make the -code consistent by using get_eeprom_rev(ah) everywhere. - -Signed-off-by: Martin Blumenstingl ---- - drivers/net/wireless/ath/ath9k/ar5008_phy.c | 2 +- - drivers/net/wireless/ath/ath9k/ar9002_hw.c | 6 ++---- - drivers/net/wireless/ath/ath9k/eeprom.h | 1 - - drivers/net/wireless/ath/ath9k/eeprom_4k.c | 5 ----- - drivers/net/wireless/ath/ath9k/eeprom_9287.c | 6 +----- - drivers/net/wireless/ath/ath9k/eeprom_def.c | 2 -- - 6 files changed, 4 insertions(+), 18 deletions(-) - ---- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c -+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c -@@ -524,7 +524,7 @@ static bool ar5008_hw_set_rf_regs(struct - return true; - - /* Setup rf parameters */ -- eepMinorRev = ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV); -+ eepMinorRev = ah->eep_ops->get_eeprom_rev(ah); - - for (i = 0; i < ah->iniBank6.ia_rows; i++) - ah->analogBank6Data[i] = INI_RA(&ah->iniBank6, i, modesIndex); ---- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c -+++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c -@@ -108,8 +108,7 @@ static void ar9280_20_hw_init_rxgain_ini - { - u32 rxgain_type; - -- if (ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) >= -- AR5416_EEP_MINOR_VER_17) { -+ if (ah->eep_ops->get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_17) { - rxgain_type = ah->eep_ops->get_eeprom(ah, EEP_RXGAIN_TYPE); - - if (rxgain_type == AR5416_EEP_RXGAIN_13DB_BACKOFF) -@@ -129,8 +128,7 @@ static void ar9280_20_hw_init_rxgain_ini - - static void ar9280_20_hw_init_txgain_ini(struct ath_hw *ah, u32 txgain_type) - { -- if (ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) >= -- AR5416_EEP_MINOR_VER_19) { -+ if (ah->eep_ops->get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_19) { - if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER) - INIT_INI_ARRAY(&ah->iniModesTxGain, - ar9280Modes_high_power_tx_gain_9280_2); ---- a/drivers/net/wireless/ath/ath9k/eeprom.h -+++ b/drivers/net/wireless/ath/ath9k/eeprom.h -@@ -230,7 +230,6 @@ enum eeprom_param { - EEP_DB_5, - EEP_OB_2, - EEP_DB_2, -- EEP_MINOR_REV, - EEP_TX_MASK, - EEP_RX_MASK, - EEP_FSTCLK_5G, ---- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c -@@ -254,9 +254,6 @@ static u32 ath9k_hw_4k_get_eeprom(struct - struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k; - struct modal_eep_4k_header *pModal = &eep->modalHeader; - struct base_eep_header_4k *pBase = &eep->baseEepHeader; -- u16 ver_minor; -- -- ver_minor = pBase->version & AR5416_EEP_VER_MINOR_MASK; - - switch (param) { - case EEP_NFTHRESH_2: -@@ -279,8 +276,6 @@ static u32 ath9k_hw_4k_get_eeprom(struct - return pModal->ob_0; - case EEP_DB_2: - return pModal->db1_1; -- case EEP_MINOR_REV: -- return ver_minor; - case EEP_TX_MASK: - return pBase->txMask; - case EEP_RX_MASK: ---- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c -@@ -250,9 +250,7 @@ static u32 ath9k_hw_ar9287_get_eeprom(st - struct ar9287_eeprom *eep = &ah->eeprom.map9287; - struct modal_eep_ar9287_header *pModal = &eep->modalHeader; - struct base_eep_ar9287_header *pBase = &eep->baseEepHeader; -- u16 ver_minor; -- -- ver_minor = pBase->version & AR9287_EEP_VER_MINOR_MASK; -+ u16 ver_minor = ath9k_hw_ar9287_get_eeprom_rev(ah); - - switch (param) { - case EEP_NFTHRESH_2: -@@ -271,8 +269,6 @@ static u32 ath9k_hw_ar9287_get_eeprom(st - return pBase->opCapFlags; - case EEP_RF_SILENT: - return pBase->rfSilent; -- case EEP_MINOR_REV: -- return ver_minor; - case EEP_TX_MASK: - return pBase->txMask; - case EEP_RX_MASK: ---- a/drivers/net/wireless/ath/ath9k/eeprom_def.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c -@@ -380,8 +380,6 @@ static u32 ath9k_hw_def_get_eeprom(struc - return pModal[1].ob; - case EEP_DB_2: - return pModal[1].db; -- case EEP_MINOR_REV: -- return AR5416_VER_MASK; - case EEP_TX_MASK: - return pBase->txMask; - case EEP_RX_MASK: diff --git a/package/kernel/mac80211/patches/554-ath9k-consistently-use-get_eeprom_rev-ah.patch b/package/kernel/mac80211/patches/554-ath9k-consistently-use-get_eeprom_rev-ah.patch deleted file mode 100644 index 64e70467a3..0000000000 --- a/package/kernel/mac80211/patches/554-ath9k-consistently-use-get_eeprom_rev-ah.patch +++ /dev/null @@ -1,342 +0,0 @@ -From c763af71bcc2f01bd5ef6e65c7c34b46c7235a16 Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Mon, 3 Oct 2016 00:29:11 +0200 -Subject: [v2 PATCH 5/7] ath9k: consistently use get_eeprom_rev(ah) - -The AR5416_VER_MASK macro does the same as get_eeprom_rev, except that -one has to know the actual EEPROM type (and providing a reference to -that in a variable named "eep"). Additionally the eeprom_*.c -implementations used the same shifting logic multiple times to get the -eeprom revision which was also unnecessary duplication of -get_eeprom_rev. - -Also use the AR5416_EEP_VER_MINOR_MASK macro where needed and introduce -a similar macro (AR5416_EEP_VER_MAJOR_MASK) for the major version. -Finally drop AR9287_EEP_VER_MINOR_MASK since it simply duplicates the -already defined AR5416_EEP_VER_MINOR_MASK. - -Signed-off-by: Martin Blumenstingl ---- - drivers/net/wireless/ath/ath9k/eeprom.h | 4 +-- - drivers/net/wireless/ath/ath9k/eeprom_4k.c | 32 ++++++++++------------ - drivers/net/wireless/ath/ath9k/eeprom_9287.c | 19 +++++++------ - drivers/net/wireless/ath/ath9k/eeprom_def.c | 41 +++++++++++++++------------- - drivers/net/wireless/ath/ath9k/xmit.c | 3 +- - 5 files changed, 52 insertions(+), 47 deletions(-) - ---- a/drivers/net/wireless/ath/ath9k/eeprom.h -+++ b/drivers/net/wireless/ath/ath9k/eeprom.h -@@ -99,7 +99,6 @@ - #define FBIN2FREQ(x, y) ((y) ? (2300 + x) : (4800 + 5 * x)) - #define ath9k_hw_use_flash(_ah) (!(_ah->ah_flags & AH_USE_EEPROM)) - --#define AR5416_VER_MASK (eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) - #define OLC_FOR_AR9280_20_LATER (AR_SREV_9280_20_OR_LATER(ah) && \ - ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)) - #define OLC_FOR_AR9287_10_LATER (AR_SREV_9287_11_OR_LATER(ah) && \ -@@ -121,6 +120,8 @@ - - #define AR5416_EEP_NO_BACK_VER 0x1 - #define AR5416_EEP_VER 0xE -+#define AR5416_EEP_VER_MAJOR_SHIFT 12 -+#define AR5416_EEP_VER_MAJOR_MASK 0xF000 - #define AR5416_EEP_VER_MINOR_MASK 0x0FFF - #define AR5416_EEP_MINOR_VER_2 0x2 - #define AR5416_EEP_MINOR_VER_3 0x3 -@@ -177,7 +178,6 @@ - #define AR9280_TX_GAIN_TABLE_SIZE 22 - - #define AR9287_EEP_VER 0xE --#define AR9287_EEP_VER_MINOR_MASK 0xFFF - #define AR9287_EEP_MINOR_VER_1 0x1 - #define AR9287_EEP_MINOR_VER_2 0x2 - #define AR9287_EEP_MINOR_VER_3 0x3 ---- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c -@@ -20,12 +20,17 @@ - - static int ath9k_hw_4k_get_eeprom_ver(struct ath_hw *ah) - { -- return ((ah->eeprom.map4k.baseEepHeader.version >> 12) & 0xF); -+ u16 version = ah->eeprom.map4k.baseEepHeader.version; -+ -+ return (version & AR5416_EEP_VER_MAJOR_MASK) >> -+ AR5416_EEP_VER_MAJOR_SHIFT; - } - - static int ath9k_hw_4k_get_eeprom_rev(struct ath_hw *ah) - { -- return ((ah->eeprom.map4k.baseEepHeader.version) & 0xFFF); -+ u16 version = ah->eeprom.map4k.baseEepHeader.version; -+ -+ return version & AR5416_EEP_VER_MINOR_MASK; - } - - #define SIZE_EEPROM_4K (sizeof(struct ar5416_eeprom_4k) / sizeof(u16)) -@@ -136,8 +141,8 @@ static u32 ath9k_hw_4k_dump_eeprom(struc - goto out; - } - -- PR_EEP("Major Version", pBase->version >> 12); -- PR_EEP("Minor Version", pBase->version & 0xFFF); -+ PR_EEP("Major Version", ath9k_hw_4k_get_eeprom_ver(ah)); -+ PR_EEP("Minor Version", ath9k_hw_4k_get_eeprom_rev(ah)); - PR_EEP("Checksum", pBase->checksum); - PR_EEP("Length", pBase->length); - PR_EEP("RegDomain1", pBase->regDmn[0]); -@@ -314,14 +319,12 @@ static void ath9k_hw_set_4k_power_cal_ta - - xpdMask = pEepData->modalHeader.xpdGain; - -- if ((pEepData->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= -- AR5416_EEP_MINOR_VER_2) { -+ if (ath9k_hw_4k_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_2) - pdGainOverlap_t2 = - pEepData->modalHeader.pdGainOverlap; -- } else { -+ else - pdGainOverlap_t2 = (u16)(MS(REG_READ(ah, AR_PHY_TPCRG5), - AR_PHY_TPCRG5_PD_GAIN_OVERLAP)); -- } - - pCalBChans = pEepData->calFreqPier2G; - numPiers = AR5416_EEP4K_NUM_2G_CAL_PIERS; -@@ -607,10 +610,8 @@ static void ath9k_hw_4k_set_txpower(stru - - memset(ratesArray, 0, sizeof(ratesArray)); - -- if ((pEepData->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= -- AR5416_EEP_MINOR_VER_2) { -+ if (ath9k_hw_4k_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_2) - ht40PowerIncForPdadc = pModal->ht40PowerIncForPdadc; -- } - - ath9k_hw_set_4k_power_per_rate_table(ah, chan, - &ratesArray[0], cfgCtl, -@@ -730,8 +731,7 @@ static void ath9k_hw_4k_set_gain(struct - SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF), - AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF); - -- if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= -- AR5416_EEP_MINOR_VER_3) { -+ if (ath9k_hw_4k_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_3) { - txRxAttenLocal = pModal->txRxAttenCh[0]; - - REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, -@@ -1009,16 +1009,14 @@ static void ath9k_hw_4k_set_board_values - REG_RMW_FIELD(ah, AR_PHY_EXT_CCA0, AR_PHY_EXT_CCA0_THRESH62, - pModal->thresh62); - -- if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= -- AR5416_EEP_MINOR_VER_2) { -+ if (ath9k_hw_4k_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_2) { - REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_END_DATA_START, - pModal->txFrameToDataStart); - REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_END_PA_ON, - pModal->txFrameToPaOn); - } - -- if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= -- AR5416_EEP_MINOR_VER_3) { -+ if (ath9k_hw_4k_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_3) { - if (IS_CHAN_HT40(chan)) - REG_RMW_FIELD(ah, AR_PHY_SETTLING, - AR_PHY_SETTLING_SWITCH, ---- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c -@@ -22,12 +22,17 @@ - - static int ath9k_hw_ar9287_get_eeprom_ver(struct ath_hw *ah) - { -- return (ah->eeprom.map9287.baseEepHeader.version >> 12) & 0xF; -+ u16 version = ah->eeprom.map9287.baseEepHeader.version; -+ -+ return (version & AR5416_EEP_VER_MAJOR_MASK) >> -+ AR5416_EEP_VER_MAJOR_SHIFT; - } - - static int ath9k_hw_ar9287_get_eeprom_rev(struct ath_hw *ah) - { -- return (ah->eeprom.map9287.baseEepHeader.version) & 0xFFF; -+ u16 version = ah->eeprom.map9287.baseEepHeader.version; -+ -+ return version & AR5416_EEP_VER_MINOR_MASK; - } - - static bool __ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah) -@@ -132,8 +137,8 @@ static u32 ath9k_hw_ar9287_dump_eeprom(s - goto out; - } - -- PR_EEP("Major Version", pBase->version >> 12); -- PR_EEP("Minor Version", pBase->version & 0xFFF); -+ PR_EEP("Major Version", ath9k_hw_ar9287_get_eeprom_ver(ah)); -+ PR_EEP("Minor Version", ath9k_hw_ar9287_get_eeprom_rev(ah)); - PR_EEP("Checksum", pBase->checksum); - PR_EEP("Length", pBase->length); - PR_EEP("RegDomain1", pBase->regDmn[0]); -@@ -383,8 +388,7 @@ static void ath9k_hw_set_ar9287_power_ca - - xpdMask = pEepData->modalHeader.xpdGain; - -- if ((pEepData->baseEepHeader.version & AR9287_EEP_VER_MINOR_MASK) >= -- AR9287_EEP_MINOR_VER_2) -+ if (ath9k_hw_ar9287_get_eeprom_rev(ah) >= AR9287_EEP_MINOR_VER_2) - pdGainOverlap_t2 = pEepData->modalHeader.pdGainOverlap; - else - pdGainOverlap_t2 = (u16)(MS(REG_READ(ah, AR_PHY_TPCRG5), -@@ -733,8 +737,7 @@ static void ath9k_hw_ar9287_set_txpower( - - memset(ratesArray, 0, sizeof(ratesArray)); - -- if ((pEepData->baseEepHeader.version & AR9287_EEP_VER_MINOR_MASK) >= -- AR9287_EEP_MINOR_VER_2) -+ if (ath9k_hw_ar9287_get_eeprom_rev(ah) >= AR9287_EEP_MINOR_VER_2) - ht40PowerIncForPdadc = pModal->ht40PowerIncForPdadc; - - ath9k_hw_set_ar9287_power_per_rate_table(ah, chan, ---- a/drivers/net/wireless/ath/ath9k/eeprom_def.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c -@@ -79,12 +79,17 @@ static void ath9k_olc_get_pdadcs(struct - - static int ath9k_hw_def_get_eeprom_ver(struct ath_hw *ah) - { -- return ((ah->eeprom.def.baseEepHeader.version >> 12) & 0xF); -+ u16 version = ah->eeprom.def.baseEepHeader.version; -+ -+ return (version & AR5416_EEP_VER_MAJOR_MASK) >> -+ AR5416_EEP_VER_MAJOR_SHIFT; - } - - static int ath9k_hw_def_get_eeprom_rev(struct ath_hw *ah) - { -- return ((ah->eeprom.def.baseEepHeader.version) & 0xFFF); -+ u16 version = ah->eeprom.def.baseEepHeader.version; -+ -+ return version & AR5416_EEP_VER_MINOR_MASK; - } - - #define SIZE_EEPROM_DEF (sizeof(struct ar5416_eeprom_def) / sizeof(u16)) -@@ -214,8 +219,8 @@ static u32 ath9k_hw_def_dump_eeprom(stru - goto out; - } - -- PR_EEP("Major Version", pBase->version >> 12); -- PR_EEP("Minor Version", pBase->version & 0xFFF); -+ PR_EEP("Major Version", ath9k_hw_def_get_eeprom_ver(ah)); -+ PR_EEP("Minor Version", ath9k_hw_def_get_eeprom_rev(ah)); - PR_EEP("Checksum", pBase->checksum); - PR_EEP("Length", pBase->length); - PR_EEP("RegDomain1", pBase->regDmn[0]); -@@ -391,27 +396,27 @@ static u32 ath9k_hw_def_get_eeprom(struc - case EEP_TXGAIN_TYPE: - return pBase->txGainType; - case EEP_OL_PWRCTRL: -- if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_19) -+ if (ath9k_hw_def_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_19) - return pBase->openLoopPwrCntl ? true : false; - else - return false; - case EEP_RC_CHAIN_MASK: -- if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_19) -+ if (ath9k_hw_def_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_19) - return pBase->rcChainMask; - else - return 0; - case EEP_DAC_HPWR_5G: -- if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_20) -+ if (ath9k_hw_def_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_20) - return pBase->dacHiPwrMode_5G; - else - return 0; - case EEP_FRAC_N_5G: -- if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_22) -+ if (ath9k_hw_def_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_22) - return pBase->frac_n_5g; - else - return 0; - case EEP_PWR_TABLE_OFFSET: -- if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_21) -+ if (ath9k_hw_def_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_21) - return pBase->pwr_table_offset; - else - return AR5416_PWR_TABLE_OFFSET_DB; -@@ -434,7 +439,7 @@ static void ath9k_hw_def_set_gain(struct - u8 txRxAttenLocal, int regChainOffset, int i) - { - ENABLE_REG_RMW_BUFFER(ah); -- if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) { -+ if (ath9k_hw_def_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_3) { - txRxAttenLocal = pModal->txRxAttenCh[i]; - - if (AR_SREV_9280_20_OR_LATER(ah)) { -@@ -603,7 +608,7 @@ static void ath9k_hw_def_set_board_value - pModal->thresh62); - } - -- if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_2) { -+ if (ath9k_hw_def_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_2) { - REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, - AR_PHY_TX_END_DATA_START, - pModal->txFrameToDataStart); -@@ -611,7 +616,7 @@ static void ath9k_hw_def_set_board_value - pModal->txFrameToPaOn); - } - -- if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) { -+ if (ath9k_hw_def_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_3) { - if (IS_CHAN_HT40(chan)) - REG_RMW_FIELD(ah, AR_PHY_SETTLING, - AR_PHY_SETTLING_SWITCH, -@@ -619,13 +624,14 @@ static void ath9k_hw_def_set_board_value - } - - if (AR_SREV_9280_20_OR_LATER(ah) && -- AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_19) -+ ath9k_hw_def_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_19) - REG_RMW_FIELD(ah, AR_PHY_CCK_TX_CTRL, - AR_PHY_CCK_TX_CTRL_TX_DAC_SCALE_CCK, - pModal->miscBits); - - -- if (AR_SREV_9280_20(ah) && AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_20) { -+ if (AR_SREV_9280_20(ah) && -+ ath9k_hw_def_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_20) { - if (IS_CHAN_2GHZ(chan)) - REG_RMW_FIELD(ah, AR_AN_TOP1, AR_AN_TOP1_DACIPMODE, - eep->baseEepHeader.dacLpMode); -@@ -796,8 +802,7 @@ static void ath9k_hw_set_def_power_cal_t - - pwr_table_offset = ah->eep_ops->get_eeprom(ah, EEP_PWR_TABLE_OFFSET); - -- if ((pEepData->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= -- AR5416_EEP_MINOR_VER_2) { -+ if (ath9k_hw_def_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_2) { - pdGainOverlap_t2 = - pEepData->modalHeader[modalIdx].pdGainOverlap; - } else { -@@ -1169,10 +1174,8 @@ static void ath9k_hw_def_set_txpower(str - - memset(ratesArray, 0, sizeof(ratesArray)); - -- if ((pEepData->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= -- AR5416_EEP_MINOR_VER_2) { -+ if (ath9k_hw_def_get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_2) - ht40PowerIncForPdadc = pModal->ht40PowerIncForPdadc; -- } - - ath9k_hw_set_def_power_per_rate_table(ah, chan, - &ratesArray[0], cfgCtl, ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -1177,8 +1177,9 @@ static u8 ath_get_rate_txpower(struct at - if (is_40) { - u8 power_ht40delta; - struct ar5416_eeprom_def *eep = &ah->eeprom.def; -+ u16 eeprom_rev = ah->eep_ops->get_eeprom_rev(ah); - -- if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_2) { -+ if (eeprom_rev >= AR5416_EEP_MINOR_VER_2) { - bool is_2ghz; - struct modal_eep_header *pmodal; - diff --git a/package/kernel/mac80211/patches/555-ath9k-Make-the-EEPROM-swapping-check-use-the-eepmisc.patch b/package/kernel/mac80211/patches/555-ath9k-Make-the-EEPROM-swapping-check-use-the-eepmisc.patch deleted file mode 100644 index 3e3c2ea7a3..0000000000 --- a/package/kernel/mac80211/patches/555-ath9k-Make-the-EEPROM-swapping-check-use-the-eepmisc.patch +++ /dev/null @@ -1,128 +0,0 @@ -From 1f796f9265c10384a274ac330f671ef4ac6d56e5 Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Mon, 3 Oct 2016 00:29:12 +0200 -Subject: [v2 PATCH 6/7] ath9k: Make the EEPROM swapping check use the eepmisc - register - -There are two ways of swapping the EEPROM data in the ath9k driver: -1) swab16 based on the first two EEPROM "magic" bytes (same for all - EEPROM formats) -2) field and EEPROM format specific swab16/swab32 (different for - eeprom_def, eeprom_4k and eeprom_9287) - -The result of the first check was used to also enable the second swap. -This behavior seems incorrect, since the data may only be byte-swapped -(afterwards the data could be in the correct endianness). -Thus we introduce a separate check based on the "eepmisc" register -(which is part of the EEPROM data). When bit 0 is set, then the EEPROM -format specific values are in "big endian". This is also done by the -FreeBSD kernel, see [0] for example. - -This allows us to parse EEPROMs with the "correct" magic bytes but -swapped EEPROM format specific values. These EEPROMs (mostly found in -lantiq and broadcom based big endian MIPS based devices) only worked -due to platform specific "hacks" which swapped the EEPROM so the -magic was inverted, which also enabled the format specific swapping. -With this patch the old behavior is still supported, but neither -recommended nor needed anymore. - -[0] -https://github.com/freebsd/freebsd/blob/50719b56d9ce8d7d4beb53b16e9edb2e9a4a7a18/sys/dev/ath/ath_hal/ah_eeprom_9287.c#L351 - -Signed-off-by: Martin Blumenstingl ---- - drivers/net/wireless/ath/ath9k/eeprom.c | 57 ++++++++++++++++++++++++--------- - 1 file changed, 41 insertions(+), 16 deletions(-) - ---- a/drivers/net/wireless/ath/ath9k/eeprom.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom.c -@@ -155,11 +155,19 @@ bool ath9k_hw_nvram_read(struct ath_hw * - return ret; - } - -+#ifdef __BIG_ENDIAN -+#define EXPECTED_EEPMISC_ENDIAN AR5416_EEPMISC_BIG_ENDIAN -+#else -+#define EXPECTED_EEPMISC_ENDIAN 0 -+#endif -+ - int ath9k_hw_nvram_swap_data(struct ath_hw *ah, bool *swap_needed, int size) - { - u16 magic; - u16 *eepdata; -+ u8 eepmisc; - int i; -+ bool needs_byteswap = false; - struct ath_common *common = ath9k_hw_common(ah); - - if (!ath9k_hw_nvram_read(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) { -@@ -167,36 +175,53 @@ int ath9k_hw_nvram_swap_data(struct ath_ - return -EIO; - } - -- *swap_needed = false; - if (swab16(magic) == AR5416_EEPROM_MAGIC) { -+ needs_byteswap = true; -+ ath_dbg(common, EEPROM, -+ "EEPROM needs byte-swapping to correct endianness.\n"); -+ } else if (magic != AR5416_EEPROM_MAGIC) { -+ if (ath9k_hw_use_flash(ah)) { -+ ath_dbg(common, EEPROM, -+ "Ignoring invalid EEPROM magic (0x%04x).\n", -+ magic); -+ } else { -+ ath_err(common, -+ "Invalid EEPROM magic (0x%04x).\n", magic); -+ return -EINVAL; -+ } -+ } -+ -+ if (needs_byteswap) { - if (ah->ah_flags & AH_NO_EEP_SWAP) { - ath_info(common, - "Ignoring endianness difference in EEPROM magic bytes.\n"); - } else { -- *swap_needed = true; -- } -- } else if (magic != AR5416_EEPROM_MAGIC) { -- if (ath9k_hw_use_flash(ah)) -- return 0; -+ eepdata = (u16 *)(&ah->eeprom); - -- ath_err(common, -- "Invalid EEPROM Magic (0x%04x).\n", magic); -- return -EINVAL; -+ for (i = 0; i < size; i++) -+ eepdata[i] = swab16(eepdata[i]); -+ } - } - -- eepdata = (u16 *)(&ah->eeprom); -- -- if (*swap_needed) { -- ath_dbg(common, EEPROM, -- "EEPROM Endianness is not native.. Changing.\n"); -+ *swap_needed = false; - -- for (i = 0; i < size; i++) -- eepdata[i] = swab16(eepdata[i]); -+ eepmisc = ah->eep_ops->get_eepmisc(ah); -+ if ((eepmisc & AR5416_EEPMISC_BIG_ENDIAN) != EXPECTED_EEPMISC_ENDIAN) { -+ if (ah->ah_flags & AH_NO_EEP_SWAP) { -+ ath_info(common, -+ "Ignoring endianness difference in eepmisc register.\n"); -+ } else { -+ *swap_needed = true; -+ ath_dbg(common, EEPROM, -+ "EEPROM needs swapping according to the eepmisc register.\n"); -+ } - } - - return 0; - } - -+#undef EXPECTED_EEPMISC_VAL -+ - bool ath9k_hw_nvram_validate_checksum(struct ath_hw *ah, int size) - { - u32 i, sum = 0; diff --git a/package/kernel/mac80211/patches/556-ath9k-define-all-EEPROM-fields-in-Little-Endian-form.patch b/package/kernel/mac80211/patches/556-ath9k-define-all-EEPROM-fields-in-Little-Endian-form.patch deleted file mode 100644 index 292ea8a558..0000000000 --- a/package/kernel/mac80211/patches/556-ath9k-define-all-EEPROM-fields-in-Little-Endian-form.patch +++ /dev/null @@ -1,849 +0,0 @@ -From 7e1047f3cf8dcdb4825f3c785f7f708d07508096 Mon Sep 17 00:00:00 2001 -From: Martin Blumenstingl -Date: Mon, 3 Oct 2016 00:29:13 +0200 -Subject: [v2 PATCH 7/7] ath9k: define all EEPROM fields in Little Endian format - -The ar9300_eeprom logic is already using only 8-bit (endian neutral), -__le16 and __le32 fields to state explicitly how the values should be -interpreted. -All other EEPROM implementations (4k, 9287 and def) were using u16 and -u32 fields with additional logic to swap the values (read from the -original EEPROM) so they match the current CPUs endianness. - -The EEPROM format defaults to "all values are Little Endian", indicated -by the absence of the AR5416_EEPMISC_BIG_ENDIAN in the u8 EEPMISC -register. If we detect that the EEPROM indicates Big Endian mode -(AR5416_EEPMISC_BIG_ENDIAN is set in the EEPMISC register) then we'll -swap the values to convert them into Little Endian. This is done by -activating the EEPMISC based logic in ath9k_hw_nvram_swap_data even if -AH_NO_EEP_SWAP is set (this makes ath9k behave like the FreeBSD driver, -which also does not have a flag to enable swapping based on the -AR5416_EEPMISC_BIG_ENDIAN bit). Before this logic was only used to -enable swapping when "current CPU endianness != EEPROM endianness". - -After changing all relevant fields to __le16 and __le32 sparse was used -to check that all code which reads any of these fields uses -le{16,32}_to_cpu. - -Signed-off-by: Martin Blumenstingl ---- - drivers/net/wireless/ath/ath9k/eeprom.c | 27 ++----- - drivers/net/wireless/ath/ath9k/eeprom.h | 75 ++++++++++-------- - drivers/net/wireless/ath/ath9k/eeprom_4k.c | 94 +++++++++------------- - drivers/net/wireless/ath/ath9k/eeprom_9287.c | 98 ++++++++++------------- - drivers/net/wireless/ath/ath9k/eeprom_def.c | 114 ++++++++++++--------------- - 5 files changed, 174 insertions(+), 234 deletions(-) - ---- a/drivers/net/wireless/ath/ath9k/eeprom.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom.c -@@ -155,17 +155,10 @@ bool ath9k_hw_nvram_read(struct ath_hw * - return ret; - } - --#ifdef __BIG_ENDIAN --#define EXPECTED_EEPMISC_ENDIAN AR5416_EEPMISC_BIG_ENDIAN --#else --#define EXPECTED_EEPMISC_ENDIAN 0 --#endif -- - int ath9k_hw_nvram_swap_data(struct ath_hw *ah, bool *swap_needed, int size) - { - u16 magic; - u16 *eepdata; -- u8 eepmisc; - int i; - bool needs_byteswap = false; - struct ath_common *common = ath9k_hw_common(ah); -@@ -203,25 +196,17 @@ int ath9k_hw_nvram_swap_data(struct ath_ - } - } - -- *swap_needed = false; -- -- eepmisc = ah->eep_ops->get_eepmisc(ah); -- if ((eepmisc & AR5416_EEPMISC_BIG_ENDIAN) != EXPECTED_EEPMISC_ENDIAN) { -- if (ah->ah_flags & AH_NO_EEP_SWAP) { -- ath_info(common, -- "Ignoring endianness difference in eepmisc register.\n"); -- } else { -- *swap_needed = true; -- ath_dbg(common, EEPROM, -- "EEPROM needs swapping according to the eepmisc register.\n"); -- } -+ if (ah->eep_ops->get_eepmisc(ah) & AR5416_EEPMISC_BIG_ENDIAN) { -+ *swap_needed = true; -+ ath_dbg(common, EEPROM, -+ "Big Endian EEPROM detected according to EEPMISC register.\n"); -+ } else { -+ *swap_needed = false; - } - - return 0; - } - --#undef EXPECTED_EEPMISC_VAL -- - bool ath9k_hw_nvram_validate_checksum(struct ath_hw *ah, int size) - { - u32 i, sum = 0; ---- a/drivers/net/wireless/ath/ath9k/eeprom.h -+++ b/drivers/net/wireless/ath/ath9k/eeprom.h -@@ -23,6 +23,17 @@ - #include - #include "ar9003_eeprom.h" - -+/* helpers to swap EEPROM fields, which are stored as __le16 or __le32. Since -+ * we are 100% sure about it we __force these to u16/u32 for the swab calls to -+ * silence the sparse checks. These macros are used when we have a Big Endian -+ * EEPROM (according to AR5416_EEPMISC_BIG_ENDIAN) and need to convert the -+ * fields to __le16/__le32. -+ */ -+#define EEPROM_FIELD_SWAB16(field) \ -+ (field = (__force __le16)swab16((__force u16)field)) -+#define EEPROM_FIELD_SWAB32(field) \ -+ (field = (__force __le32)swab32((__force u32)field)) -+ - #ifdef __BIG_ENDIAN - #define AR5416_EEPROM_MAGIC 0x5aa5 - #else -@@ -270,19 +281,19 @@ enum ath9k_hal_freq_band { - }; - - struct base_eep_header { -- u16 length; -- u16 checksum; -- u16 version; -+ __le16 length; -+ __le16 checksum; -+ __le16 version; - u8 opCapFlags; - u8 eepMisc; -- u16 regDmn[2]; -+ __le16 regDmn[2]; - u8 macAddr[6]; - u8 rxMask; - u8 txMask; -- u16 rfSilent; -- u16 blueToothOptions; -- u16 deviceCap; -- u32 binBuildNumber; -+ __le16 rfSilent; -+ __le16 blueToothOptions; -+ __le16 deviceCap; -+ __le32 binBuildNumber; - u8 deviceType; - u8 pwdclkind; - u8 fastClk5g; -@@ -300,33 +311,33 @@ struct base_eep_header { - } __packed; - - struct base_eep_header_4k { -- u16 length; -- u16 checksum; -- u16 version; -+ __le16 length; -+ __le16 checksum; -+ __le16 version; - u8 opCapFlags; - u8 eepMisc; -- u16 regDmn[2]; -+ __le16 regDmn[2]; - u8 macAddr[6]; - u8 rxMask; - u8 txMask; -- u16 rfSilent; -- u16 blueToothOptions; -- u16 deviceCap; -- u32 binBuildNumber; -+ __le16 rfSilent; -+ __le16 blueToothOptions; -+ __le16 deviceCap; -+ __le32 binBuildNumber; - u8 deviceType; - u8 txGainType; - } __packed; - - - struct spur_chan { -- u16 spurChan; -+ __le16 spurChan; - u8 spurRangeLow; - u8 spurRangeHigh; - } __packed; - - struct modal_eep_header { -- u32 antCtrlChain[AR5416_MAX_CHAINS]; -- u32 antCtrlCommon; -+ __le32 antCtrlChain[AR5416_MAX_CHAINS]; -+ __le32 antCtrlCommon; - u8 antennaGainCh[AR5416_MAX_CHAINS]; - u8 switchSettling; - u8 txRxAttenCh[AR5416_MAX_CHAINS]; -@@ -361,7 +372,7 @@ struct modal_eep_header { - u8 db_ch1; - u8 lna_ctl; - u8 miscBits; -- u16 xpaBiasLvlFreq[3]; -+ __le16 xpaBiasLvlFreq[3]; - u8 futureModal[6]; - - struct spur_chan spurChans[AR_EEPROM_MODAL_SPURS]; -@@ -375,8 +386,8 @@ struct calDataPerFreqOpLoop { - } __packed; - - struct modal_eep_4k_header { -- u32 antCtrlChain[AR5416_EEP4K_MAX_CHAINS]; -- u32 antCtrlCommon; -+ __le32 antCtrlChain[AR5416_EEP4K_MAX_CHAINS]; -+ __le32 antCtrlCommon; - u8 antennaGainCh[AR5416_EEP4K_MAX_CHAINS]; - u8 switchSettling; - u8 txRxAttenCh[AR5416_EEP4K_MAX_CHAINS]; -@@ -440,19 +451,19 @@ struct modal_eep_4k_header { - } __packed; - - struct base_eep_ar9287_header { -- u16 length; -- u16 checksum; -- u16 version; -+ __le16 length; -+ __le16 checksum; -+ __le16 version; - u8 opCapFlags; - u8 eepMisc; -- u16 regDmn[2]; -+ __le16 regDmn[2]; - u8 macAddr[6]; - u8 rxMask; - u8 txMask; -- u16 rfSilent; -- u16 blueToothOptions; -- u16 deviceCap; -- u32 binBuildNumber; -+ __le16 rfSilent; -+ __le16 blueToothOptions; -+ __le16 deviceCap; -+ __le32 binBuildNumber; - u8 deviceType; - u8 openLoopPwrCntl; - int8_t pwrTableOffset; -@@ -462,8 +473,8 @@ struct base_eep_ar9287_header { - } __packed; - - struct modal_eep_ar9287_header { -- u32 antCtrlChain[AR9287_MAX_CHAINS]; -- u32 antCtrlCommon; -+ __le32 antCtrlChain[AR9287_MAX_CHAINS]; -+ __le32 antCtrlCommon; - int8_t antennaGainCh[AR9287_MAX_CHAINS]; - u8 switchSettling; - u8 txRxAttenCh[AR9287_MAX_CHAINS]; ---- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c -@@ -20,7 +20,7 @@ - - static int ath9k_hw_4k_get_eeprom_ver(struct ath_hw *ah) - { -- u16 version = ah->eeprom.map4k.baseEepHeader.version; -+ u16 version = le16_to_cpu(ah->eeprom.map4k.baseEepHeader.version); - - return (version & AR5416_EEP_VER_MAJOR_MASK) >> - AR5416_EEP_VER_MAJOR_SHIFT; -@@ -28,7 +28,7 @@ static int ath9k_hw_4k_get_eeprom_ver(st - - static int ath9k_hw_4k_get_eeprom_rev(struct ath_hw *ah) - { -- u16 version = ah->eeprom.map4k.baseEepHeader.version; -+ u16 version = le16_to_cpu(ah->eeprom.map4k.baseEepHeader.version); - - return version & AR5416_EEP_VER_MINOR_MASK; - } -@@ -76,8 +76,8 @@ static bool ath9k_hw_4k_fill_eeprom(stru - static u32 ath9k_dump_4k_modal_eeprom(char *buf, u32 len, u32 size, - struct modal_eep_4k_header *modal_hdr) - { -- PR_EEP("Chain0 Ant. Control", modal_hdr->antCtrlChain[0]); -- PR_EEP("Ant. Common Control", modal_hdr->antCtrlCommon); -+ PR_EEP("Chain0 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[0])); -+ PR_EEP("Ant. Common Control", le32_to_cpu(modal_hdr->antCtrlCommon)); - PR_EEP("Chain0 Ant. Gain", modal_hdr->antennaGainCh[0]); - PR_EEP("Switch Settle", modal_hdr->switchSettling); - PR_EEP("Chain0 TxRxAtten", modal_hdr->txRxAttenCh[0]); -@@ -132,6 +132,7 @@ static u32 ath9k_hw_4k_dump_eeprom(struc - { - struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k; - struct base_eep_header_4k *pBase = &eep->baseEepHeader; -+ u32 binBuildNumber = le32_to_cpu(pBase->binBuildNumber); - - if (!dump_base_hdr) { - len += scnprintf(buf + len, size - len, -@@ -143,10 +144,10 @@ static u32 ath9k_hw_4k_dump_eeprom(struc - - PR_EEP("Major Version", ath9k_hw_4k_get_eeprom_ver(ah)); - PR_EEP("Minor Version", ath9k_hw_4k_get_eeprom_rev(ah)); -- PR_EEP("Checksum", pBase->checksum); -- PR_EEP("Length", pBase->length); -- PR_EEP("RegDomain1", pBase->regDmn[0]); -- PR_EEP("RegDomain2", pBase->regDmn[1]); -+ PR_EEP("Checksum", le16_to_cpu(pBase->checksum)); -+ PR_EEP("Length", le16_to_cpu(pBase->length)); -+ PR_EEP("RegDomain1", le16_to_cpu(pBase->regDmn[0])); -+ PR_EEP("RegDomain2", le16_to_cpu(pBase->regDmn[1])); - PR_EEP("TX Mask", pBase->txMask); - PR_EEP("RX Mask", pBase->rxMask); - PR_EEP("Allow 5GHz", !!(pBase->opCapFlags & AR5416_OPFLAGS_11A)); -@@ -160,9 +161,9 @@ static u32 ath9k_hw_4k_dump_eeprom(struc - PR_EEP("Disable 5Ghz HT40", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_5G_HT40)); - PR_EEP("Big Endian", !!(pBase->eepMisc & AR5416_EEPMISC_BIG_ENDIAN)); -- PR_EEP("Cal Bin Major Ver", (pBase->binBuildNumber >> 24) & 0xFF); -- PR_EEP("Cal Bin Minor Ver", (pBase->binBuildNumber >> 16) & 0xFF); -- PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF); -+ PR_EEP("Cal Bin Major Ver", (binBuildNumber >> 24) & 0xFF); -+ PR_EEP("Cal Bin Minor Ver", (binBuildNumber >> 16) & 0xFF); -+ PR_EEP("Cal Bin Build", (binBuildNumber >> 8) & 0xFF); - PR_EEP("TX Gain type", pBase->txGainType); - - len += scnprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", -@@ -194,54 +195,31 @@ static int ath9k_hw_4k_check_eeprom(stru - return err; - - if (need_swap) -- el = swab16(eep->baseEepHeader.length); -+ el = swab16((__force u16)eep->baseEepHeader.length); - else -- el = eep->baseEepHeader.length; -+ el = le16_to_cpu(eep->baseEepHeader.length); - - el = min(el / sizeof(u16), SIZE_EEPROM_4K); - if (!ath9k_hw_nvram_validate_checksum(ah, el)) - return -EINVAL; - - if (need_swap) { -- u32 integer; -- u16 word; -- -- word = swab16(eep->baseEepHeader.length); -- eep->baseEepHeader.length = word; -- -- word = swab16(eep->baseEepHeader.checksum); -- eep->baseEepHeader.checksum = word; -- -- word = swab16(eep->baseEepHeader.version); -- eep->baseEepHeader.version = word; -- -- word = swab16(eep->baseEepHeader.regDmn[0]); -- eep->baseEepHeader.regDmn[0] = word; -- -- word = swab16(eep->baseEepHeader.regDmn[1]); -- eep->baseEepHeader.regDmn[1] = word; -- -- word = swab16(eep->baseEepHeader.rfSilent); -- eep->baseEepHeader.rfSilent = word; -- -- word = swab16(eep->baseEepHeader.blueToothOptions); -- eep->baseEepHeader.blueToothOptions = word; -- -- word = swab16(eep->baseEepHeader.deviceCap); -- eep->baseEepHeader.deviceCap = word; -- -- integer = swab32(eep->modalHeader.antCtrlCommon); -- eep->modalHeader.antCtrlCommon = integer; -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.length); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.checksum); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.version); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.regDmn[0]); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.regDmn[1]); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.rfSilent); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.blueToothOptions); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.deviceCap); -+ EEPROM_FIELD_SWAB32(eep->modalHeader.antCtrlCommon); - -- for (i = 0; i < AR5416_EEP4K_MAX_CHAINS; i++) { -- integer = swab32(eep->modalHeader.antCtrlChain[i]); -- eep->modalHeader.antCtrlChain[i] = integer; -- } -+ for (i = 0; i < AR5416_EEP4K_MAX_CHAINS; i++) -+ EEPROM_FIELD_SWAB32(eep->modalHeader.antCtrlChain[i]); - -- for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) { -- word = swab16(eep->modalHeader.spurChans[i].spurChan); -- eep->modalHeader.spurChans[i].spurChan = word; -- } -+ for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) -+ EEPROM_FIELD_SWAB16( -+ eep->modalHeader.spurChans[i].spurChan); - } - - if (!ath9k_hw_nvram_check_version(ah, AR5416_EEP_VER, -@@ -270,13 +248,13 @@ static u32 ath9k_hw_4k_get_eeprom(struct - case EEP_MAC_MSW: - return get_unaligned_be16(pBase->macAddr + 4); - case EEP_REG_0: -- return pBase->regDmn[0]; -+ return le16_to_cpu(pBase->regDmn[0]); - case EEP_OP_CAP: -- return pBase->deviceCap; -+ return le16_to_cpu(pBase->deviceCap); - case EEP_OP_MODE: - return pBase->opCapFlags; - case EEP_RF_SILENT: -- return pBase->rfSilent; -+ return le16_to_cpu(pBase->rfSilent); - case EEP_OB_2: - return pModal->ob_0; - case EEP_DB_2: -@@ -724,7 +702,7 @@ static void ath9k_hw_4k_set_gain(struct - { - ENABLE_REG_RMW_BUFFER(ah); - REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, -- pModal->antCtrlChain[0], 0); -+ le32_to_cpu(pModal->antCtrlChain[0]), 0); - - REG_RMW(ah, AR_PHY_TIMING_CTRL4(0), - SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | -@@ -790,7 +768,7 @@ static void ath9k_hw_4k_set_board_values - pModal = &eep->modalHeader; - txRxAttenLocal = 23; - -- REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon); -+ REG_WRITE(ah, AR_PHY_SWITCH_COM, le32_to_cpu(pModal->antCtrlCommon)); - - /* Single chain for 4K EEPROM*/ - ath9k_hw_4k_set_gain(ah, pModal, eep, txRxAttenLocal); -@@ -1054,7 +1032,7 @@ static void ath9k_hw_4k_set_board_values - - static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz) - { -- return ah->eeprom.map4k.modalHeader.spurChans[i].spurChan; -+ return le16_to_cpu(ah->eeprom.map4k.modalHeader.spurChans[i].spurChan); - } - - static u8 ath9k_hw_4k_get_eepmisc(struct ath_hw *ah) ---- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c -@@ -22,7 +22,7 @@ - - static int ath9k_hw_ar9287_get_eeprom_ver(struct ath_hw *ah) - { -- u16 version = ah->eeprom.map9287.baseEepHeader.version; -+ u16 version = le16_to_cpu(ah->eeprom.map9287.baseEepHeader.version); - - return (version & AR5416_EEP_VER_MAJOR_MASK) >> - AR5416_EEP_VER_MAJOR_SHIFT; -@@ -30,7 +30,7 @@ static int ath9k_hw_ar9287_get_eeprom_ve - - static int ath9k_hw_ar9287_get_eeprom_rev(struct ath_hw *ah) - { -- u16 version = ah->eeprom.map9287.baseEepHeader.version; -+ u16 version = le16_to_cpu(ah->eeprom.map9287.baseEepHeader.version); - - return version & AR5416_EEP_VER_MINOR_MASK; - } -@@ -79,9 +79,9 @@ static bool ath9k_hw_ar9287_fill_eeprom( - static u32 ar9287_dump_modal_eeprom(char *buf, u32 len, u32 size, - struct modal_eep_ar9287_header *modal_hdr) - { -- PR_EEP("Chain0 Ant. Control", modal_hdr->antCtrlChain[0]); -- PR_EEP("Chain1 Ant. Control", modal_hdr->antCtrlChain[1]); -- PR_EEP("Ant. Common Control", modal_hdr->antCtrlCommon); -+ PR_EEP("Chain0 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[0])); -+ PR_EEP("Chain1 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[1])); -+ PR_EEP("Ant. Common Control", le32_to_cpu(modal_hdr->antCtrlCommon)); - PR_EEP("Chain0 Ant. Gain", modal_hdr->antennaGainCh[0]); - PR_EEP("Chain1 Ant. Gain", modal_hdr->antennaGainCh[1]); - PR_EEP("Switch Settle", modal_hdr->switchSettling); -@@ -128,6 +128,7 @@ static u32 ath9k_hw_ar9287_dump_eeprom(s - { - struct ar9287_eeprom *eep = &ah->eeprom.map9287; - struct base_eep_ar9287_header *pBase = &eep->baseEepHeader; -+ u32 binBuildNumber = le32_to_cpu(pBase->binBuildNumber); - - if (!dump_base_hdr) { - len += scnprintf(buf + len, size - len, -@@ -139,10 +140,10 @@ static u32 ath9k_hw_ar9287_dump_eeprom(s - - PR_EEP("Major Version", ath9k_hw_ar9287_get_eeprom_ver(ah)); - PR_EEP("Minor Version", ath9k_hw_ar9287_get_eeprom_rev(ah)); -- PR_EEP("Checksum", pBase->checksum); -- PR_EEP("Length", pBase->length); -- PR_EEP("RegDomain1", pBase->regDmn[0]); -- PR_EEP("RegDomain2", pBase->regDmn[1]); -+ PR_EEP("Checksum", le16_to_cpu(pBase->checksum)); -+ PR_EEP("Length", le16_to_cpu(pBase->length)); -+ PR_EEP("RegDomain1", le16_to_cpu(pBase->regDmn[0])); -+ PR_EEP("RegDomain2", le16_to_cpu(pBase->regDmn[1])); - PR_EEP("TX Mask", pBase->txMask); - PR_EEP("RX Mask", pBase->rxMask); - PR_EEP("Allow 5GHz", !!(pBase->opCapFlags & AR5416_OPFLAGS_11A)); -@@ -156,9 +157,9 @@ static u32 ath9k_hw_ar9287_dump_eeprom(s - PR_EEP("Disable 5Ghz HT40", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_5G_HT40)); - PR_EEP("Big Endian", !!(pBase->eepMisc & AR5416_EEPMISC_BIG_ENDIAN)); -- PR_EEP("Cal Bin Major Ver", (pBase->binBuildNumber >> 24) & 0xFF); -- PR_EEP("Cal Bin Minor Ver", (pBase->binBuildNumber >> 16) & 0xFF); -- PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF); -+ PR_EEP("Cal Bin Major Ver", (binBuildNumber >> 24) & 0xFF); -+ PR_EEP("Cal Bin Minor Ver", (binBuildNumber >> 16) & 0xFF); -+ PR_EEP("Cal Bin Build", (binBuildNumber >> 8) & 0xFF); - PR_EEP("Power Table Offset", pBase->pwrTableOffset); - PR_EEP("OpenLoop Power Ctrl", pBase->openLoopPwrCntl); - -@@ -182,8 +183,7 @@ static u32 ath9k_hw_ar9287_dump_eeprom(s - - static int ath9k_hw_ar9287_check_eeprom(struct ath_hw *ah) - { -- u32 el, integer; -- u16 word; -+ u32 el; - int i, err; - bool need_swap; - struct ar9287_eeprom *eep = &ah->eeprom.map9287; -@@ -193,51 +193,31 @@ static int ath9k_hw_ar9287_check_eeprom( - return err; - - if (need_swap) -- el = swab16(eep->baseEepHeader.length); -+ el = swab16((__force u16)eep->baseEepHeader.length); - else -- el = eep->baseEepHeader.length; -+ el = le16_to_cpu(eep->baseEepHeader.length); - - el = min(el / sizeof(u16), SIZE_EEPROM_AR9287); - if (!ath9k_hw_nvram_validate_checksum(ah, el)) - return -EINVAL; - - if (need_swap) { -- word = swab16(eep->baseEepHeader.length); -- eep->baseEepHeader.length = word; -- -- word = swab16(eep->baseEepHeader.checksum); -- eep->baseEepHeader.checksum = word; -- -- word = swab16(eep->baseEepHeader.version); -- eep->baseEepHeader.version = word; -- -- word = swab16(eep->baseEepHeader.regDmn[0]); -- eep->baseEepHeader.regDmn[0] = word; -- -- word = swab16(eep->baseEepHeader.regDmn[1]); -- eep->baseEepHeader.regDmn[1] = word; -- -- word = swab16(eep->baseEepHeader.rfSilent); -- eep->baseEepHeader.rfSilent = word; -- -- word = swab16(eep->baseEepHeader.blueToothOptions); -- eep->baseEepHeader.blueToothOptions = word; -- -- word = swab16(eep->baseEepHeader.deviceCap); -- eep->baseEepHeader.deviceCap = word; -- -- integer = swab32(eep->modalHeader.antCtrlCommon); -- eep->modalHeader.antCtrlCommon = integer; -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.length); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.checksum); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.version); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.regDmn[0]); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.regDmn[1]); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.rfSilent); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.blueToothOptions); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.deviceCap); -+ EEPROM_FIELD_SWAB32(eep->modalHeader.antCtrlCommon); - -- for (i = 0; i < AR9287_MAX_CHAINS; i++) { -- integer = swab32(eep->modalHeader.antCtrlChain[i]); -- eep->modalHeader.antCtrlChain[i] = integer; -- } -+ for (i = 0; i < AR9287_MAX_CHAINS; i++) -+ EEPROM_FIELD_SWAB32(eep->modalHeader.antCtrlChain[i]); - -- for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) { -- word = swab16(eep->modalHeader.spurChans[i].spurChan); -- eep->modalHeader.spurChans[i].spurChan = word; -- } -+ for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) -+ EEPROM_FIELD_SWAB16( -+ eep->modalHeader.spurChans[i].spurChan); - } - - if (!ath9k_hw_nvram_check_version(ah, AR9287_EEP_VER, -@@ -267,13 +247,13 @@ static u32 ath9k_hw_ar9287_get_eeprom(st - case EEP_MAC_MSW: - return get_unaligned_be16(pBase->macAddr + 4); - case EEP_REG_0: -- return pBase->regDmn[0]; -+ return le16_to_cpu(pBase->regDmn[0]); - case EEP_OP_CAP: -- return pBase->deviceCap; -+ return le16_to_cpu(pBase->deviceCap); - case EEP_OP_MODE: - return pBase->opCapFlags; - case EEP_RF_SILENT: -- return pBase->rfSilent; -+ return le16_to_cpu(pBase->rfSilent); - case EEP_TX_MASK: - return pBase->txMask; - case EEP_RX_MASK: -@@ -878,13 +858,13 @@ static void ath9k_hw_ar9287_set_board_va - - pModal = &eep->modalHeader; - -- REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon); -+ REG_WRITE(ah, AR_PHY_SWITCH_COM, le32_to_cpu(pModal->antCtrlCommon)); - - for (i = 0; i < AR9287_MAX_CHAINS; i++) { - regChainOffset = i * 0x1000; - - REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0 + regChainOffset, -- pModal->antCtrlChain[i]); -+ le32_to_cpu(pModal->antCtrlChain[i])); - - REG_WRITE(ah, AR_PHY_TIMING_CTRL4(0) + regChainOffset, - (REG_READ(ah, AR_PHY_TIMING_CTRL4(0) + regChainOffset) -@@ -982,7 +962,9 @@ static void ath9k_hw_ar9287_set_board_va - static u16 ath9k_hw_ar9287_get_spur_channel(struct ath_hw *ah, - u16 i, bool is2GHz) - { -- return ah->eeprom.map9287.modalHeader.spurChans[i].spurChan; -+ __le16 spur_ch = ah->eeprom.map9287.modalHeader.spurChans[i].spurChan; -+ -+ return le16_to_cpu(spur_ch); - } - - static u8 ath9k_hw_ar9287_get_eepmisc(struct ath_hw *ah) ---- a/drivers/net/wireless/ath/ath9k/eeprom_def.c -+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c -@@ -79,7 +79,7 @@ static void ath9k_olc_get_pdadcs(struct - - static int ath9k_hw_def_get_eeprom_ver(struct ath_hw *ah) - { -- u16 version = ah->eeprom.def.baseEepHeader.version; -+ u16 version = le16_to_cpu(ah->eeprom.def.baseEepHeader.version); - - return (version & AR5416_EEP_VER_MAJOR_MASK) >> - AR5416_EEP_VER_MAJOR_SHIFT; -@@ -87,7 +87,7 @@ static int ath9k_hw_def_get_eeprom_ver(s - - static int ath9k_hw_def_get_eeprom_rev(struct ath_hw *ah) - { -- u16 version = ah->eeprom.def.baseEepHeader.version; -+ u16 version = le16_to_cpu(ah->eeprom.def.baseEepHeader.version); - - return version & AR5416_EEP_VER_MINOR_MASK; - } -@@ -135,10 +135,10 @@ static bool ath9k_hw_def_fill_eeprom(str - static u32 ath9k_def_dump_modal_eeprom(char *buf, u32 len, u32 size, - struct modal_eep_header *modal_hdr) - { -- PR_EEP("Chain0 Ant. Control", modal_hdr->antCtrlChain[0]); -- PR_EEP("Chain1 Ant. Control", modal_hdr->antCtrlChain[1]); -- PR_EEP("Chain2 Ant. Control", modal_hdr->antCtrlChain[2]); -- PR_EEP("Ant. Common Control", modal_hdr->antCtrlCommon); -+ PR_EEP("Chain0 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[0])); -+ PR_EEP("Chain1 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[1])); -+ PR_EEP("Chain2 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[2])); -+ PR_EEP("Ant. Common Control", le32_to_cpu(modal_hdr->antCtrlCommon)); - PR_EEP("Chain0 Ant. Gain", modal_hdr->antennaGainCh[0]); - PR_EEP("Chain1 Ant. Gain", modal_hdr->antennaGainCh[1]); - PR_EEP("Chain2 Ant. Gain", modal_hdr->antennaGainCh[2]); -@@ -194,9 +194,9 @@ static u32 ath9k_def_dump_modal_eeprom(c - PR_EEP("Chain1 OutputBias", modal_hdr->ob_ch1); - PR_EEP("Chain1 DriverBias", modal_hdr->db_ch1); - PR_EEP("LNA Control", modal_hdr->lna_ctl); -- PR_EEP("XPA Bias Freq0", modal_hdr->xpaBiasLvlFreq[0]); -- PR_EEP("XPA Bias Freq1", modal_hdr->xpaBiasLvlFreq[1]); -- PR_EEP("XPA Bias Freq2", modal_hdr->xpaBiasLvlFreq[2]); -+ PR_EEP("XPA Bias Freq0", le16_to_cpu(modal_hdr->xpaBiasLvlFreq[0])); -+ PR_EEP("XPA Bias Freq1", le16_to_cpu(modal_hdr->xpaBiasLvlFreq[1])); -+ PR_EEP("XPA Bias Freq2", le16_to_cpu(modal_hdr->xpaBiasLvlFreq[2])); - - return len; - } -@@ -206,6 +206,7 @@ static u32 ath9k_hw_def_dump_eeprom(stru - { - struct ar5416_eeprom_def *eep = &ah->eeprom.def; - struct base_eep_header *pBase = &eep->baseEepHeader; -+ u32 binBuildNumber = le32_to_cpu(pBase->binBuildNumber); - - if (!dump_base_hdr) { - len += scnprintf(buf + len, size - len, -@@ -221,10 +222,10 @@ static u32 ath9k_hw_def_dump_eeprom(stru - - PR_EEP("Major Version", ath9k_hw_def_get_eeprom_ver(ah)); - PR_EEP("Minor Version", ath9k_hw_def_get_eeprom_rev(ah)); -- PR_EEP("Checksum", pBase->checksum); -- PR_EEP("Length", pBase->length); -- PR_EEP("RegDomain1", pBase->regDmn[0]); -- PR_EEP("RegDomain2", pBase->regDmn[1]); -+ PR_EEP("Checksum", le16_to_cpu(pBase->checksum)); -+ PR_EEP("Length", le16_to_cpu(pBase->length)); -+ PR_EEP("RegDomain1", le16_to_cpu(pBase->regDmn[0])); -+ PR_EEP("RegDomain2", le16_to_cpu(pBase->regDmn[1])); - PR_EEP("TX Mask", pBase->txMask); - PR_EEP("RX Mask", pBase->rxMask); - PR_EEP("Allow 5GHz", !!(pBase->opCapFlags & AR5416_OPFLAGS_11A)); -@@ -238,9 +239,9 @@ static u32 ath9k_hw_def_dump_eeprom(stru - PR_EEP("Disable 5Ghz HT40", !!(pBase->opCapFlags & - AR5416_OPFLAGS_N_5G_HT40)); - PR_EEP("Big Endian", !!(pBase->eepMisc & AR5416_EEPMISC_BIG_ENDIAN)); -- PR_EEP("Cal Bin Major Ver", (pBase->binBuildNumber >> 24) & 0xFF); -- PR_EEP("Cal Bin Minor Ver", (pBase->binBuildNumber >> 16) & 0xFF); -- PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF); -+ PR_EEP("Cal Bin Major Ver", (binBuildNumber >> 24) & 0xFF); -+ PR_EEP("Cal Bin Minor Ver", (binBuildNumber >> 16) & 0xFF); -+ PR_EEP("Cal Bin Build", (binBuildNumber >> 8) & 0xFF); - PR_EEP("OpenLoop Power Ctrl", pBase->openLoopPwrCntl); - - len += scnprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", -@@ -273,61 +274,40 @@ static int ath9k_hw_def_check_eeprom(str - return err; - - if (need_swap) -- el = swab16(eep->baseEepHeader.length); -+ el = swab16((__force u16)eep->baseEepHeader.length); - else -- el = eep->baseEepHeader.length; -+ el = le16_to_cpu(eep->baseEepHeader.length); - - el = min(el / sizeof(u16), SIZE_EEPROM_DEF); - if (!ath9k_hw_nvram_validate_checksum(ah, el)) - return -EINVAL; - - if (need_swap) { -- u32 integer, j; -- u16 word; -- -- word = swab16(eep->baseEepHeader.length); -- eep->baseEepHeader.length = word; -- -- word = swab16(eep->baseEepHeader.checksum); -- eep->baseEepHeader.checksum = word; -- -- word = swab16(eep->baseEepHeader.version); -- eep->baseEepHeader.version = word; -- -- word = swab16(eep->baseEepHeader.regDmn[0]); -- eep->baseEepHeader.regDmn[0] = word; -- -- word = swab16(eep->baseEepHeader.regDmn[1]); -- eep->baseEepHeader.regDmn[1] = word; -- -- word = swab16(eep->baseEepHeader.rfSilent); -- eep->baseEepHeader.rfSilent = word; -- -- word = swab16(eep->baseEepHeader.blueToothOptions); -- eep->baseEepHeader.blueToothOptions = word; -+ u32 j; - -- word = swab16(eep->baseEepHeader.deviceCap); -- eep->baseEepHeader.deviceCap = word; -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.length); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.checksum); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.version); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.regDmn[0]); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.regDmn[1]); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.rfSilent); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.blueToothOptions); -+ EEPROM_FIELD_SWAB16(eep->baseEepHeader.deviceCap); - - for (j = 0; j < ARRAY_SIZE(eep->modalHeader); j++) { - struct modal_eep_header *pModal = - &eep->modalHeader[j]; -- integer = swab32(pModal->antCtrlCommon); -- pModal->antCtrlCommon = integer; -+ EEPROM_FIELD_SWAB32(pModal->antCtrlCommon); - -- for (i = 0; i < AR5416_MAX_CHAINS; i++) { -- integer = swab32(pModal->antCtrlChain[i]); -- pModal->antCtrlChain[i] = integer; -- } -- for (i = 0; i < 3; i++) { -- word = swab16(pModal->xpaBiasLvlFreq[i]); -- pModal->xpaBiasLvlFreq[i] = word; -- } -+ for (i = 0; i < AR5416_MAX_CHAINS; i++) -+ EEPROM_FIELD_SWAB32(pModal->antCtrlChain[i]); - -- for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) { -- word = swab16(pModal->spurChans[i].spurChan); -- pModal->spurChans[i].spurChan = word; -- } -+ for (i = 0; i < 3; i++) -+ EEPROM_FIELD_SWAB16(pModal->xpaBiasLvlFreq[i]); -+ -+ for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) -+ EEPROM_FIELD_SWAB16( -+ pModal->spurChans[i].spurChan); - } - } - -@@ -337,7 +317,7 @@ static int ath9k_hw_def_check_eeprom(str - - /* Enable fixup for AR_AN_TOP2 if necessary */ - if ((ah->hw_version.devid == AR9280_DEVID_PCI) && -- ((eep->baseEepHeader.version & 0xff) > 0x0a) && -+ ((le16_to_cpu(eep->baseEepHeader.version) & 0xff) > 0x0a) && - (eep->baseEepHeader.pwdclkind == 0)) - ah->need_an_top2_fixup = true; - -@@ -370,13 +350,13 @@ static u32 ath9k_hw_def_get_eeprom(struc - case EEP_MAC_MSW: - return get_unaligned_be16(pBase->macAddr + 4); - case EEP_REG_0: -- return pBase->regDmn[0]; -+ return le16_to_cpu(pBase->regDmn[0]); - case EEP_OP_CAP: -- return pBase->deviceCap; -+ return le16_to_cpu(pBase->deviceCap); - case EEP_OP_MODE: - return pBase->opCapFlags; - case EEP_RF_SILENT: -- return pBase->rfSilent; -+ return le16_to_cpu(pBase->rfSilent); - case EEP_OB_5: - return pModal[0].ob; - case EEP_DB_5: -@@ -490,11 +470,13 @@ static void ath9k_hw_def_set_board_value - struct ar5416_eeprom_def *eep = &ah->eeprom.def; - int i, regChainOffset; - u8 txRxAttenLocal; -+ u32 antCtrlCommon; - - pModal = &(eep->modalHeader[IS_CHAN_2GHZ(chan)]); - txRxAttenLocal = IS_CHAN_2GHZ(chan) ? 23 : 44; -+ antCtrlCommon = le32_to_cpu(pModal->antCtrlCommon); - -- REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon & 0xffff); -+ REG_WRITE(ah, AR_PHY_SWITCH_COM, antCtrlCommon & 0xffff); - - for (i = 0; i < AR5416_MAX_CHAINS; i++) { - if (AR_SREV_9280(ah)) { -@@ -508,7 +490,7 @@ static void ath9k_hw_def_set_board_value - regChainOffset = i * 0x1000; - - REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0 + regChainOffset, -- pModal->antCtrlChain[i]); -+ le32_to_cpu(pModal->antCtrlChain[i])); - - REG_WRITE(ah, AR_PHY_TIMING_CTRL4(0) + regChainOffset, - (REG_READ(ah, AR_PHY_TIMING_CTRL4(0) + regChainOffset) & -@@ -655,7 +637,7 @@ static void ath9k_hw_def_set_board_value - static void ath9k_hw_def_set_addac(struct ath_hw *ah, - struct ath9k_channel *chan) - { --#define XPA_LVL_FREQ(cnt) (pModal->xpaBiasLvlFreq[cnt]) -+#define XPA_LVL_FREQ(cnt) (le16_to_cpu(pModal->xpaBiasLvlFreq[cnt])) - struct modal_eep_header *pModal; - struct ar5416_eeprom_def *eep = &ah->eeprom.def; - u8 biaslevel; -@@ -1315,7 +1297,9 @@ static void ath9k_hw_def_set_txpower(str - - static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz) - { -- return ah->eeprom.def.modalHeader[is2GHz].spurChans[i].spurChan; -+ __le16 spch = ah->eeprom.def.modalHeader[is2GHz].spurChans[i].spurChan; -+ -+ return le16_to_cpu(spch); - } - - static u8 ath9k_hw_def_get_eepmisc(struct ath_hw *ah) diff --git a/package/kernel/mac80211/patches/557-ath9k-disable-bands-via-dt.patch b/package/kernel/mac80211/patches/557-ath9k-disable-bands-via-dt.patch deleted file mode 100644 index ae447ce1f5..0000000000 --- a/package/kernel/mac80211/patches/557-ath9k-disable-bands-via-dt.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt -+++ b/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt -@@ -34,6 +34,14 @@ Optional properties: - ath9k wireless chip (in this case the calibration / - EEPROM data will be loaded from userspace using the - kernel firmware loader). -+- qca,disable-2ghz: Overrides the settings from the EEPROM and disables the -+ 2.4GHz band. Setting this property is only needed -+ when the RF circuit does not support the 2.4GHz band -+ while it is enabled nevertheless in the EEPROM. -+- qca,disable-5ghz: Overrides the settings from the EEPROM and disables the -+ 5GHz band. Setting this property is only needed when -+ the RF circuit does not support the 5GHz band while -+ it is enabled nevertheless in the EEPROM. - - mac-address: See ethernet.txt in the parent directory - - local-mac-address: See ethernet.txt in the parent directory - ---- a/drivers/net/wireless/ath/ath9k/init.c -+++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -571,6 +571,12 @@ static int ath9k_of_init(struct ath_soft - - ath_dbg(common, CONFIG, "parsing configuration from OF node\n"); - -+ if (of_property_read_bool(np, "qca,disable-2ghz")) -+ ah->disable_2ghz = true; -+ -+ if (of_property_read_bool(np, "qca,disable-5ghz")) -+ ah->disable_5ghz = true; -+ - if (of_property_read_bool(np, "qca,no-eeprom")) { - /* ath9k-eeprom--.bin */ - scnprintf(eeprom_name, sizeof(eeprom_name), diff --git a/package/kernel/mac80211/patches/600-01-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch b/package/kernel/mac80211/patches/600-01-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch new file mode 100644 index 0000000000..565e39de5f --- /dev/null +++ b/package/kernel/mac80211/patches/600-01-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch @@ -0,0 +1,30 @@ +From 91094ed065f7794886b4a5490fd6de942f036bb4 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Sun, 24 Mar 2013 19:26:26 +0100 +Subject: [PATCH] rt2x00: allow to build rt2800soc module for RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/ralink/rt2x00/Kconfig ++++ b/drivers/net/wireless/ralink/rt2x00/Kconfig +@@ -210,7 +210,7 @@ endif + config RT2800SOC + tristate "Ralink WiSoC support" + depends on m +- depends on SOC_RT288X || SOC_RT305X ++ depends on SOC_RT288X || SOC_RT305X || SOC_RT3883 + select RT2X00_LIB_SOC + select RT2X00_LIB_MMIO + select RT2X00_LIB_CRYPTO +@@ -245,7 +245,7 @@ config RT2X00_LIB_PCI + + config RT2X00_LIB_SOC + tristate "RT2x00 SoC support" +- depends on SOC_RT288X || SOC_RT305X ++ depends on SOC_RT288X || SOC_RT305X || SOC_RT3883 + depends on m + select RT2X00_LIB + diff --git a/package/kernel/mac80211/patches/600-02-rt2x00-rt2800lib-enable-support-for-RT3883.patch b/package/kernel/mac80211/patches/600-02-rt2x00-rt2800lib-enable-support-for-RT3883.patch new file mode 100644 index 0000000000..f8680108c8 --- /dev/null +++ b/package/kernel/mac80211/patches/600-02-rt2x00-rt2800lib-enable-support-for-RT3883.patch @@ -0,0 +1,20 @@ +From 4f16582c93a71eba9d389e0f0a8aa9099a9587cd Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Sun, 24 Mar 2013 19:26:26 +0100 +Subject: [PATCH] rt2x00: rt2800lib: enable support for RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -7956,6 +7956,7 @@ static int rt2800_probe_rt(struct rt2x00 + case RT3390: + case RT3572: + case RT3593: ++ case RT3883: + case RT5350: + case RT5390: + case RT5392: diff --git a/package/kernel/mac80211/patches/600-03-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch b/package/kernel/mac80211/patches/600-03-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch new file mode 100644 index 0000000000..46e98aff0f --- /dev/null +++ b/package/kernel/mac80211/patches/600-03-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch @@ -0,0 +1,112 @@ +From ecb394ccf248d8652c463133c4f404458a57a9c1 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Sun, 24 Mar 2013 19:26:26 +0100 +Subject: [PATCH] rt2x00: rt2800lib: add rf_vals for RF3853 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800.h | 4 +- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 65 +++++++++++++++++++++++++++++++ + 2 files changed, 68 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h +@@ -48,7 +48,8 @@ + * RF2853 2.4G/5G 3T3R + * RF3320 2.4G 1T1R(RT3350/RT3370/RT3390) + * RF3322 2.4G 2T2R(RT3352/RT3371/RT3372/RT3391/RT3392) +- * RF3053 2.4G/5G 3T3R(RT3883/RT3563/RT3573/RT3593/RT3662) ++ * RF3053 2.4G/5G 3T3R(RT3563/RT3573/RT3593) ++ * RF3853 2.4G/5G 3T3R(RT3883/RT3662) + * RF5592 2.4G/5G 2T2R + * RF3070 2.4G 1T1R + * RF5360 2.4G 1T1R +@@ -72,6 +73,7 @@ + #define RF5592 0x000f + #define RF3070 0x3070 + #define RF3290 0x3290 ++#define RF3853 0x3853 + #define RF5350 0x5350 + #define RF5360 0x5360 + #define RF5362 0x5362 +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -7557,6 +7557,66 @@ static const struct rf_channel rf_vals_3 + {14, 0xF0, 2, 0x18}, + }; + ++static const struct rf_channel rf_vals_3853[] = { ++ {1, 241, 6, 2}, ++ {2, 241, 6, 7}, ++ {3, 242, 6, 2}, ++ {4, 242, 6, 7}, ++ {5, 243, 6, 2}, ++ {6, 243, 6, 7}, ++ {7, 244, 6, 2}, ++ {8, 244, 6, 7}, ++ {9, 245, 6, 2}, ++ {10, 245, 6, 7}, ++ {11, 246, 6, 2}, ++ {12, 246, 6, 7}, ++ {13, 247, 6, 2}, ++ {14, 248, 6, 4}, ++ ++ {36, 0x56, 8, 4}, ++ {38, 0x56, 8, 6}, ++ {40, 0x56, 8, 8}, ++ {44, 0x57, 8, 0}, ++ {46, 0x57, 8, 2}, ++ {48, 0x57, 8, 4}, ++ {52, 0x57, 8, 8}, ++ {54, 0x57, 8, 10}, ++ {56, 0x58, 8, 0}, ++ {60, 0x58, 8, 4}, ++ {62, 0x58, 8, 6}, ++ {64, 0x58, 8, 8}, ++ ++ {100, 0x5b, 8, 8}, ++ {102, 0x5b, 8, 10}, ++ {104, 0x5c, 8, 0}, ++ {108, 0x5c, 8, 4}, ++ {110, 0x5c, 8, 6}, ++ {112, 0x5c, 8, 8}, ++ {114, 0x5c, 8, 10}, ++ {116, 0x5d, 8, 0}, ++ {118, 0x5d, 8, 2}, ++ {120, 0x5d, 8, 4}, ++ {124, 0x5d, 8, 8}, ++ {126, 0x5d, 8, 10}, ++ {128, 0x5e, 8, 0}, ++ {132, 0x5e, 8, 4}, ++ {134, 0x5e, 8, 6}, ++ {136, 0x5e, 8, 8}, ++ {140, 0x5f, 8, 0}, ++ ++ {149, 0x5f, 8, 9}, ++ {151, 0x5f, 8, 11}, ++ {153, 0x60, 8, 1}, ++ {157, 0x60, 8, 5}, ++ {159, 0x60, 8, 7}, ++ {161, 0x60, 8, 9}, ++ {165, 0x61, 8, 1}, ++ {167, 0x61, 8, 3}, ++ {169, 0x61, 8, 5}, ++ {171, 0x61, 8, 7}, ++ {173, 0x61, 8, 9}, ++}; ++ + static const struct rf_channel rf_vals_5592_xtal20[] = { + /* Channel, N, K, mod, R */ + {1, 482, 4, 10, 3}, +@@ -7798,6 +7858,11 @@ static int rt2800_probe_hw_mode(struct r + spec->channels = rf_vals_3x; + break; + ++ case RF3853: ++ spec->num_channels = ARRAY_SIZE(rf_vals_3853); ++ spec->channels = rf_vals_3853; ++ break; ++ + case RF5592: + rt2800_register_read(rt2x00dev, MAC_DEBUG_INDEX, ®); + if (rt2x00_get_field32(reg, MAC_DEBUG_INDEX_XTAL)) { diff --git a/package/kernel/mac80211/patches/600-04-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch b/package/kernel/mac80211/patches/600-04-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch new file mode 100644 index 0000000000..eca49773ec --- /dev/null +++ b/package/kernel/mac80211/patches/600-04-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch @@ -0,0 +1,28 @@ +From f8e3fcf18e1f2d7f9e6a9680c5452da090f33d88 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Thu, 1 Aug 2013 14:40:44 +0200 +Subject: [PATCH] rt2x00: rt2800lib: enable VCO calibration for RF3853 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -4363,6 +4363,7 @@ void rt2800_vco_calibration(struct rt2x0 + case RF3053: + case RF3070: + case RF3290: ++ case RF3853: + case RF5350: + case RF5360: + case RF5362: +@@ -7980,6 +7981,7 @@ static int rt2800_probe_hw_mode(struct r + case RF3053: + case RF3070: + case RF3290: ++ case RF3853: + case RF5350: + case RF5360: + case RF5362: diff --git a/package/kernel/mac80211/patches/600-05-rt2x00-rt2800lib-add-channel-configuration-function-.patch b/package/kernel/mac80211/patches/600-05-rt2x00-rt2800lib-add-channel-configuration-function-.patch new file mode 100644 index 0000000000..a1e5883035 --- /dev/null +++ b/package/kernel/mac80211/patches/600-05-rt2x00-rt2800lib-add-channel-configuration-function-.patch @@ -0,0 +1,235 @@ +From 6e3a17190815c6aa4dc53c2cfe9125fb1154f187 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Sun, 24 Mar 2013 19:26:27 +0100 +Subject: [PATCH] rt2x00: rt2800lib: add channel configuration function for + RF3853 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 208 +++++++++++++++++++++++++++++++ + 1 file changed, 208 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -2584,6 +2584,211 @@ static void rt2800_config_channel_rf3053 + } + } + ++static void rt2800_config_channel_rf3853(struct rt2x00_dev *rt2x00dev, ++ struct ieee80211_conf *conf, ++ struct rf_channel *rf, ++ struct channel_info *info) ++{ ++ u8 rfcsr; ++ u8 bbp; ++ u8 pwr1, pwr2, pwr3; ++ ++ const bool txbf_enabled = false; /* TODO */ ++ ++ /* TODO: add band selection */ ++ ++ if (rf->channel <= 14) ++ rt2800_rfcsr_write(rt2x00dev, 6, 0x40); ++ else if (rf->channel < 132) ++ rt2800_rfcsr_write(rt2x00dev, 6, 0x80); ++ else ++ rt2800_rfcsr_write(rt2x00dev, 6, 0x40); ++ ++ rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1); ++ rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3); ++ ++ if (rf->channel <= 14) ++ rt2800_rfcsr_write(rt2x00dev, 11, 0x46); ++ else ++ rt2800_rfcsr_write(rt2x00dev, 11, 0x48); ++ ++ if (rf->channel <= 14) ++ rt2800_rfcsr_write(rt2x00dev, 12, 0x1a); ++ else ++ rt2800_rfcsr_write(rt2x00dev, 12, 0x52); ++ ++ rt2800_rfcsr_write(rt2x00dev, 13, 0x12); ++ ++ rt2800_rfcsr_read(rt2x00dev, 1, &rfcsr); ++ rt2x00_set_field8(&rfcsr, RFCSR1_RX0_PD, 0); ++ rt2x00_set_field8(&rfcsr, RFCSR1_TX0_PD, 0); ++ rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, 0); ++ rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, 0); ++ rt2x00_set_field8(&rfcsr, RFCSR1_RX2_PD, 0); ++ rt2x00_set_field8(&rfcsr, RFCSR1_TX2_PD, 0); ++ rt2x00_set_field8(&rfcsr, RFCSR1_RF_BLOCK_EN, 1); ++ rt2x00_set_field8(&rfcsr, RFCSR1_PLL_PD, 1); ++ ++ switch (rt2x00dev->default_ant.tx_chain_num) { ++ case 3: ++ rt2x00_set_field8(&rfcsr, RFCSR1_TX2_PD, 1); ++ /* fallthrough */ ++ case 2: ++ rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, 1); ++ /* fallthrough */ ++ case 1: ++ rt2x00_set_field8(&rfcsr, RFCSR1_TX0_PD, 1); ++ break; ++ } ++ ++ switch (rt2x00dev->default_ant.rx_chain_num) { ++ case 3: ++ rt2x00_set_field8(&rfcsr, RFCSR1_RX2_PD, 1); ++ /* fallthrough */ ++ case 2: ++ rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, 1); ++ /* fallthrough */ ++ case 1: ++ rt2x00_set_field8(&rfcsr, RFCSR1_RX0_PD, 1); ++ break; ++ } ++ rt2800_rfcsr_write(rt2x00dev, 1, rfcsr); ++ ++ rt2800_freq_cal_mode1(rt2x00dev); ++ ++ rt2800_rfcsr_read(rt2x00dev, 30, &rfcsr); ++ if (!conf_is_ht40(conf)) ++ rfcsr &= ~(0x06); ++ else ++ rfcsr |= 0x06; ++ rt2800_rfcsr_write(rt2x00dev, 30, rfcsr); ++ ++ if (rf->channel <= 14) ++ rt2800_rfcsr_write(rt2x00dev, 31, 0xa0); ++ else ++ rt2800_rfcsr_write(rt2x00dev, 31, 0x80); ++ ++ if (conf_is_ht40(conf)) ++ rt2800_rfcsr_write(rt2x00dev, 32, 0x80); ++ else ++ rt2800_rfcsr_write(rt2x00dev, 32, 0xd8); ++ ++ if (rf->channel <= 14) ++ rt2800_rfcsr_write(rt2x00dev, 34, 0x3c); ++ else ++ rt2800_rfcsr_write(rt2x00dev, 34, 0x20); ++ ++ /* loopback RF_BS */ ++ rt2800_rfcsr_read(rt2x00dev, 36, &rfcsr); ++ if (rf->channel <= 14) ++ rt2x00_set_field8(&rfcsr, RFCSR36_RF_BS, 1); ++ else ++ rt2x00_set_field8(&rfcsr, RFCSR36_RF_BS, 0); ++ rt2800_rfcsr_write(rt2x00dev, 36, rfcsr); ++ ++ if (rf->channel <= 14) ++ rfcsr = 0x23; ++ else if (rf->channel < 100) ++ rfcsr = 0x36; ++ else if (rf->channel < 132) ++ rfcsr = 0x32; ++ else ++ rfcsr = 0x30; ++ ++ if (txbf_enabled) ++ rfcsr |= 0x40; ++ ++ rt2800_rfcsr_write(rt2x00dev, 39, rfcsr); ++ ++ if (rf->channel <= 14) ++ rt2800_rfcsr_write(rt2x00dev, 44, 0x93); ++ else ++ rt2800_rfcsr_write(rt2x00dev, 44, 0x9b); ++ ++ if (rf->channel <= 14) ++ rfcsr = 0xbb; ++ else if (rf->channel < 100) ++ rfcsr = 0xeb; ++ else if (rf->channel < 132) ++ rfcsr = 0xb3; ++ else ++ rfcsr = 0x9b; ++ rt2800_rfcsr_write(rt2x00dev, 45, rfcsr); ++ ++ if (rf->channel <= 14) ++ rfcsr = 0x8e; ++ else ++ rfcsr = 0x8a; ++ ++ if (txbf_enabled) ++ rfcsr |= 0x20; ++ ++ rt2800_rfcsr_write(rt2x00dev, 49, rfcsr); ++ ++ rt2800_rfcsr_write(rt2x00dev, 50, 0x86); ++ ++ rt2800_rfcsr_read(rt2x00dev, 51, &rfcsr); ++ if (rf->channel <= 14) ++ rt2800_rfcsr_write(rt2x00dev, 51, 0x75); ++ else ++ rt2800_rfcsr_write(rt2x00dev, 51, 0x51); ++ ++ rt2800_rfcsr_read(rt2x00dev, 52, &rfcsr); ++ if (rf->channel <= 14) ++ rt2800_rfcsr_write(rt2x00dev, 52, 0x45); ++ else ++ rt2800_rfcsr_write(rt2x00dev, 52, 0x05); ++ ++ if (rf->channel <= 14) { ++ pwr1 = info->default_power1 & 0x1f; ++ pwr2 = info->default_power2 & 0x1f; ++ pwr3 = info->default_power3 & 0x1f; ++ } else { ++ pwr1 = 0x48 | ((info->default_power1 & 0x18) << 1) | ++ (info->default_power1 & 0x7); ++ pwr2 = 0x48 | ((info->default_power2 & 0x18) << 1) | ++ (info->default_power2 & 0x7); ++ pwr3 = 0x48 | ((info->default_power3 & 0x18) << 1) | ++ (info->default_power3 & 0x7); ++ } ++ ++ rt2800_rfcsr_write(rt2x00dev, 53, pwr1); ++ rt2800_rfcsr_write(rt2x00dev, 54, pwr2); ++ rt2800_rfcsr_write(rt2x00dev, 55, pwr3); ++ ++ rt2x00_dbg(rt2x00dev, "Channel:%d, pwr1:%02x, pwr2:%02x, pwr3:%02x\n", ++ rf->channel, pwr1, pwr2, pwr3); ++ ++ bbp = (info->default_power1 >> 5) | ++ ((info->default_power2 & 0xe0) >> 1); ++ rt2800_bbp_write(rt2x00dev, 109, bbp); ++ ++ rt2800_bbp_read(rt2x00dev, 110, &bbp); ++ bbp &= 0x0f; ++ bbp |= (info->default_power3 & 0xe0) >> 1; ++ rt2800_bbp_write(rt2x00dev, 110, bbp); ++ ++ rt2800_rfcsr_read(rt2x00dev, 57, &rfcsr); ++ if (rf->channel <= 14) ++ rt2800_rfcsr_write(rt2x00dev, 57, 0x6e); ++ else ++ rt2800_rfcsr_write(rt2x00dev, 57, 0x3e); ++ ++ /* Enable RF tuning */ ++ rt2800_rfcsr_read(rt2x00dev, 3, &rfcsr); ++ rt2x00_set_field8(&rfcsr, RFCSR3_VCOCAL_EN, 1); ++ rt2800_rfcsr_write(rt2x00dev, 3, rfcsr); ++ ++ udelay(2000); ++ ++ rt2800_bbp_read(rt2x00dev, 49, &bbp); ++ /* clear update flag */ ++ rt2800_bbp_write(rt2x00dev, 49, bbp & 0xfe); ++ rt2800_bbp_write(rt2x00dev, 49, bbp); ++ ++ /* TODO: add calibration for TxBF */ ++} ++ + #define POWER_BOUND 0x27 + #define POWER_BOUND_5G 0x2b + +@@ -3203,6 +3408,9 @@ static void rt2800_config_channel(struct + case RF3322: + rt2800_config_channel_rf3322(rt2x00dev, conf, rf, info); + break; ++ case RF3853: ++ rt2800_config_channel_rf3853(rt2x00dev, conf, rf, info); ++ break; + case RF3070: + case RF5350: + case RF5360: diff --git a/package/kernel/mac80211/patches/600-06-rt2x00-rt2800lib-enable-RF3853-support.patch b/package/kernel/mac80211/patches/600-06-rt2x00-rt2800lib-enable-RF3853-support.patch new file mode 100644 index 0000000000..2d65119fd0 --- /dev/null +++ b/package/kernel/mac80211/patches/600-06-rt2x00-rt2800lib-enable-RF3853-support.patch @@ -0,0 +1,20 @@ +From afd38ae82226551bf879b6c7c4b620c271fee9d2 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Thu, 1 Aug 2013 14:42:05 +0200 +Subject: [PATCH] rt2x00: rt2800lib: enable RF3853 support + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -7483,6 +7483,7 @@ static int rt2800_init_eeprom(struct rt2 + case RF3290: + case RF3320: + case RF3322: ++ case RF3853: + case RF5350: + case RF5360: + case RF5362: diff --git a/package/kernel/mac80211/patches/600-07-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch b/package/kernel/mac80211/patches/600-07-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch new file mode 100644 index 0000000000..d073c01697 --- /dev/null +++ b/package/kernel/mac80211/patches/600-07-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch @@ -0,0 +1,62 @@ +From 0094872a5e8e4664c6ea1b2dfa487063d39ae363 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Sun, 24 Mar 2013 19:26:26 +0100 +Subject: [PATCH] rt2x00: rt2800lib: add MAC register initialization for + RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800.h | 14 ++++++++++++++ + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 19 ++++++++++++++++--- + 2 files changed, 30 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h +@@ -1574,6 +1574,20 @@ + #define TX_PWR_CFG_9_STBC7_CH2 FIELD32(0x00000f00) + + /* ++ * TX_TXBF_CFG: ++ */ ++#define TX_TXBF_CFG_0 0x138c ++#define TX_TXBF_CFG_1 0x13a4 ++#define TX_TXBF_CFG_2 0x13a8 ++#define TX_TXBF_CFG_3 0x13ac ++ ++/* ++ * TX_FBK_CFG_3S: ++ */ ++#define TX_FBK_CFG_3S_0 0x13c4 ++#define TX_FBK_CFG_3S_1 0x13c8 ++ ++/* + * RX_FILTER_CFG: RX configuration register. + */ + #define RX_FILTER_CFG 0x1400 +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -4946,6 +4946,12 @@ static int rt2800_init_registers(struct + rt2800_register_write(rt2x00dev, TX_SW_CFG2, + 0x00000000); + } ++ } else if (rt2x00_rt(rt2x00dev, RT3883)) { ++ rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000402); ++ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00000000); ++ rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00040000); ++ rt2800_register_write(rt2x00dev, TX_TXBF_CFG_0, 0x8000fc21); ++ rt2800_register_write(rt2x00dev, TX_TXBF_CFG_3, 0x00009c40); + } else if (rt2x00_rt(rt2x00dev, RT5390) || + rt2x00_rt(rt2x00dev, RT5392)) { + rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404); +@@ -5140,6 +5146,11 @@ static int rt2800_init_registers(struct + reg = rt2x00_rt(rt2x00dev, RT5592) ? 0x00000082 : 0x00000002; + rt2800_register_write(rt2x00dev, TXOP_HLDR_ET, reg); + ++ if (rt2x00_rt(rt2x00dev, RT3883)) { ++ rt2800_register_write(rt2x00dev, TX_FBK_CFG_3S_0, 0x12111008); ++ rt2800_register_write(rt2x00dev, TX_FBK_CFG_3S_1, 0x16151413); ++ } ++ + rt2800_register_read(rt2x00dev, TX_RTS_CFG, ®); + rt2x00_set_field32(®, TX_RTS_CFG_AUTO_RTS_RETRY_LIMIT, 7); + rt2x00_set_field32(®, TX_RTS_CFG_RTS_THRES, diff --git a/package/kernel/mac80211/patches/600-08-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch b/package/kernel/mac80211/patches/600-08-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch new file mode 100644 index 0000000000..d68ad50447 --- /dev/null +++ b/package/kernel/mac80211/patches/600-08-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch @@ -0,0 +1,30 @@ +From 6c2d32478159fffff0b85abb6817a21bb2338231 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Sun, 24 Mar 2013 19:26:27 +0100 +Subject: [PATCH] rt2x00: rt2800soc: fix rt2800soc_disable_radio for RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800soc.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c +@@ -51,9 +51,16 @@ static bool rt2800soc_hwcrypt_disabled(s + + static void rt2800soc_disable_radio(struct rt2x00_dev *rt2x00dev) + { ++ u32 reg; ++ + rt2800_disable_radio(rt2x00dev); + rt2x00mmio_register_write(rt2x00dev, PWR_PIN_CFG, 0); +- rt2x00mmio_register_write(rt2x00dev, TX_PIN_CFG, 0); ++ ++ reg = 0; ++ if (rt2x00_rt(rt2x00dev, RT3883)) ++ rt2x00_set_field32(®, TX_PIN_CFG_RFTR_EN, 1); ++ ++ rt2x00mmio_register_write(rt2x00dev, TX_PIN_CFG, reg); + } + + static int rt2800soc_set_device_state(struct rt2x00_dev *rt2x00dev, diff --git a/package/kernel/mac80211/patches/600-09-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch b/package/kernel/mac80211/patches/600-09-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch new file mode 100644 index 0000000000..41ed4d3de9 --- /dev/null +++ b/package/kernel/mac80211/patches/600-09-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch @@ -0,0 +1,71 @@ +From 84833056aa7dd25f5b097e31c78f2a0914c5160c Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Sun, 24 Mar 2013 19:26:26 +0100 +Subject: [PATCH] rt2x00: rt2800lib: add BBP register initialization for + RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 44 +++++++++++++++++++++++++++++++ + 1 file changed, 44 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -5767,6 +5767,47 @@ static void rt2800_init_bbp_3593(struct + rt2800_bbp_write(rt2x00dev, 103, 0xc0); + } + ++static void rt2800_init_bbp_3883(struct rt2x00_dev *rt2x00dev) ++{ ++ rt2800_init_bbp_early(rt2x00dev); ++ ++ rt2800_bbp_write(rt2x00dev, 4, 0x50); ++ rt2800_bbp_write(rt2x00dev, 47, 0x48); ++ ++ rt2800_bbp_write(rt2x00dev, 86, 0x46); ++ rt2800_bbp_write(rt2x00dev, 88, 0x90); ++ ++ rt2800_bbp_write(rt2x00dev, 92, 0x02); ++ ++ rt2800_bbp_write(rt2x00dev, 103, 0xc0); ++ rt2800_bbp_write(rt2x00dev, 104, 0x92); ++ rt2800_bbp_write(rt2x00dev, 105, 0x34); ++ rt2800_bbp_write(rt2x00dev, 106, 0x12); ++ rt2800_bbp_write(rt2x00dev, 120, 0x50); ++ rt2800_bbp_write(rt2x00dev, 137, 0x0f); ++ rt2800_bbp_write(rt2x00dev, 163, 0x9d); ++ ++ /* Set ITxBF timeout to 0x9C40=1000msec */ ++ rt2800_bbp_write(rt2x00dev, 179, 0x02); ++ rt2800_bbp_write(rt2x00dev, 180, 0x00); ++ rt2800_bbp_write(rt2x00dev, 182, 0x40); ++ rt2800_bbp_write(rt2x00dev, 180, 0x01); ++ rt2800_bbp_write(rt2x00dev, 182, 0x9c); ++ ++ rt2800_bbp_write(rt2x00dev, 179, 0x00); ++ ++ /* Reprogram the inband interface to put right values in RXWI */ ++ rt2800_bbp_write(rt2x00dev, 142, 0x04); ++ rt2800_bbp_write(rt2x00dev, 143, 0x3b); ++ rt2800_bbp_write(rt2x00dev, 142, 0x06); ++ rt2800_bbp_write(rt2x00dev, 143, 0xa0); ++ rt2800_bbp_write(rt2x00dev, 142, 0x07); ++ rt2800_bbp_write(rt2x00dev, 143, 0xa1); ++ rt2800_bbp_write(rt2x00dev, 142, 0x08); ++ rt2800_bbp_write(rt2x00dev, 143, 0xa2); ++ rt2800_bbp_write(rt2x00dev, 148, 0xc8); ++} ++ + static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev) + { + int ant, div_mode; +@@ -5986,6 +6027,9 @@ static void rt2800_init_bbp(struct rt2x0 + case RT3593: + rt2800_init_bbp_3593(rt2x00dev); + return; ++ case RT3883: ++ rt2800_init_bbp_3883(rt2x00dev); ++ return; + case RT5390: + case RT5392: + rt2800_init_bbp_53xx(rt2x00dev); diff --git a/package/kernel/mac80211/patches/600-10-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch b/package/kernel/mac80211/patches/600-10-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch new file mode 100644 index 0000000000..7e772ec676 --- /dev/null +++ b/package/kernel/mac80211/patches/600-10-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch @@ -0,0 +1,178 @@ +From 99c659cf345640fd0f733cbcaf4583cc2c868ec0 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Mon, 29 Apr 2013 13:21:48 +0200 +Subject: [PATCH] rt2x00: rt2800lib: add RFCSR initialization for RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800.h | 1 + + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 141 +++++++++++++++++++++++++++++++ + 2 files changed, 142 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h +@@ -2155,6 +2155,7 @@ struct mac_iveiv_entry { + /* + * RFCSR 2: + */ ++#define RFCSR2_RESCAL_BP FIELD8(0x40) + #define RFCSR2_RESCAL_EN FIELD8(0x80) + + /* +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -6899,6 +6899,144 @@ static void rt2800_init_rfcsr_5350(struc + rt2800_rfcsr_write(rt2x00dev, 63, 0x00); + } + ++static void rt2800_init_rfcsr_3883(struct rt2x00_dev *rt2x00dev) ++{ ++ u8 rfcsr; ++ ++ /* TODO: get the actual ECO value from the SoC */ ++ const unsigned int eco = 5; ++ ++ rt2800_rf_init_calibration(rt2x00dev, 2); ++ ++ rt2800_rfcsr_write(rt2x00dev, 0, 0xe0); ++ rt2800_rfcsr_write(rt2x00dev, 1, 0x03); ++ rt2800_rfcsr_write(rt2x00dev, 2, 0x50); ++ rt2800_rfcsr_write(rt2x00dev, 3, 0x20); ++ rt2800_rfcsr_write(rt2x00dev, 4, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 5, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 6, 0x40); ++ rt2800_rfcsr_write(rt2x00dev, 7, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 8, 0x5b); ++ rt2800_rfcsr_write(rt2x00dev, 9, 0x08); ++ rt2800_rfcsr_write(rt2x00dev, 10, 0xd3); ++ rt2800_rfcsr_write(rt2x00dev, 11, 0x48); ++ rt2800_rfcsr_write(rt2x00dev, 12, 0x1a); ++ rt2800_rfcsr_write(rt2x00dev, 13, 0x12); ++ rt2800_rfcsr_write(rt2x00dev, 14, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 15, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 16, 0x00); ++ ++ /* RFCSR 17 will be initialized later based on the ++ * frequency offset stored in the EEPROM ++ */ ++ ++ rt2800_rfcsr_write(rt2x00dev, 18, 0x40); ++ rt2800_rfcsr_write(rt2x00dev, 19, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 20, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 21, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 22, 0x20); ++ rt2800_rfcsr_write(rt2x00dev, 23, 0xc0); ++ rt2800_rfcsr_write(rt2x00dev, 24, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 25, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 26, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 27, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 28, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 29, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 30, 0x10); ++ rt2800_rfcsr_write(rt2x00dev, 31, 0x80); ++ rt2800_rfcsr_write(rt2x00dev, 32, 0x80); ++ rt2800_rfcsr_write(rt2x00dev, 33, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 34, 0x20); ++ rt2800_rfcsr_write(rt2x00dev, 35, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 36, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 37, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 38, 0x86); ++ rt2800_rfcsr_write(rt2x00dev, 39, 0x23); ++ rt2800_rfcsr_write(rt2x00dev, 40, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 41, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 42, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 43, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 44, 0x93); ++ rt2800_rfcsr_write(rt2x00dev, 45, 0xbb); ++ rt2800_rfcsr_write(rt2x00dev, 46, 0x60); ++ rt2800_rfcsr_write(rt2x00dev, 47, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 48, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 49, 0x8e); ++ rt2800_rfcsr_write(rt2x00dev, 50, 0x86); ++ rt2800_rfcsr_write(rt2x00dev, 51, 0x51); ++ rt2800_rfcsr_write(rt2x00dev, 52, 0x05); ++ rt2800_rfcsr_write(rt2x00dev, 53, 0x76); ++ rt2800_rfcsr_write(rt2x00dev, 54, 0x76); ++ rt2800_rfcsr_write(rt2x00dev, 55, 0x76); ++ rt2800_rfcsr_write(rt2x00dev, 56, 0xdb); ++ rt2800_rfcsr_write(rt2x00dev, 57, 0x3e); ++ rt2800_rfcsr_write(rt2x00dev, 58, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 59, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 60, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 61, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 62, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 63, 0x00); ++ ++ /* TODO: rx filter calibration? */ ++ ++ rt2800_bbp_write(rt2x00dev, 137, 0x0f); ++ ++ rt2800_bbp_write(rt2x00dev, 163, 0x9d); ++ ++ rt2800_bbp_write(rt2x00dev, 105, 0x05); ++ ++ rt2800_bbp_write(rt2x00dev, 179, 0x02); ++ rt2800_bbp_write(rt2x00dev, 180, 0x00); ++ rt2800_bbp_write(rt2x00dev, 182, 0x40); ++ rt2800_bbp_write(rt2x00dev, 180, 0x01); ++ rt2800_bbp_write(rt2x00dev, 182, 0x9c); ++ ++ rt2800_bbp_write(rt2x00dev, 179, 0x00); ++ ++ rt2800_bbp_write(rt2x00dev, 142, 0x04); ++ rt2800_bbp_write(rt2x00dev, 143, 0x3b); ++ rt2800_bbp_write(rt2x00dev, 142, 0x06); ++ rt2800_bbp_write(rt2x00dev, 143, 0xa0); ++ rt2800_bbp_write(rt2x00dev, 142, 0x07); ++ rt2800_bbp_write(rt2x00dev, 143, 0xa1); ++ rt2800_bbp_write(rt2x00dev, 142, 0x08); ++ rt2800_bbp_write(rt2x00dev, 143, 0xa2); ++ rt2800_bbp_write(rt2x00dev, 148, 0xc8); ++ ++ if (eco == 5) { ++ rt2800_rfcsr_write(rt2x00dev, 32, 0xd8); ++ rt2800_rfcsr_write(rt2x00dev, 33, 0x32); ++ } ++ ++ rt2800_rfcsr_read(rt2x00dev, 2, &rfcsr); ++ rt2x00_set_field8(&rfcsr, RFCSR2_RESCAL_BP, 0); ++ rt2x00_set_field8(&rfcsr, RFCSR2_RESCAL_EN, 1); ++ rt2800_rfcsr_write(rt2x00dev, 2, rfcsr); ++ msleep(1); ++ rt2x00_set_field8(&rfcsr, RFCSR2_RESCAL_EN, 0); ++ rt2800_rfcsr_write(rt2x00dev, 2, rfcsr); ++ ++ rt2800_rfcsr_read(rt2x00dev, 1, &rfcsr); ++ rt2x00_set_field8(&rfcsr, RFCSR1_RF_BLOCK_EN, 1); ++ rt2800_rfcsr_write(rt2x00dev, 1, rfcsr); ++ ++ rt2800_rfcsr_read(rt2x00dev, 6, &rfcsr); ++ rfcsr |= 0xc0; ++ rt2800_rfcsr_write(rt2x00dev, 6, rfcsr); ++ ++ rt2800_rfcsr_read(rt2x00dev, 22, &rfcsr); ++ rfcsr |= 0x20; ++ rt2800_rfcsr_write(rt2x00dev, 22, rfcsr); ++ ++ rt2800_rfcsr_read(rt2x00dev, 46, &rfcsr); ++ rfcsr |= 0x20; ++ rt2800_rfcsr_write(rt2x00dev, 46, rfcsr); ++ ++ rt2800_rfcsr_read(rt2x00dev, 20, &rfcsr); ++ rfcsr &= ~0xee; ++ rt2800_rfcsr_write(rt2x00dev, 20, rfcsr); ++} ++ + static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev) + { + rt2800_rf_init_calibration(rt2x00dev, 2); +@@ -7130,6 +7268,9 @@ static void rt2800_init_rfcsr(struct rt2 + case RT3390: + rt2800_init_rfcsr_3390(rt2x00dev); + break; ++ case RT3883: ++ rt2800_init_rfcsr_3883(rt2x00dev); ++ break; + case RT3572: + rt2800_init_rfcsr_3572(rt2x00dev); + break; diff --git a/package/kernel/mac80211/patches/600-11-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch b/package/kernel/mac80211/patches/600-11-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch new file mode 100644 index 0000000000..00e00b959f --- /dev/null +++ b/package/kernel/mac80211/patches/600-11-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch @@ -0,0 +1,22 @@ +From 86022438ffeb1b87dfcd018bf477fdbb43076691 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Wed, 8 May 2013 19:35:33 +0200 +Subject: [PATCH] rt2x00: rt2800lib: use the extended EEPROM map for RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -309,7 +309,8 @@ static unsigned int rt2800_eeprom_word_i + wiphy_name(rt2x00dev->hw->wiphy), word)) + return 0; + +- if (rt2x00_rt(rt2x00dev, RT3593)) ++ if (rt2x00_rt(rt2x00dev, RT3593) || ++ rt2x00_rt(rt2x00dev, RT3883)) + map = rt2800_eeprom_map_ext; + else + map = rt2800_eeprom_map; diff --git a/package/kernel/mac80211/patches/600-12-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch b/package/kernel/mac80211/patches/600-12-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch new file mode 100644 index 0000000000..11d3c8ccec --- /dev/null +++ b/package/kernel/mac80211/patches/600-12-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch @@ -0,0 +1,21 @@ +From 4cf5403f02fa65dc2207f61d223cffa9ae50e907 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Thu, 1 Aug 2013 14:48:21 +0200 +Subject: [PATCH] rt2x00: rt2800lib: force rf type to RF3853 on RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -7660,6 +7660,8 @@ static int rt2800_init_eeprom(struct rt2 + rt2800_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf); + else if (rt2x00_rt(rt2x00dev, RT3352)) + rf = RF3322; ++ else if (rt2x00_rt(rt2x00dev, RT3883)) ++ rf = RF3853; + else if (rt2x00_rt(rt2x00dev, RT5350)) + rf = RF5350; + else diff --git a/package/kernel/mac80211/patches/600-13-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch b/package/kernel/mac80211/patches/600-13-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch new file mode 100644 index 0000000000..beebe90d36 --- /dev/null +++ b/package/kernel/mac80211/patches/600-13-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch @@ -0,0 +1,136 @@ +From 269f19c848a2380db03a3f207cafb88e28d71c53 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Sun, 24 Mar 2013 19:26:28 +0100 +Subject: [PATCH] rt2x00: rt2800lib: add channel configuration code for RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 72 +++++++++++++++++++++++++++++-- + 1 file changed, 69 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -3371,6 +3371,36 @@ static char rt2800_txpower_to_dev(struct + return clamp_t(char, txpower, MIN_A_TXPOWER, MAX_A_TXPOWER); + } + ++static void rt3883_bbp_adjust(struct rt2x00_dev *rt2x00dev, ++ struct rf_channel *rf) ++{ ++ u8 bbp; ++ ++ bbp = (rf->channel > 14) ? 0x48 : 0x38; ++ rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, bbp); ++ ++ rt2800_bbp_write(rt2x00dev, 69, 0x12); ++ ++ if (rf->channel <= 14) { ++ rt2800_bbp_write(rt2x00dev, 70, 0x0a); ++ } else { ++ /* Disable CCK packet detection */ ++ rt2800_bbp_write(rt2x00dev, 70, 0x00); ++ } ++ ++ rt2800_bbp_write(rt2x00dev, 73, 0x10); ++ ++ if (rf->channel > 14) { ++ rt2800_bbp_write(rt2x00dev, 62, 0x1d); ++ rt2800_bbp_write(rt2x00dev, 63, 0x1d); ++ rt2800_bbp_write(rt2x00dev, 64, 0x1d); ++ } else { ++ rt2800_bbp_write(rt2x00dev, 62, 0x2d); ++ rt2800_bbp_write(rt2x00dev, 63, 0x2d); ++ rt2800_bbp_write(rt2x00dev, 64, 0x2d); ++ } ++} ++ + static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, + struct ieee80211_conf *conf, + struct rf_channel *rf, +@@ -3389,6 +3419,12 @@ static void rt2800_config_channel(struct + rt2800_txpower_to_dev(rt2x00dev, rf->channel, + info->default_power3); + ++ switch (rt2x00dev->chip.rt) { ++ case RT3883: ++ rt3883_bbp_adjust(rt2x00dev, rf); ++ break; ++ } ++ + switch (rt2x00dev->chip.rf) { + case RF2020: + case RF3020: +@@ -3490,6 +3526,15 @@ static void rt2800_config_channel(struct + rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain); + rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain); + rt2800_bbp_write(rt2x00dev, 77, 0x98); ++ } else if (rt2x00_rt(rt2x00dev, RT3883)) { ++ rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain); ++ rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain); ++ rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain); ++ ++ if (rt2x00dev->default_ant.rx_chain_num > 1) ++ rt2800_bbp_write(rt2x00dev, 86, 0x46); ++ else ++ rt2800_bbp_write(rt2x00dev, 86, 0); + } else { + rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain); + rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain); +@@ -3502,6 +3547,7 @@ static void rt2800_config_channel(struct + !rt2x00_rt(rt2x00dev, RT5392)) { + if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { + rt2800_bbp_write(rt2x00dev, 82, 0x62); ++ rt2800_bbp_write(rt2x00dev, 82, 0x62); + rt2800_bbp_write(rt2x00dev, 75, 0x46); + } else { + if (rt2x00_rt(rt2x00dev, RT3593)) +@@ -3510,19 +3556,22 @@ static void rt2800_config_channel(struct + rt2800_bbp_write(rt2x00dev, 82, 0x84); + rt2800_bbp_write(rt2x00dev, 75, 0x50); + } +- if (rt2x00_rt(rt2x00dev, RT3593)) ++ if (rt2x00_rt(rt2x00dev, RT3593) || ++ rt2x00_rt(rt2x00dev, RT3883)) + rt2800_bbp_write(rt2x00dev, 83, 0x8a); + } + + } else { + if (rt2x00_rt(rt2x00dev, RT3572)) + rt2800_bbp_write(rt2x00dev, 82, 0x94); +- else if (rt2x00_rt(rt2x00dev, RT3593)) ++ else if (rt2x00_rt(rt2x00dev, RT3593) || ++ rt2x00_rt(rt2x00dev, RT3883)) + rt2800_bbp_write(rt2x00dev, 82, 0x82); + else + rt2800_bbp_write(rt2x00dev, 82, 0xf2); + +- if (rt2x00_rt(rt2x00dev, RT3593)) ++ if (rt2x00_rt(rt2x00dev, RT3593) || ++ rt2x00_rt(rt2x00dev, RT3883)) + rt2800_bbp_write(rt2x00dev, 83, 0x9a); + + if (rt2x00_has_cap_external_lna_a(rt2x00dev)) +@@ -3644,6 +3693,23 @@ static void rt2800_config_channel(struct + + rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg); + ++ usleep_range(1000, 1500); ++ } ++ ++ if (rt2x00_rt(rt2x00dev, RT3883)) { ++ if (!conf_is_ht40(conf)) ++ rt2800_bbp_write(rt2x00dev, 105, 0x34); ++ else ++ rt2800_bbp_write(rt2x00dev, 105, 0x04); ++ ++ /* AGC init */ ++ if (rf->channel <= 14) ++ reg = 0x2e + rt2x00dev->lna_gain; ++ else ++ reg = 0x20 + ((rt2x00dev->lna_gain * 5) / 3); ++ ++ rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg); ++ + usleep_range(1000, 1500); + } + diff --git a/package/kernel/mac80211/patches/600-14-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch b/package/kernel/mac80211/patches/600-14-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch new file mode 100644 index 0000000000..f18f9d5714 --- /dev/null +++ b/package/kernel/mac80211/patches/600-14-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch @@ -0,0 +1,30 @@ +From e37d93abaabe3ab72b0332a18092acc162307274 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Mon, 30 Sep 2013 13:57:26 +0200 +Subject: [PATCH] rt2x00: rt2800lib: fix txpower_to_dev function for RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -3358,13 +3358,15 @@ static char rt2800_txpower_to_dev(struct + unsigned int channel, + char txpower) + { +- if (rt2x00_rt(rt2x00dev, RT3593)) ++ if (rt2x00_rt(rt2x00dev, RT3593) || ++ rt2x00_rt(rt2x00dev, RT3883)) + txpower = rt2x00_get_field8(txpower, EEPROM_TXPOWER_ALC); + + if (channel <= 14) + return clamp_t(char, txpower, MIN_G_TXPOWER, MAX_G_TXPOWER); + +- if (rt2x00_rt(rt2x00dev, RT3593)) ++ if (rt2x00_rt(rt2x00dev, RT3593) || ++ rt2x00_rt(rt2x00dev, RT3883)) + return clamp_t(char, txpower, MIN_A_TXPOWER_3593, + MAX_A_TXPOWER_3593); + else diff --git a/package/kernel/mac80211/patches/600-15-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch b/package/kernel/mac80211/patches/600-15-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch new file mode 100644 index 0000000000..0acdf2af79 --- /dev/null +++ b/package/kernel/mac80211/patches/600-15-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch @@ -0,0 +1,23 @@ +From c4d79e344bd580d85821390d49f92dced7d8e125 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Sun, 24 Mar 2013 19:26:29 +0100 +Subject: [PATCH] rt2x00: rt2800lib: use correct txpower calculation function + for RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -4596,7 +4596,8 @@ static void rt2800_config_txpower(struct + struct ieee80211_channel *chan, + int power_level) + { +- if (rt2x00_rt(rt2x00dev, RT3593)) ++ if (rt2x00_rt(rt2x00dev, RT3593) || ++ rt2x00_rt(rt2x00dev, RT3883)) + rt2800_config_txpower_rt3593(rt2x00dev, chan, power_level); + else + rt2800_config_txpower_rt28xx(rt2x00dev, chan, power_level); diff --git a/package/kernel/mac80211/patches/600-16-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch b/package/kernel/mac80211/patches/600-16-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch new file mode 100644 index 0000000000..5877a32bd8 --- /dev/null +++ b/package/kernel/mac80211/patches/600-16-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch @@ -0,0 +1,33 @@ +From caea0671cd8fd9ade4f5969cbe0ee545e94ae105 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Sat, 24 Aug 2013 11:49:55 +0200 +Subject: [PATCH] rt2x00: rt2800lib: hardcode txmixer gain values to zero for + RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -7543,7 +7543,8 @@ static u8 rt2800_get_txmixer_gain_24g(st + { + u16 word; + +- if (rt2x00_rt(rt2x00dev, RT3593)) ++ if (rt2x00_rt(rt2x00dev, RT3593) || ++ rt2x00_rt(rt2x00dev, RT3883)) + return 0; + + rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_BG, &word); +@@ -7557,7 +7558,8 @@ static u8 rt2800_get_txmixer_gain_5g(str + { + u16 word; + +- if (rt2x00_rt(rt2x00dev, RT3593)) ++ if (rt2x00_rt(rt2x00dev, RT3593) || ++ rt2x00_rt(rt2x00dev, RT3883)) + return 0; + + rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_A, &word); diff --git a/package/kernel/mac80211/patches/600-17-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch b/package/kernel/mac80211/patches/600-17-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch new file mode 100644 index 0000000000..abc6eb4414 --- /dev/null +++ b/package/kernel/mac80211/patches/600-17-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch @@ -0,0 +1,20 @@ +From 11c40fb47c4a4dd6ad060c2ae127ced89ffb9fe1 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Thu, 18 Apr 2013 14:33:33 +0200 +Subject: [PATCH] rt2x00: rt2800lib: use correct [RT]XWI size for RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -520,6 +520,7 @@ void rt2800_get_txwi_rxwi_size(struct rt + { + switch (rt2x00dev->chip.rt) { + case RT3593: ++ case RT3883: + *txwi_size = TXWI_DESC_SIZE_4WORDS; + *rxwi_size = RXWI_DESC_SIZE_5WORDS; + break; diff --git a/package/kernel/mac80211/patches/600-18-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch b/package/kernel/mac80211/patches/600-18-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch new file mode 100644 index 0000000000..c1e41bb84e --- /dev/null +++ b/package/kernel/mac80211/patches/600-18-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch @@ -0,0 +1,22 @@ +From fa5ad9c025610c22048add2f0ad03f62b6ca1e74 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Mon, 30 Sep 2013 16:53:33 +0200 +Subject: [PATCH] rt2x00: rt2800lib: fix antenna configuration for RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -1888,7 +1888,8 @@ void rt2800_config_ant(struct rt2x00_dev + rt2800_bbp_write(rt2x00dev, 3, r3); + rt2800_bbp_write(rt2x00dev, 1, r1); + +- if (rt2x00_rt(rt2x00dev, RT3593)) { ++ if (rt2x00_rt(rt2x00dev, RT3593) || ++ rt2x00_rt(rt2x00dev, RT3883)) { + if (ant->rx_chain_num == 1) + rt2800_bbp_write(rt2x00dev, 86, 0x00); + else diff --git a/package/kernel/mac80211/patches/600-19-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch b/package/kernel/mac80211/patches/600-19-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch new file mode 100644 index 0000000000..645b3c54e9 --- /dev/null +++ b/package/kernel/mac80211/patches/600-19-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch @@ -0,0 +1,32 @@ +From 6d668fef3a1baa60bdd715ee062ddb6333d2647c Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Mon, 30 Sep 2013 16:58:23 +0200 +Subject: [PATCH] rt2x00: rt2800lib: fix LNA gain configuration for RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -1911,7 +1911,8 @@ static void rt2800_config_lna_gain(struc + rt2800_eeprom_read(rt2x00dev, EEPROM_LNA, &eeprom); + lna_gain = rt2x00_get_field16(eeprom, EEPROM_LNA_A0); + } else if (libconf->rf.channel <= 128) { +- if (rt2x00_rt(rt2x00dev, RT3593)) { ++ if (rt2x00_rt(rt2x00dev, RT3593) || ++ rt2x00_rt(rt2x00dev, RT3883)) { + rt2800_eeprom_read(rt2x00dev, EEPROM_EXT_LNA2, &eeprom); + lna_gain = rt2x00_get_field16(eeprom, + EEPROM_EXT_LNA2_A1); +@@ -1921,7 +1922,8 @@ static void rt2800_config_lna_gain(struc + EEPROM_RSSI_BG2_LNA_A1); + } + } else { +- if (rt2x00_rt(rt2x00dev, RT3593)) { ++ if (rt2x00_rt(rt2x00dev, RT3593) || ++ rt2x00_rt(rt2x00dev, RT3883)) { + rt2800_eeprom_read(rt2x00dev, EEPROM_EXT_LNA2, &eeprom); + lna_gain = rt2x00_get_field16(eeprom, + EEPROM_EXT_LNA2_A2); diff --git a/package/kernel/mac80211/patches/600-20-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch b/package/kernel/mac80211/patches/600-20-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch new file mode 100644 index 0000000000..57ea80ea0f --- /dev/null +++ b/package/kernel/mac80211/patches/600-20-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch @@ -0,0 +1,44 @@ +From c49b2d829aa1c816a46a577cdec6d2ff14d9f06e Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Tue, 1 Oct 2013 15:40:08 +0200 +Subject: [PATCH] rt2x00: rt2800lib: fix VGC setup for RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -4799,7 +4799,8 @@ static u8 rt2800_get_default_vgc(struct + else + vgc = 0x2e + rt2x00dev->lna_gain; + } else { /* 5GHZ band */ +- if (rt2x00_rt(rt2x00dev, RT3593)) ++ if (rt2x00_rt(rt2x00dev, RT3593) || ++ rt2x00_rt(rt2x00dev, RT3883)) + vgc = 0x20 + (rt2x00dev->lna_gain * 5) / 3; + else if (rt2x00_rt(rt2x00dev, RT5592)) + vgc = 0x24 + (2 * rt2x00dev->lna_gain); +@@ -4819,7 +4820,8 @@ static inline void rt2800_set_vgc(struct + { + if (qual->vgc_level != vgc_level) { + if (rt2x00_rt(rt2x00dev, RT3572) || +- rt2x00_rt(rt2x00dev, RT3593)) { ++ rt2x00_rt(rt2x00dev, RT3593) || ++ rt2x00_rt(rt2x00dev, RT3883)) { + rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, + vgc_level); + } else if (rt2x00_rt(rt2x00dev, RT5592)) { +@@ -4866,6 +4868,11 @@ void rt2800_link_tuner(struct rt2x00_dev + } + break; + ++ case RT3883: ++ if (qual->rssi > -65) ++ vgc += 0x10; ++ break; ++ + case RT5592: + if (qual->rssi > -65) + vgc += 0x20; diff --git a/package/kernel/mac80211/patches/600-21-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch b/package/kernel/mac80211/patches/600-21-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch new file mode 100644 index 0000000000..bb6f4fd684 --- /dev/null +++ b/package/kernel/mac80211/patches/600-21-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch @@ -0,0 +1,42 @@ +From 1616650aea676541d4dc8adc6f4219856d193c8b Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Tue, 1 Oct 2013 17:27:57 +0200 +Subject: [PATCH] rt2x00: rt2800lib: fix EEPROM LNA validation for RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -7676,7 +7676,8 @@ static int rt2800_validate_eeprom(struct + rt2800_eeprom_read(rt2x00dev, EEPROM_RSSI_BG2, &word); + if (abs(rt2x00_get_field16(word, EEPROM_RSSI_BG2_OFFSET2)) > 10) + rt2x00_set_field16(&word, EEPROM_RSSI_BG2_OFFSET2, 0); +- if (!rt2x00_rt(rt2x00dev, RT3593)) { ++ if (!rt2x00_rt(rt2x00dev, RT3593) && ++ !rt2x00_rt(rt2x00dev, RT3883)) { + if (rt2x00_get_field16(word, EEPROM_RSSI_BG2_LNA_A1) == 0x00 || + rt2x00_get_field16(word, EEPROM_RSSI_BG2_LNA_A1) == 0xff) + rt2x00_set_field16(&word, EEPROM_RSSI_BG2_LNA_A1, +@@ -7696,7 +7697,8 @@ static int rt2800_validate_eeprom(struct + rt2800_eeprom_read(rt2x00dev, EEPROM_RSSI_A2, &word); + if (abs(rt2x00_get_field16(word, EEPROM_RSSI_A2_OFFSET2)) > 10) + rt2x00_set_field16(&word, EEPROM_RSSI_A2_OFFSET2, 0); +- if (!rt2x00_rt(rt2x00dev, RT3593)) { ++ if (!rt2x00_rt(rt2x00dev, RT3593) && ++ !rt2x00_rt(rt2x00dev, RT3883)) { + if (rt2x00_get_field16(word, EEPROM_RSSI_A2_LNA_A2) == 0x00 || + rt2x00_get_field16(word, EEPROM_RSSI_A2_LNA_A2) == 0xff) + rt2x00_set_field16(&word, EEPROM_RSSI_A2_LNA_A2, +@@ -7704,7 +7706,8 @@ static int rt2800_validate_eeprom(struct + } + rt2800_eeprom_write(rt2x00dev, EEPROM_RSSI_A2, word); + +- if (rt2x00_rt(rt2x00dev, RT3593)) { ++ if (rt2x00_rt(rt2x00dev, RT3593) || ++ rt2x00_rt(rt2x00dev, RT3883)) { + rt2800_eeprom_read(rt2x00dev, EEPROM_EXT_LNA2, &word); + if (rt2x00_get_field16(word, EEPROM_EXT_LNA2_A1) == 0x00 || + rt2x00_get_field16(word, EEPROM_EXT_LNA2_A1) == 0xff) diff --git a/package/kernel/mac80211/patches/600-22-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch b/package/kernel/mac80211/patches/600-22-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch new file mode 100644 index 0000000000..b4872b5108 --- /dev/null +++ b/package/kernel/mac80211/patches/600-22-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch @@ -0,0 +1,22 @@ +From e3871034a0e7c8a95152dc3eafbcc4535398cbdc Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Wed, 2 Oct 2013 10:11:59 +0200 +Subject: [PATCH] rt2x00: rt2800lib: fix txpower compensation for RT3883 + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -3965,6 +3965,9 @@ static u8 rt2800_compensate_txpower(stru + if (rt2x00_rt(rt2x00dev, RT3593)) + return min_t(u8, txpower, 0xc); + ++ if (rt2x00_rt(rt2x00dev, RT3883)) ++ return min_t(u8, txpower, 0xf); ++ + if (rt2x00_has_cap_power_limit(rt2x00dev)) { + /* + * Check if eirp txpower exceed txpower_limit. diff --git a/package/kernel/mac80211/patches/600-23-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch b/package/kernel/mac80211/patches/600-23-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch new file mode 100644 index 0000000000..a6dc6a6afb --- /dev/null +++ b/package/kernel/mac80211/patches/600-23-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch @@ -0,0 +1,136 @@ +From 5e67d4f8a46d19748b501c2ef86de3f50d3cfd51 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Sun, 24 Mar 2013 19:26:27 +0100 +Subject: [PATCH] rt2x00: rt2800mmio: add a workaround for spurious + TX_FIFO_STATUS interrupts + +Signed-off-by: Gabor Juhos +--- + drivers/net/wireless/ralink/rt2x00/rt2800mmio.c | 72 +++++++++++++++++++++++++----- + drivers/net/wireless/ralink/rt2x00/rt2x00.h | 5 +++ + 2 files changed, 65 insertions(+), 12 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c +@@ -415,9 +415,9 @@ void rt2800mmio_autowake_tasklet(unsigne + } + EXPORT_SYMBOL_GPL(rt2800mmio_autowake_tasklet); + +-static void rt2800mmio_txstatus_interrupt(struct rt2x00_dev *rt2x00dev) ++static void rt2800mmio_txstatus_interrupt(struct rt2x00_dev *rt2x00dev, ++ u32 status) + { +- u32 status; + int i; + + /* +@@ -438,29 +438,77 @@ static void rt2800mmio_txstatus_interrup + * Since we have only one producer and one consumer we don't + * need to lock the kfifo. + */ +- for (i = 0; i < rt2x00dev->tx->limit; i++) { +- rt2x00mmio_register_read(rt2x00dev, TX_STA_FIFO, &status); +- +- if (!rt2x00_get_field32(status, TX_STA_FIFO_VALID)) +- break; +- ++ i = 0; ++ do { + if (!kfifo_put(&rt2x00dev->txstatus_fifo, status)) { +- rt2x00_warn(rt2x00dev, "TX status FIFO overrun, drop tx status report\n"); ++ rt2x00_warn(rt2x00dev, ++ "TX status FIFO overrun, drop TX status report\n"); + break; + } +- } ++ ++ if (++i >= rt2x00dev->tx->limit) ++ break; ++ ++ rt2x00mmio_register_read(rt2x00dev, TX_STA_FIFO, &status); ++ } while (rt2x00_get_field32(status, TX_STA_FIFO_VALID)); + + /* Schedule the tasklet for processing the tx status. */ + tasklet_schedule(&rt2x00dev->txstatus_tasklet); + } + ++#define RT2800MMIO_TXSTATUS_IRQ_MAX_RETRIES 4 ++ ++static bool rt2800mmio_txstatus_is_spurious(struct rt2x00_dev *rt2x00dev, ++ u32 txstatus) ++{ ++ if (likely(rt2x00_get_field32(txstatus, TX_STA_FIFO_VALID))) { ++ rt2x00dev->txstatus_irq_retries = 0; ++ return false; ++ } ++ ++ rt2x00dev->txstatus_irq_retries++; ++ ++ /* Ensure that we don't go into an infinite IRQ loop. */ ++ if (rt2x00dev->txstatus_irq_retries >= ++ RT2800MMIO_TXSTATUS_IRQ_MAX_RETRIES) { ++ rt2x00_warn(rt2x00dev, ++ "%u spurious TX_FIFO_STATUS interrupt(s)\n", ++ rt2x00dev->txstatus_irq_retries); ++ rt2x00dev->txstatus_irq_retries = 0; ++ return false; ++ } ++ ++ return true; ++} ++ + irqreturn_t rt2800mmio_interrupt(int irq, void *dev_instance) + { + struct rt2x00_dev *rt2x00dev = dev_instance; + u32 reg, mask; ++ u32 txstatus = 0; + +- /* Read status and ACK all interrupts */ ++ /* Read status */ + rt2x00mmio_register_read(rt2x00dev, INT_SOURCE_CSR, ®); ++ ++ if (rt2x00_get_field32(reg, INT_SOURCE_CSR_TX_FIFO_STATUS)) { ++ /* Due to unknown reason the hardware generates a ++ * TX_FIFO_STATUS interrupt before the TX_STA_FIFO ++ * register contain valid data. Read the TX status ++ * here to see if we have to process the actual ++ * request. ++ */ ++ rt2x00mmio_register_read(rt2x00dev, TX_STA_FIFO, &txstatus); ++ if (rt2800mmio_txstatus_is_spurious(rt2x00dev, txstatus)) { ++ /* Remove the TX_FIFO_STATUS bit so it won't be ++ * processed in this turn. The hardware will ++ * generate another IRQ for us. ++ */ ++ rt2x00_set_field32(®, ++ INT_SOURCE_CSR_TX_FIFO_STATUS, 0); ++ } ++ } ++ ++ /* ACK interrupts */ + rt2x00mmio_register_write(rt2x00dev, INT_SOURCE_CSR, reg); + + if (!reg) +@@ -477,7 +525,7 @@ irqreturn_t rt2800mmio_interrupt(int irq + mask = ~reg; + + if (rt2x00_get_field32(reg, INT_SOURCE_CSR_TX_FIFO_STATUS)) { +- rt2800mmio_txstatus_interrupt(rt2x00dev); ++ rt2800mmio_txstatus_interrupt(rt2x00dev, txstatus); + /* + * Never disable the TX_FIFO_STATUS interrupt. + */ +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h +@@ -999,6 +999,11 @@ struct rt2x00_dev { + int rf_channel; + + /* ++ * Counter for tx status irq retries (rt2800pci). ++ */ ++ unsigned int txstatus_irq_retries; ++ ++ /* + * Protect the interrupt mask register. + */ + spinlock_t irqmask_lock; diff --git a/package/kernel/mac80211/patches/601-rt2x00-introduce-rt2x00_platform_h.patch b/package/kernel/mac80211/patches/601-rt2x00-introduce-rt2x00_platform_h.patch new file mode 100644 index 0000000000..9d47076ff6 --- /dev/null +++ b/package/kernel/mac80211/patches/601-rt2x00-introduce-rt2x00_platform_h.patch @@ -0,0 +1,32 @@ +--- /dev/null ++++ b/include/linux/rt2x00_platform.h +@@ -0,0 +1,19 @@ ++/* ++ * Platform data definition for the rt2x00 driver ++ * ++ * Copyright (C) 2011 Gabor Juhos ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 as published ++ * by the Free Software Foundation. ++ * ++ */ ++ ++#ifndef _RT2X00_PLATFORM_H ++#define _RT2X00_PLATFORM_H ++ ++struct rt2x00_platform_data { ++ char *eeprom_file_name; ++}; ++ ++#endif /* _RT2X00_PLATFORM_H */ +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + + #include + diff --git a/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch b/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch new file mode 100644 index 0000000000..65711ae330 --- /dev/null +++ b/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch @@ -0,0 +1,295 @@ +--- a/.local-symbols ++++ b/.local-symbols +@@ -336,6 +336,7 @@ RT2X00_LIB_FIRMWARE= + RT2X00_LIB_CRYPTO= + RT2X00_LIB_LEDS= + RT2X00_LIB_DEBUGFS= ++RT2X00_LIB_EEPROM= + RT2X00_DEBUG= + WLAN_VENDOR_REALTEK= + RTL8180= +--- a/drivers/net/wireless/ralink/rt2x00/Kconfig ++++ b/drivers/net/wireless/ralink/rt2x00/Kconfig +@@ -69,6 +69,7 @@ config RT2800PCI + select RT2X00_LIB_MMIO + select RT2X00_LIB_PCI + select RT2X00_LIB_FIRMWARE ++ select RT2X00_LIB_EEPROM + select RT2X00_LIB_CRYPTO + depends on CRC_CCITT + depends on EEPROM_93CX6 +@@ -215,6 +216,7 @@ config RT2800SOC + select RT2X00_LIB_MMIO + select RT2X00_LIB_CRYPTO + select RT2X00_LIB_FIRMWARE ++ select RT2X00_LIB_EEPROM + select RT2800_LIB + select RT2800_LIB_MMIO + ---help--- +@@ -265,6 +267,9 @@ config RT2X00_LIB_FIRMWARE + config RT2X00_LIB_CRYPTO + bool + ++config RT2X00_LIB_EEPROM ++ boolean ++ + config RT2X00_LIB_LEDS + bool + default y if (RT2X00_LIB=y && LEDS_CLASS=y) || (RT2X00_LIB=m && LEDS_CLASS!=n) +--- a/drivers/net/wireless/ralink/rt2x00/Makefile ++++ b/drivers/net/wireless/ralink/rt2x00/Makefile +@@ -7,6 +7,7 @@ rt2x00lib-$(CPTCFG_RT2X00_LIB_DEBUGFS) + + rt2x00lib-$(CPTCFG_RT2X00_LIB_CRYPTO) += rt2x00crypto.o + rt2x00lib-$(CPTCFG_RT2X00_LIB_FIRMWARE) += rt2x00firmware.o + rt2x00lib-$(CPTCFG_RT2X00_LIB_LEDS) += rt2x00leds.o ++rt2x00lib-$(CPTCFG_RT2X00_LIB_EEPROM) += rt2x00eeprom.o + + obj-$(CPTCFG_RT2X00_LIB) += rt2x00lib.o + obj-$(CPTCFG_RT2X00_LIB_MMIO) += rt2x00mmio.o +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h +@@ -20,6 +20,8 @@ + #ifndef RT2800LIB_H + #define RT2800LIB_H + ++#include "rt2800.h" ++ + struct rt2800_ops { + void (*register_read)(struct rt2x00_dev *rt2x00dev, + const unsigned int offset, u32 *value); +@@ -119,6 +121,15 @@ static inline int rt2800_read_eeprom(str + { + const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv; + ++ if (rt2x00dev->eeprom_file) { ++ memcpy(rt2x00dev->eeprom, rt2x00dev->eeprom_file->data, ++ EEPROM_SIZE); ++ return 0; ++ } ++ ++ if (!rt2800ops->read_eeprom) ++ return -EINVAL; ++ + return rt2800ops->read_eeprom(rt2x00dev); + } + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c +@@ -102,19 +102,6 @@ static int rt2800soc_set_device_state(st + return retval; + } + +-static int rt2800soc_read_eeprom(struct rt2x00_dev *rt2x00dev) +-{ +- void __iomem *base_addr = ioremap(0x1F040000, EEPROM_SIZE); +- +- if (!base_addr) +- return -ENOMEM; +- +- memcpy_fromio(rt2x00dev->eeprom, base_addr, EEPROM_SIZE); +- +- iounmap(base_addr); +- return 0; +-} +- + /* Firmware functions */ + static char *rt2800soc_get_firmware_name(struct rt2x00_dev *rt2x00dev) + { +@@ -178,7 +165,6 @@ static const struct rt2800_ops rt2800soc + .register_multiread = rt2x00mmio_register_multiread, + .register_multiwrite = rt2x00mmio_register_multiwrite, + .regbusy_read = rt2x00mmio_regbusy_read, +- .read_eeprom = rt2800soc_read_eeprom, + .hwcrypt_disabled = rt2800soc_hwcrypt_disabled, + .drv_write_firmware = rt2800soc_write_firmware, + .drv_init_registers = rt2800mmio_init_registers, +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h +@@ -701,6 +701,7 @@ enum rt2x00_capability_flags { + REQUIRE_HT_TX_DESC, + REQUIRE_PS_AUTOWAKE, + REQUIRE_DELAYED_RFKILL, ++ REQUIRE_EEPROM_FILE, + + /* + * Capabilities +@@ -976,6 +977,11 @@ struct rt2x00_dev { + const struct firmware *fw; + + /* ++ * EEPROM image. ++ */ ++ const struct firmware *eeprom_file; ++ ++ /* + * FIFO for storing tx status reports between isr and tasklet. + */ + DECLARE_KFIFO_PTR(txstatus_fifo, u32); +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +@@ -1346,6 +1346,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de + INIT_DELAYED_WORK(&rt2x00dev->autowakeup_work, rt2x00lib_autowakeup); + INIT_WORK(&rt2x00dev->sleep_work, rt2x00lib_sleep); + ++ retval = rt2x00lib_load_eeprom_file(rt2x00dev); ++ if (retval) ++ goto exit; ++ + /* + * Let the driver probe the device to detect the capabilities. + */ +@@ -1484,6 +1488,11 @@ void rt2x00lib_remove_dev(struct rt2x00_ + * Free the driver data. + */ + kfree(rt2x00dev->drv_data); ++ ++ /* ++ * Free EEPROM image. ++ */ ++ rt2x00lib_free_eeprom_file(rt2x00dev); + } + EXPORT_SYMBOL_GPL(rt2x00lib_remove_dev); + +--- /dev/null ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c +@@ -0,0 +1,105 @@ ++/* ++ Copyright (C) 2004 - 2009 Ivo van Doorn ++ Copyright (C) 2004 - 2009 Gertjan van Wingerde ++ ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the ++ Free Software Foundation, Inc., ++ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ */ ++ ++/* ++ Module: rt2x00lib ++ Abstract: rt2x00 eeprom file loading routines. ++ */ ++ ++#include ++#include ++ ++#include "rt2x00.h" ++#include "rt2x00lib.h" ++ ++static const char * ++rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev) ++{ ++ struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data; ++ ++ if (pdata && pdata->eeprom_file_name) ++ return pdata->eeprom_file_name; ++ ++ return NULL ++} ++ ++static int rt2x00lib_request_eeprom_file(struct rt2x00_dev *rt2x00dev) ++{ ++ const struct firmware *ee; ++ const char *ee_name; ++ int retval; ++ ++ ee_name = rt2x00lib_get_eeprom_file_name(rt2x00dev); ++ if (!ee_name && test_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags)) { ++ rt2x00_err(rt2x00dev, "Required EEPROM name is missing."); ++ return -EINVAL; ++ } ++ ++ if (!ee_name) ++ return 0; ++ ++ rt2x00_info(rt2x00dev, "Loading EEPROM data from '%s'.\n", ee_name); ++ ++ retval = request_firmware(&ee, ee_name, rt2x00dev->dev); ++ if (retval) { ++ rt2x00_err(rt2x00dev, "Failed to request EEPROM.\n"); ++ return retval; ++ } ++ ++ if (!ee || !ee->size || !ee->data) { ++ rt2x00_err(rt2x00dev, "Failed to read EEPROM file.\n"); ++ retval = -ENOENT; ++ goto err_exit; ++ } ++ ++ if (ee->size != rt2x00dev->ops->eeprom_size) { ++ rt2x00_err(rt2x00dev, ++ "EEPROM file size is invalid, it should be %d bytes\n", ++ rt2x00dev->ops->eeprom_size); ++ retval = -EINVAL; ++ goto err_release_ee; ++ } ++ ++ rt2x00dev->eeprom_file = ee; ++ return 0; ++ ++err_release_ee: ++ release_firmware(ee); ++err_exit: ++ return retval; ++} ++ ++int rt2x00lib_load_eeprom_file(struct rt2x00_dev *rt2x00dev) ++{ ++ int retval; ++ ++ retval = rt2x00lib_request_eeprom_file(rt2x00dev); ++ if (retval) ++ return retval; ++ ++ return 0; ++} ++ ++void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev) ++{ ++ release_firmware(rt2x00dev->eeprom_file); ++ rt2x00dev->eeprom_file = NULL; ++} +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00lib.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00lib.h +@@ -297,6 +297,22 @@ static inline void rt2x00lib_free_firmwa + #endif /* CPTCFG_RT2X00_LIB_FIRMWARE */ + + /* ++ * EEPROM file handlers. ++ */ ++#ifdef CPTCFG_RT2X00_LIB_EEPROM ++int rt2x00lib_load_eeprom_file(struct rt2x00_dev *rt2x00dev); ++void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev); ++#else ++static inline int rt2x00lib_load_eeprom_file(struct rt2x00_dev *rt2x00dev) ++{ ++ return 0; ++} ++static inline void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev) ++{ ++} ++#endif /* CPTCFG_RT2X00_LIB_EEPROM */ ++ ++/* + * Debugfs handlers. + */ + #ifdef CPTCFG_RT2X00_LIB_DEBUGFS +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c +@@ -97,6 +97,7 @@ int rt2x00soc_probe(struct platform_devi + if (IS_ERR(rt2x00dev->clk)) + rt2x00dev->clk = NULL; + ++ set_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags); + rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_SOC); + + retval = rt2x00soc_alloc_reg(rt2x00dev); diff --git a/package/kernel/mac80211/patches/603-rt2x00-of_load_eeprom_filename.patch b/package/kernel/mac80211/patches/603-rt2x00-of_load_eeprom_filename.patch new file mode 100644 index 0000000000..9dffef1812 --- /dev/null +++ b/package/kernel/mac80211/patches/603-rt2x00-of_load_eeprom_filename.patch @@ -0,0 +1,33 @@ +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c +@@ -26,6 +26,7 @@ + + #include + #include ++#include + + #include "rt2x00.h" + #include "rt2x00lib.h" +@@ -34,11 +35,21 @@ static const char * + rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev) + { + struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data; ++#ifdef CONFIG_OF ++ struct device_node *np; ++ const char *eep; ++#endif + + if (pdata && pdata->eeprom_file_name) + return pdata->eeprom_file_name; + +- return NULL ++#ifdef CONFIG_OF ++ np = rt2x00dev->dev->of_node; ++ if (np && of_property_read_string(np, "ralink,eeprom", &eep) == 0) ++ return eep; ++#endif ++ ++ return NULL; + } + + static int rt2x00lib_request_eeprom_file(struct rt2x00_dev *rt2x00dev) diff --git a/package/kernel/mac80211/patches/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch b/package/kernel/mac80211/patches/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch new file mode 100644 index 0000000000..a98b49c541 --- /dev/null +++ b/package/kernel/mac80211/patches/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch @@ -0,0 +1,108 @@ +From 339fe73f340161a624cc08e738d2244814852c3e Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Sun, 17 Mar 2013 00:55:04 +0100 +Subject: [PATCH] rt2x00: load eeprom on SoC from a mtd device defines inside + OF + +Signed-off-by: John Crispin +--- + drivers/net/wireless/ralink/rt2x00/Kconfig | 1 + + drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c | 65 +++++++++++++++++++++++ + 2 files changed, 66 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/Kconfig ++++ b/drivers/net/wireless/ralink/rt2x00/Kconfig +@@ -219,6 +219,7 @@ config RT2800SOC + select RT2X00_LIB_EEPROM + select RT2800_LIB + select RT2800_LIB_MMIO ++ select MTD if SOC_RT288X || SOC_RT305X + ---help--- + This adds support for Ralink WiSoC devices. + Supported chips: RT2880, RT3050, RT3052, RT3350, RT3352. +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c +@@ -26,11 +26,73 @@ + + #include + #include ++#include ++#include + #include + + #include "rt2x00.h" + #include "rt2x00lib.h" + ++static int rt2800lib_read_eeprom_mtd(struct rt2x00_dev *rt2x00dev) ++{ ++ int ret = -EINVAL; ++#ifdef CONFIG_OF ++ static struct firmware mtd_fw; ++ struct device_node *np = rt2x00dev->dev->of_node, *mtd_np = NULL; ++ size_t retlen, len = rt2x00dev->ops->eeprom_size; ++ int i, size, offset = 0; ++ struct mtd_info *mtd; ++ const char *part; ++ const __be32 *list; ++ phandle phandle; ++ ++ list = of_get_property(np, "ralink,mtd-eeprom", &size); ++ if (!list) ++ return -ENOENT; ++ ++ phandle = be32_to_cpup(list++); ++ if (phandle) ++ mtd_np = of_find_node_by_phandle(phandle); ++ if (!mtd_np) { ++ dev_err(rt2x00dev->dev, "failed to load mtd phandle\n"); ++ return -EINVAL; ++ } ++ ++ part = of_get_property(mtd_np, "label", NULL); ++ if (!part) ++ part = mtd_np->name; ++ ++ mtd = get_mtd_device_nm(part); ++ if (IS_ERR(mtd)) { ++ dev_err(rt2x00dev->dev, "failed to get mtd device \"%s\"\n", part); ++ return PTR_ERR(mtd); ++ } ++ ++ if (size > sizeof(*list)) ++ offset = be32_to_cpup(list); ++ ++ ret = mtd_read(mtd, offset, len, &retlen, (u_char *) rt2x00dev->eeprom); ++ put_mtd_device(mtd); ++ ++ if ((retlen != rt2x00dev->ops->eeprom_size) || ret) { ++ dev_err(rt2x00dev->dev, "failed to load eeprom from device \"%s\"\n", part); ++ return ret; ++ } ++ ++ if (of_find_property(np, "ralink,mtd-eeprom-swap", NULL)) ++ for (i = 0; i < len/sizeof(u16); i++) ++ rt2x00dev->eeprom[i] = swab16(rt2x00dev->eeprom[i]); ++ ++ rt2x00dev->eeprom_file = &mtd_fw; ++ mtd_fw.size = len; ++ mtd_fw.data = (const u8 *) rt2x00dev->eeprom; ++ ++ dev_info(rt2x00dev->dev, "loaded eeprom from mtd device \"%s\"\n", part); ++#endif ++ ++ return ret; ++} ++ + static const char * + rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev) + { +@@ -58,6 +120,9 @@ static int rt2x00lib_request_eeprom_file + const char *ee_name; + int retval; + ++ if (!rt2800lib_read_eeprom_mtd(rt2x00dev)) ++ return 0; ++ + ee_name = rt2x00lib_get_eeprom_file_name(rt2x00dev); + if (!ee_name && test_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags)) { + rt2x00_err(rt2x00dev, "Required EEPROM name is missing."); diff --git a/package/kernel/mac80211/patches/606-rt2x00-allow_disabling_bands_through_platform_data.patch b/package/kernel/mac80211/patches/606-rt2x00-allow_disabling_bands_through_platform_data.patch new file mode 100644 index 0000000000..522670ece7 --- /dev/null +++ b/package/kernel/mac80211/patches/606-rt2x00-allow_disabling_bands_through_platform_data.patch @@ -0,0 +1,47 @@ +--- a/include/linux/rt2x00_platform.h ++++ b/include/linux/rt2x00_platform.h +@@ -14,6 +14,9 @@ + + struct rt2x00_platform_data { + char *eeprom_file_name; ++ ++ int disable_2ghz; ++ int disable_5ghz; + }; + + #endif /* _RT2X00_PLATFORM_H */ +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +@@ -951,6 +951,22 @@ static int rt2x00lib_probe_hw_modes(stru + unsigned int num_rates; + unsigned int i; + ++ if (rt2x00dev->dev->platform_data) { ++ struct rt2x00_platform_data *pdata; ++ ++ pdata = rt2x00dev->dev->platform_data; ++ if (pdata->disable_2ghz) ++ spec->supported_bands &= ~SUPPORT_BAND_2GHZ; ++ if (pdata->disable_5ghz) ++ spec->supported_bands &= ~SUPPORT_BAND_5GHZ; ++ } ++ ++ if ((spec->supported_bands & SUPPORT_BAND_BOTH) == 0) { ++ rt2x00_err(rt2x00dev, "No supported bands\n"); ++ return -EINVAL; ++ } ++ ++ + num_rates = 0; + if (spec->supported_rates & SUPPORT_RATE_CCK) + num_rates += 4; +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h +@@ -408,6 +408,7 @@ struct hw_mode_spec { + unsigned int supported_bands; + #define SUPPORT_BAND_2GHZ 0x00000001 + #define SUPPORT_BAND_5GHZ 0x00000002 ++#define SUPPORT_BAND_BOTH (SUPPORT_BAND_2GHZ | SUPPORT_BAND_5GHZ) + + unsigned int supported_rates; + #define SUPPORT_RATE_CCK 0x00000001 diff --git a/package/kernel/mac80211/patches/607-rt2x00-add_platform_data_mac_addr.patch b/package/kernel/mac80211/patches/607-rt2x00-add_platform_data_mac_addr.patch new file mode 100644 index 0000000000..5a3f858090 --- /dev/null +++ b/package/kernel/mac80211/patches/607-rt2x00-add_platform_data_mac_addr.patch @@ -0,0 +1,26 @@ +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +@@ -929,8 +929,13 @@ static void rt2x00lib_rate(struct ieee80 + + void rt2x00lib_set_mac_address(struct rt2x00_dev *rt2x00dev, u8 *eeprom_mac_addr) + { ++ struct rt2x00_platform_data *pdata; + const char *mac_addr; + ++ pdata = rt2x00dev->dev->platform_data; ++ if (pdata && pdata->mac_address) ++ ether_addr_copy(eeprom_mac_addr, pdata->mac_address); ++ + mac_addr = of_get_mac_address(rt2x00dev->dev->of_node); + if (mac_addr) + ether_addr_copy(eeprom_mac_addr, mac_addr); +--- a/include/linux/rt2x00_platform.h ++++ b/include/linux/rt2x00_platform.h +@@ -14,6 +14,7 @@ + + struct rt2x00_platform_data { + char *eeprom_file_name; ++ const u8 *mac_address; + + int disable_2ghz; + int disable_5ghz; diff --git a/package/kernel/mac80211/patches/608-rt2x00-allow_disabling_bands_through_dts.patch b/package/kernel/mac80211/patches/608-rt2x00-allow_disabling_bands_through_dts.patch new file mode 100644 index 0000000000..e312c1dc8a --- /dev/null +++ b/package/kernel/mac80211/patches/608-rt2x00-allow_disabling_bands_through_dts.patch @@ -0,0 +1,19 @@ +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +@@ -955,6 +955,16 @@ static int rt2x00lib_probe_hw_modes(stru + struct ieee80211_rate *rates; + unsigned int num_rates; + unsigned int i; ++#ifdef CONFIG_OF ++ struct device_node *np = rt2x00dev->dev->of_node; ++ unsigned int enabled; ++ if (!of_property_read_u32(np, "ralink,2ghz", ++ &enabled) && !enabled) ++ spec->supported_bands &= ~SUPPORT_BAND_2GHZ; ++ if (!of_property_read_u32(np, "ralink,5ghz", ++ &enabled) && !enabled) ++ spec->supported_bands &= ~SUPPORT_BAND_5GHZ; ++#endif /* CONFIG_OF */ + + if (rt2x00dev->dev->platform_data) { + struct rt2x00_platform_data *pdata; diff --git a/package/kernel/mac80211/patches/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch b/package/kernel/mac80211/patches/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch new file mode 100644 index 0000000000..02b66e3bc0 --- /dev/null +++ b/package/kernel/mac80211/patches/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch @@ -0,0 +1,33 @@ +From 04dbd87265f6ba4a373b211ba324b437d224fb2d Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Sun, 17 Mar 2013 00:03:31 +0100 +Subject: [PATCH 21/38] rt2x00: make wmac loadable via OF on rt288x/305x SoC + +This patch ads the match table to allow loading the wmac support from a +devicetree. + +Signed-off-by: John Crispin +--- + drivers/net/wireless/ralink/rt2x00/rt2800pci.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c +@@ -234,10 +234,17 @@ static int rt2800soc_probe(struct platfo + return rt2x00soc_probe(pdev, &rt2800soc_ops); + } + ++static const struct of_device_id rt2880_wmac_match[] = { ++ { .compatible = "ralink,rt2880-wmac" }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, rt2880_wmac_match); ++ + static struct platform_driver rt2800soc_driver = { + .driver = { + .name = "rt2800_wmac", + .mod_name = KBUILD_MODNAME, ++ .of_match_table = rt2880_wmac_match, + }, + .probe = rt2800soc_probe, + .remove = rt2x00soc_remove, diff --git a/package/kernel/mac80211/patches/610-rt2x00-change-led-polarity-from-OF.patch b/package/kernel/mac80211/patches/610-rt2x00-change-led-polarity-from-OF.patch new file mode 100644 index 0000000000..89fc706100 --- /dev/null +++ b/package/kernel/mac80211/patches/610-rt2x00-change-led-polarity-from-OF.patch @@ -0,0 +1,40 @@ +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + + #include "rt2x00.h" + #include "rt2800lib.h" +@@ -7861,6 +7862,17 @@ static int rt2800_init_eeprom(struct rt2 + rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); + rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY); + ++ { ++ struct device_node *np = rt2x00dev->dev->of_node; ++ unsigned int led_polarity; ++ ++ /* Allow overriding polarity from OF */ ++ if (!of_property_read_u32(np, "ralink,led-polarity", ++ &led_polarity)) ++ rt2x00_set_field16(&eeprom, EEPROM_FREQ_LED_POLARITY, ++ led_polarity); ++ } ++ + rt2x00dev->led_mcu_reg = eeprom; + #endif /* CPTCFG_RT2X00_LIB_LEDS */ + +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00leds.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00leds.c +@@ -109,6 +109,9 @@ static int rt2x00leds_register_led(struc + led->led_dev.name = name; + led->led_dev.brightness = LED_OFF; + ++ if (rt2x00_is_soc(rt2x00dev)) ++ led->led_dev.brightness_set(&led->led_dev, LED_OFF); ++ + retval = led_classdev_register(device, &led->led_dev); + if (retval) { + rt2x00_err(rt2x00dev, "Failed to register led handler\n"); diff --git a/package/kernel/mac80211/patches/611-rt2x00-add-AP+STA-support.patch b/package/kernel/mac80211/patches/611-rt2x00-add-AP+STA-support.patch new file mode 100644 index 0000000000..2dac89566a --- /dev/null +++ b/package/kernel/mac80211/patches/611-rt2x00-add-AP+STA-support.patch @@ -0,0 +1,11 @@ +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +@@ -1286,7 +1286,7 @@ static inline void rt2x00lib_set_if_comb + */ + if_limit = &rt2x00dev->if_limits_ap; + if_limit->max = rt2x00dev->ops->max_ap_intf; +- if_limit->types = BIT(NL80211_IFTYPE_AP); ++ if_limit->types = BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_STATION); + #ifdef CPTCFG_MAC80211_MESH + if_limit->types |= BIT(NL80211_IFTYPE_MESH_POINT); + #endif diff --git a/package/kernel/mac80211/patches/620-rt2x00-enable-rt2800soc-for-mt7620.patch b/package/kernel/mac80211/patches/620-rt2x00-enable-rt2800soc-for-mt7620.patch new file mode 100644 index 0000000000..bc9f799520 --- /dev/null +++ b/package/kernel/mac80211/patches/620-rt2x00-enable-rt2800soc-for-mt7620.patch @@ -0,0 +1,20 @@ +--- a/drivers/net/wireless/ralink/rt2x00/Kconfig ++++ b/drivers/net/wireless/ralink/rt2x00/Kconfig +@@ -211,7 +211,7 @@ endif + config RT2800SOC + tristate "Ralink WiSoC support" + depends on m +- depends on SOC_RT288X || SOC_RT305X || SOC_RT3883 ++ depends on SOC_RT288X || SOC_RT305X || SOC_RT3883 || SOC_MT7620 + select RT2X00_LIB_SOC + select RT2X00_LIB_MMIO + select RT2X00_LIB_CRYPTO +@@ -248,7 +248,7 @@ config RT2X00_LIB_PCI + + config RT2X00_LIB_SOC + tristate "RT2x00 SoC support" +- depends on SOC_RT288X || SOC_RT305X || SOC_RT3883 ++ depends on SOC_RT288X || SOC_RT305X || SOC_RT3883 || SOC_MT7620 + depends on m + select RT2X00_LIB + diff --git a/package/kernel/mac80211/patches/621-rt2x00-add-support-for-mt7620.patch b/package/kernel/mac80211/patches/621-rt2x00-add-support-for-mt7620.patch new file mode 100644 index 0000000000..41b7562137 --- /dev/null +++ b/package/kernel/mac80211/patches/621-rt2x00-add-support-for-mt7620.patch @@ -0,0 +1,1200 @@ +From: Roman Yeryomin +Date: Tue, 1 Jul 2014 10:26:18 +0000 +Subject: [PATCH] mac80211: rt2x00: add support for mt7620 + +Support for MT7620 was added to OpenWrt in r41441 and heavily reworked +since in order to match the Kernel's code quality standards. + +Signed-off-by: Roman Yeryomin +Signed-off-by: Daniel Golle +--- + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h +@@ -81,6 +81,7 @@ + #define RF5372 0x5372 + #define RF5390 0x5390 + #define RF5392 0x5392 ++#define RF7620 0x7620 + + /* + * Chipset revisions. +@@ -641,6 +642,14 @@ + #define RF_CSR_CFG_BUSY FIELD32(0x00020000) + + /* ++ * mt7620 RF registers (reversed order) ++ */ ++#define RF_CSR_CFG_DATA_MT7620 FIELD32(0x0000ff00) ++#define RF_CSR_CFG_REGNUM_MT7620 FIELD32(0x03ff0000) ++#define RF_CSR_CFG_WRITE_MT7620 FIELD32(0x00000010) ++#define RF_CSR_CFG_BUSY_MT7620 FIELD32(0x00000001) ++ ++/* + * EFUSE_CSR: RT30x0 EEPROM + */ + #define EFUSE_CTRL 0x0580 +@@ -1024,6 +1033,11 @@ + #define AUTOWAKEUP_CFG_AUTOWAKE FIELD32(0x00008000) + + /* ++ * mt7620 ++ */ ++#define MIMO_PS_CFG 0x1210 ++ ++/* + * EDCA_AC0_CFG: + */ + #define EDCA_AC0_CFG 0x1300 +@@ -1203,6 +1217,8 @@ + #define TX_PIN_CFG_RFTR_POL FIELD32(0x00020000) + #define TX_PIN_CFG_TRSW_EN FIELD32(0x00040000) + #define TX_PIN_CFG_TRSW_POL FIELD32(0x00080000) ++#define TX_PIN_CFG_RFRX_EN FIELD32(0x00100000) /* mt7620 */ ++#define TX_PIN_CFG_RFRX_POL FIELD32(0x00200000) /* mt7620 */ + #define TX_PIN_CFG_PA_PE_A2_EN FIELD32(0x01000000) + #define TX_PIN_CFG_PA_PE_G2_EN FIELD32(0x02000000) + #define TX_PIN_CFG_PA_PE_A2_POL FIELD32(0x04000000) +@@ -1549,6 +1565,17 @@ + #define TX_PWR_CFG_4_EXT_STBC4_CH2 FIELD32(0x0000000f) + #define TX_PWR_CFG_4_EXT_STBC6_CH2 FIELD32(0x00000f00) + ++/* mt7620 */ ++#define TX0_RF_GAIN_CORRECT 0x13a0 ++#define TX1_RF_GAIN_CORRECT 0x13a4 ++#define TX0_RF_GAIN_ATTEN 0x13a8 ++#define TX1_RF_GAIN_ATTEN 0x13ac ++#define TX_ALG_CFG_0 0x13b0 ++#define TX_ALG_CFG_1 0x13b4 ++#define TX0_BB_GAIN_ATTEN 0x13c0 ++#define TX1_BB_GAIN_ATTEN 0x13c4 ++#define TX_ALC_VGA3 0x13c8 ++ + /* TX_PWR_CFG_7 */ + #define TX_PWR_CFG_7 0x13d4 + #define TX_PWR_CFG_7_OFDM54_CH0 FIELD32(0x0000000f) +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -60,6 +60,9 @@ + rt2800_regbusy_read((__dev), BBP_CSR_CFG, BBP_CSR_CFG_BUSY, (__reg)) + #define WAIT_FOR_RFCSR(__dev, __reg) \ + rt2800_regbusy_read((__dev), RF_CSR_CFG, RF_CSR_CFG_BUSY, (__reg)) ++#define WAIT_FOR_RFCSR_MT7620(__dev, __reg) \ ++ rt2800_regbusy_read((__dev), RF_CSR_CFG, RF_CSR_CFG_BUSY_MT7620, \ ++ (__reg)) + #define WAIT_FOR_RF(__dev, __reg) \ + rt2800_regbusy_read((__dev), RF_CSR_CFG0, RF_CSR_CFG0_BUSY, (__reg)) + #define WAIT_FOR_MCU(__dev, __reg) \ +@@ -151,19 +154,56 @@ static void rt2800_rfcsr_write(struct rt + * Wait until the RFCSR becomes available, afterwards we + * can safely write the new data into the register. + */ +- if (WAIT_FOR_RFCSR(rt2x00dev, ®)) { +- reg = 0; +- rt2x00_set_field32(®, RF_CSR_CFG_DATA, value); +- rt2x00_set_field32(®, RF_CSR_CFG_REGNUM, word); +- rt2x00_set_field32(®, RF_CSR_CFG_WRITE, 1); +- rt2x00_set_field32(®, RF_CSR_CFG_BUSY, 1); ++ switch (rt2x00dev->chip.rf) { ++ case RF7620: ++ if (WAIT_FOR_RFCSR_MT7620(rt2x00dev, ®)) { ++ reg = 0; ++ rt2x00_set_field32(®, RF_CSR_CFG_DATA_MT7620, value); ++ rt2x00_set_field32(®, RF_CSR_CFG_REGNUM_MT7620, ++ word); ++ rt2x00_set_field32(®, RF_CSR_CFG_WRITE_MT7620, 1); ++ rt2x00_set_field32(®, RF_CSR_CFG_BUSY_MT7620, 1); ++ ++ rt2800_register_write_lock(rt2x00dev, RF_CSR_CFG, reg); ++ } ++ break; ++ ++ default: ++ if (WAIT_FOR_RFCSR(rt2x00dev, ®)) { ++ reg = 0; ++ rt2x00_set_field32(®, RF_CSR_CFG_DATA, value); ++ rt2x00_set_field32(®, RF_CSR_CFG_REGNUM, word); ++ rt2x00_set_field32(®, RF_CSR_CFG_WRITE, 1); ++ rt2x00_set_field32(®, RF_CSR_CFG_BUSY, 1); + +- rt2800_register_write_lock(rt2x00dev, RF_CSR_CFG, reg); ++ rt2800_register_write_lock(rt2x00dev, RF_CSR_CFG, reg); ++ } ++ break; + } + + mutex_unlock(&rt2x00dev->csr_mutex); + } + ++static void rt2800_rfcsr_write_bank(struct rt2x00_dev *rt2x00dev, const u8 bank, ++ const unsigned int reg, const u8 value) ++{ ++ rt2800_rfcsr_write(rt2x00dev, (reg | (bank << 6)), value); ++} ++ ++static void rt2800_rfcsr_write_chanreg(struct rt2x00_dev *rt2x00dev, ++ const unsigned int reg, const u8 value) ++{ ++ rt2800_rfcsr_write_bank(rt2x00dev, 4, reg, value); ++ rt2800_rfcsr_write_bank(rt2x00dev, 6, reg, value); ++} ++ ++static void rt2800_rfcsr_write_dccal(struct rt2x00_dev *rt2x00dev, ++ const unsigned int reg, const u8 value) ++{ ++ rt2800_rfcsr_write_bank(rt2x00dev, 5, reg, value); ++ rt2800_rfcsr_write_bank(rt2x00dev, 7, reg, value); ++} ++ + static void rt2800_rfcsr_read(struct rt2x00_dev *rt2x00dev, + const unsigned int word, u8 *value) + { +@@ -179,22 +219,48 @@ static void rt2800_rfcsr_read(struct rt2 + * doesn't become available in time, reg will be 0xffffffff + * which means we return 0xff to the caller. + */ +- if (WAIT_FOR_RFCSR(rt2x00dev, ®)) { +- reg = 0; +- rt2x00_set_field32(®, RF_CSR_CFG_REGNUM, word); +- rt2x00_set_field32(®, RF_CSR_CFG_WRITE, 0); +- rt2x00_set_field32(®, RF_CSR_CFG_BUSY, 1); ++ switch (rt2x00dev->chip.rf) { ++ case RF7620: ++ if (WAIT_FOR_RFCSR_MT7620(rt2x00dev, ®)) { ++ reg = 0; ++ rt2x00_set_field32(®, RF_CSR_CFG_REGNUM_MT7620, ++ word); ++ rt2x00_set_field32(®, RF_CSR_CFG_WRITE_MT7620, 0); ++ rt2x00_set_field32(®, RF_CSR_CFG_BUSY_MT7620, 1); + +- rt2800_register_write_lock(rt2x00dev, RF_CSR_CFG, reg); ++ rt2800_register_write_lock(rt2x00dev, RF_CSR_CFG, reg); + +- WAIT_FOR_RFCSR(rt2x00dev, ®); +- } ++ WAIT_FOR_RFCSR_MT7620(rt2x00dev, ®); ++ } ++ ++ *value = rt2x00_get_field32(reg, RF_CSR_CFG_DATA_MT7620); ++ break; ++ ++ default: ++ if (WAIT_FOR_RFCSR(rt2x00dev, ®)) { ++ reg = 0; ++ rt2x00_set_field32(®, RF_CSR_CFG_REGNUM, word); ++ rt2x00_set_field32(®, RF_CSR_CFG_WRITE, 0); ++ rt2x00_set_field32(®, RF_CSR_CFG_BUSY, 1); + +- *value = rt2x00_get_field32(reg, RF_CSR_CFG_DATA); ++ rt2800_register_write_lock(rt2x00dev, RF_CSR_CFG, reg); ++ ++ WAIT_FOR_RFCSR(rt2x00dev, ®); ++ } ++ ++ *value = rt2x00_get_field32(reg, RF_CSR_CFG_DATA); ++ break; ++ } + + mutex_unlock(&rt2x00dev->csr_mutex); + } + ++static void rt2800_rfcsr_read_bank(struct rt2x00_dev *rt2x00dev, const u8 bank, ++ const unsigned int reg, u8 *value) ++{ ++ rt2800_rfcsr_read(rt2x00dev, (reg | (bank << 6)), value); ++} ++ + static void rt2800_rf_write(struct rt2x00_dev *rt2x00dev, + const unsigned int word, const u32 value) + { +@@ -526,6 +592,16 @@ void rt2800_get_txwi_rxwi_size(struct rt + *rxwi_size = RXWI_DESC_SIZE_5WORDS; + break; + ++ case RT5390: ++ if (rt2x00dev->chip.rf == RF7620) { ++ *txwi_size = TXWI_DESC_SIZE_5WORDS; ++ *rxwi_size = RXWI_DESC_SIZE_6WORDS; ++ } else { ++ *txwi_size = TXWI_DESC_SIZE_4WORDS; ++ *rxwi_size = RXWI_DESC_SIZE_4WORDS; ++ } ++ break; ++ + case RT5592: + *txwi_size = TXWI_DESC_SIZE_5WORDS; + *rxwi_size = RXWI_DESC_SIZE_6WORDS; +@@ -3258,6 +3334,296 @@ static void rt2800_config_channel_rf55xx + rt2800_bbp_write(rt2x00dev, 196, (rf->channel <= 14) ? 0x19 : 0x7F); + } + ++static void rt2800_config_channel_rf7620(struct rt2x00_dev *rt2x00dev, ++ struct ieee80211_conf *conf, ++ struct rf_channel *rf, ++ struct channel_info *info) ++{ ++ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; ++ u32 mac_sys_ctrl, mac_status; ++ u16 eeprom, target_power; ++ u32 tx_pin = 0x00150F0F; ++ u8 txrx_agc_fc; ++ u8 rfcsr; ++ u32 reg; ++ u8 bbp; ++ int i; ++ ++ /* Frequeny plan setting */ ++ /* Rdiv setting (stored in rf->rf1) ++ * R13[1:0] ++ */ ++ rt2800_rfcsr_read(rt2x00dev, 13, &rfcsr); ++ rfcsr = rfcsr & (~0x03); ++ if (rt2800_clk_is_20mhz(rt2x00dev)) ++ rfcsr |= (rf->rf1 & 0x03); ++ ++ rt2800_rfcsr_write(rt2x00dev, 13, rfcsr); ++ ++ /* N setting (stored in rf->rf2) ++ * R21[0], R20[7:0] ++ */ ++ rt2800_rfcsr_read(rt2x00dev, 20, &rfcsr); ++ rfcsr = (rf->rf2 & 0x00ff); ++ rt2800_rfcsr_write(rt2x00dev, 20, rfcsr); ++ ++ rt2800_rfcsr_read(rt2x00dev, 21, &rfcsr); ++ rfcsr = rfcsr & (~0x01); ++ rfcsr |= ((rf->rf2 & 0x0100) >> 8); ++ rt2800_rfcsr_write(rt2x00dev, 21, rfcsr); ++ ++ /* K setting (stored in rf->rf3[0:7]) ++ * R16[3:0] (RF PLL freq selection) ++ */ ++ rt2800_rfcsr_read(rt2x00dev, 16, &rfcsr); ++ rfcsr = rfcsr & (~0x0f); ++ rfcsr |= (rf->rf3 & 0x0f); ++ rt2800_rfcsr_write(rt2x00dev, 16, rfcsr); ++ ++ /* D setting (stored in rf->rf3[8:15]) ++ * R22[2:0] (D=15, R22[2:0]=<111>) ++ */ ++ rt2800_rfcsr_read(rt2x00dev, 22, &rfcsr); ++ rfcsr = rfcsr & (~0x07); ++ rfcsr |= ((rf->rf3 >> 8) & 0x07); ++ rt2800_rfcsr_write(rt2x00dev, 22, rfcsr); ++ ++ /* Ksd setting (stored in rf->rf4) ++ * Ksd: R19<1:0>,R18<7:0>,R17<7:0> ++ */ ++ rt2800_rfcsr_read(rt2x00dev, 17, &rfcsr); ++ rfcsr = (rf->rf4 & 0x000000ff); ++ rt2800_rfcsr_write(rt2x00dev, 17, rfcsr); ++ ++ rt2800_rfcsr_read(rt2x00dev, 18, &rfcsr); ++ rfcsr = ((rf->rf4 & 0x0000ff00) >> 8); ++ rt2800_rfcsr_write(rt2x00dev, 18, rfcsr); ++ ++ rt2800_rfcsr_read(rt2x00dev, 19, &rfcsr); ++ rfcsr = rfcsr & (~0x03); ++ rfcsr |= ((rf->rf4 & 0x00030000) >> 16); ++ rt2800_rfcsr_write(rt2x00dev, 19, rfcsr); ++ ++ /* Default: XO=20MHz , SDM mode */ ++ rt2800_rfcsr_read(rt2x00dev, 16, &rfcsr); ++ rfcsr = rfcsr & (~0xE0); ++ rfcsr |= 0x80; ++ rt2800_rfcsr_write(rt2x00dev, 16, rfcsr); ++ ++ rt2800_rfcsr_read(rt2x00dev, 21, &rfcsr); ++ rfcsr |= 0x80; ++ rt2800_rfcsr_write(rt2x00dev, 21, rfcsr); ++ ++ rt2800_rfcsr_read(rt2x00dev, 1, &rfcsr); ++ if (rt2x00dev->default_ant.tx_chain_num == 1) ++ rfcsr &= (~0x2); ++ else ++ rfcsr |= 0x2; ++ rt2800_rfcsr_write(rt2x00dev, 1, rfcsr); ++ ++ rt2800_rfcsr_read(rt2x00dev, 2, &rfcsr); ++ if (rt2x00dev->default_ant.tx_chain_num == 1) ++ rfcsr &= (~0x20); ++ else ++ rfcsr |= 0x20; ++ if (rt2x00dev->default_ant.rx_chain_num == 1) ++ rfcsr &= (~0x02); ++ else ++ rfcsr |= 0x02; ++ rt2800_rfcsr_write(rt2x00dev, 2, rfcsr); ++ ++ rt2800_rfcsr_read(rt2x00dev, 42, &rfcsr); ++ if (rt2x00dev->default_ant.tx_chain_num == 1) ++ rfcsr &= (~0x40); ++ else ++ rfcsr |= 0x40; ++ rt2800_rfcsr_write(rt2x00dev, 42, rfcsr); ++ ++ /* RF for DC Cal BW */ ++ if (conf_is_ht40(conf)) { ++ rt2800_rfcsr_write_dccal(rt2x00dev, 6, 0x10); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 7, 0x10); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 8, 0x04); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 58, 0x10); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 59, 0x10); ++ } else { ++ rt2800_rfcsr_write_dccal(rt2x00dev, 6, 0x20); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 7, 0x20); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 8, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 58, 0x20); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 59, 0x20); ++ } ++ ++ if (conf_is_ht40(conf)) { ++ rt2800_rfcsr_write_dccal(rt2x00dev, 58, 0x08); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 59, 0x08); ++ } else { ++ rt2800_rfcsr_write_dccal(rt2x00dev, 58, 0x28); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 59, 0x28); ++ } ++ ++ rt2800_rfcsr_read(rt2x00dev, 28, &rfcsr); ++ if (conf_is_ht40(conf) && (rf->channel == 11)) ++ rfcsr |= 0x4; ++ else ++ rfcsr &= (~0x4); ++ rt2800_rfcsr_write(rt2x00dev, 28, rfcsr); ++ ++ /*if (bScan == FALSE)*/ ++ if (conf_is_ht40(conf)) { ++ txrx_agc_fc = rt2x00_get_field8(drv_data->calibration_bw40, ++ RFCSR24_TX_AGC_FC); ++ } else { ++ txrx_agc_fc = rt2x00_get_field8(drv_data->calibration_bw20, ++ RFCSR24_TX_AGC_FC); ++ } ++ rt2800_rfcsr_read_bank(rt2x00dev, 5, 6, &rfcsr); ++ rfcsr &= (~0x3F); ++ rfcsr |= txrx_agc_fc; ++ rt2800_rfcsr_write_bank(rt2x00dev, 5, 6, rfcsr); ++ rt2800_rfcsr_read_bank(rt2x00dev, 5, 7, &rfcsr); ++ rfcsr &= (~0x3F); ++ rfcsr |= txrx_agc_fc; ++ rt2800_rfcsr_write_bank(rt2x00dev, 5, 7, rfcsr); ++ rt2800_rfcsr_read_bank(rt2x00dev, 7, 6, &rfcsr); ++ rfcsr &= (~0x3F); ++ rfcsr |= txrx_agc_fc; ++ rt2800_rfcsr_write_bank(rt2x00dev, 7, 6, rfcsr); ++ rt2800_rfcsr_read_bank(rt2x00dev, 7, 7, &rfcsr); ++ rfcsr &= (~0x3F); ++ rfcsr |= txrx_agc_fc; ++ rt2800_rfcsr_write_bank(rt2x00dev, 7, 7, rfcsr); ++ ++ rt2800_rfcsr_read_bank(rt2x00dev, 5, 58, &rfcsr); ++ rfcsr &= (~0x3F); ++ rfcsr |= txrx_agc_fc; ++ rt2800_rfcsr_write_bank(rt2x00dev, 5, 58, rfcsr); ++ rt2800_rfcsr_read_bank(rt2x00dev, 5, 59, &rfcsr); ++ rfcsr &= (~0x3F); ++ rfcsr |= txrx_agc_fc; ++ rt2800_rfcsr_write_bank(rt2x00dev, 5, 59, rfcsr); ++ rt2800_rfcsr_read_bank(rt2x00dev, 7, 58, &rfcsr); ++ rfcsr &= (~0x3F); ++ rfcsr |= txrx_agc_fc; ++ rt2800_rfcsr_write_bank(rt2x00dev, 7, 58, rfcsr); ++ rt2800_rfcsr_read_bank(rt2x00dev, 7, 59, &rfcsr); ++ rfcsr &= (~0x3F); ++ rfcsr |= txrx_agc_fc; ++ rt2800_rfcsr_write_bank(rt2x00dev, 7, 59, rfcsr); ++ ++ rt2800_register_read(rt2x00dev, TX_ALG_CFG_0, ®); ++ reg = reg & (~0x3F3F); ++ reg |= info->default_power1; ++ reg |= (info->default_power2 << 8); ++ reg |= (0x2F << 16); ++ reg |= (0x2F << 24); ++ ++ rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom); ++ if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_INTERNAL_TX_ALC)) { ++ /* init base power by e2p target power */ ++ rt2800_eeprom_read(rt2x00dev, 0xD0, &target_power); ++ target_power &= 0x3F; ++ reg = reg & (~0x3F3F); ++ reg |= target_power; ++ reg |= (target_power << 8); ++ } ++ rt2800_register_write(rt2x00dev, TX_ALG_CFG_0, reg); ++ ++ rt2800_register_read(rt2x00dev, TX_ALG_CFG_1, ®); ++ reg = reg & (~0x3F); ++ rt2800_register_write(rt2x00dev, TX_ALG_CFG_1, reg); ++ ++ /*if (bScan == FALSE)*/ ++ /* Save MAC SYS CTRL registers */ ++ rt2800_register_read(rt2x00dev, MAC_SYS_CTRL, &mac_sys_ctrl); ++ /* Disable Tx/Rx */ ++ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, 0); ++ /* Check MAC Tx/Rx idle */ ++ for (i = 0; i < 10000; i++) { ++ rt2800_register_read(rt2x00dev, MAC_STATUS_CFG, &mac_status); ++ if (mac_status & 0x3) ++ usleep_range(50, 200); ++ else ++ break; ++ } ++ ++ if (i == 10000) ++ rt2x00_warn(rt2x00dev, "Wait MAC Status to MAX !!!\n"); ++ ++ if (rf->channel > 10) { ++ rt2800_bbp_read(rt2x00dev, 30, &bbp); ++ bbp = 0x40; ++ rt2800_bbp_write(rt2x00dev, 30, bbp); ++ rt2800_rfcsr_write(rt2x00dev, 39, 0); ++ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) ++ rt2800_rfcsr_write(rt2x00dev, 42, 0xfb); ++ else ++ rt2800_rfcsr_write(rt2x00dev, 42, 0x7b); ++ } else { ++ rt2800_bbp_read(rt2x00dev, 30, &bbp); ++ bbp = 0x1f; ++ rt2800_bbp_write(rt2x00dev, 30, bbp); ++ rt2800_rfcsr_write(rt2x00dev, 39, 0x80); ++ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) ++ rt2800_rfcsr_write(rt2x00dev, 42, 0xdb); ++ else ++ rt2800_rfcsr_write(rt2x00dev, 42, 0x5b); ++ } ++ ++ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, mac_sys_ctrl); ++ ++ rt2800_rfcsr_write(rt2x00dev, 5, 0x40); ++ rt2800_rfcsr_write(rt2x00dev, 4, 0x0C); ++ ++ /* vcocal_en (initiate VCO calibration (reset after completion)) */ ++ rt2800_rfcsr_read(rt2x00dev, 4, &rfcsr); ++ rfcsr = ((rfcsr & ~0x80) | 0x80); ++ rt2800_rfcsr_write(rt2x00dev, 4, rfcsr); ++ usleep_range(2000, 3000); ++ ++ rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin); ++ ++ if (rt2x00dev->default_ant.tx_chain_num == 1) { ++ rt2800_bbp_write(rt2x00dev, 91, 0x07); ++ rt2800_bbp_write(rt2x00dev, 95, 0x1A); ++ rt2800_bbp_write(rt2x00dev, 195, 128); ++ rt2800_bbp_write(rt2x00dev, 196, 0xA0); ++ rt2800_bbp_write(rt2x00dev, 195, 170); ++ rt2800_bbp_write(rt2x00dev, 196, 0x12); ++ rt2800_bbp_write(rt2x00dev, 195, 171); ++ rt2800_bbp_write(rt2x00dev, 196, 0x10); ++ } else { ++ rt2800_bbp_write(rt2x00dev, 91, 0x06); ++ rt2800_bbp_write(rt2x00dev, 95, 0x9A); ++ rt2800_bbp_write(rt2x00dev, 195, 128); ++ rt2800_bbp_write(rt2x00dev, 196, 0xE0); ++ rt2800_bbp_write(rt2x00dev, 195, 170); ++ rt2800_bbp_write(rt2x00dev, 196, 0x30); ++ rt2800_bbp_write(rt2x00dev, 195, 171); ++ rt2800_bbp_write(rt2x00dev, 196, 0x30); ++ } ++ ++ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { ++ rt2800_bbp_write(rt2x00dev, 75, 0x60); ++ rt2800_bbp_write(rt2x00dev, 76, 0x44); ++ rt2800_bbp_write(rt2x00dev, 79, 0x1C); ++ rt2800_bbp_write(rt2x00dev, 80, 0x0C); ++ rt2800_bbp_write(rt2x00dev, 82, 0xB6); ++ ++ if (!conf_is_ht40(conf)) { ++ rt2800_bbp_write(rt2x00dev, 195, 141); ++ rt2800_bbp_write(rt2x00dev, 196, 0x1A); ++ } ++ } ++ ++ /* On 11A, We should delay and wait RF/BBP to be stable ++ * and the appropriate time should be 1000 micro seconds ++ * 2005/06/05 - On 11G, we also need this delay time. ++ * Otherwise it's difficult to pass the WHQL. ++ */ ++ usleep_range(1000, 1500); ++} ++ + static void rt2800_bbp_write_with_rx_chain(struct rt2x00_dev *rt2x00dev, + const unsigned int word, + const u8 value) +@@ -3414,7 +3780,7 @@ static void rt2800_config_channel(struct + struct channel_info *info) + { + u32 reg; +- unsigned int tx_pin; ++ u32 tx_pin; + u8 bbp, rfcsr; + + info->default_power1 = rt2800_txpower_to_dev(rt2x00dev, rf->channel, +@@ -3468,6 +3834,9 @@ static void rt2800_config_channel(struct + case RF5592: + rt2800_config_channel_rf55xx(rt2x00dev, conf, rf, info); + break; ++ case RF7620: ++ rt2800_config_channel_rf7620(rt2x00dev, conf, rf, info); ++ break; + default: + rt2800_config_channel_rf2xxx(rt2x00dev, conf, rf, info); + } +@@ -3574,7 +3943,7 @@ static void rt2800_config_channel(struct + else if (rt2x00_rt(rt2x00dev, RT3593) || + rt2x00_rt(rt2x00dev, RT3883)) + rt2800_bbp_write(rt2x00dev, 82, 0x82); +- else ++ else if (rt2x00dev->chip.rf != RF7620) + rt2800_bbp_write(rt2x00dev, 82, 0xf2); + + if (rt2x00_rt(rt2x00dev, RT3593) || +@@ -3596,7 +3965,7 @@ static void rt2800_config_channel(struct + if (rt2x00_rt(rt2x00dev, RT3572)) + rt2800_rfcsr_write(rt2x00dev, 8, 0); + +- tx_pin = 0; ++ rt2800_register_read(rt2x00dev, TX_PIN_CFG, &tx_pin); + + switch (rt2x00dev->default_ant.tx_chain_num) { + case 3: +@@ -3645,6 +4014,7 @@ static void rt2800_config_channel(struct + + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFTR_EN, 1); + rt2x00_set_field32(&tx_pin, TX_PIN_CFG_TRSW_EN, 1); ++ rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFRX_EN, 1); /* mt7620 */ + + rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin); + +@@ -3720,7 +4090,8 @@ static void rt2800_config_channel(struct + usleep_range(1000, 1500); + } + +- if (rt2x00_rt(rt2x00dev, RT5592)) { ++ if (rt2x00_rt(rt2x00dev, RT5592) || ++ (rt2x00_rt(rt2x00dev, RT5390) && rt2x00_rf(rt2x00dev, RF7620))) { + rt2800_bbp_write(rt2x00dev, 195, 141); + rt2800_bbp_write(rt2x00dev, 196, conf_is_ht40(conf) ? 0x10 : 0x1a); + +@@ -4662,6 +5033,15 @@ void rt2800_vco_calibration(struct rt2x0 + rt2x00_set_field8(&rfcsr, RFCSR3_VCOCAL_EN, 1); + rt2800_rfcsr_write(rt2x00dev, 3, rfcsr); + break; ++ case RF7620: ++ rt2800_rfcsr_read(rt2x00dev, 4, &rfcsr); ++ /* vcocal_en (initiate VCO calibration (reset after completion)) ++ * It should be at the end of RF configuration. ++ */ ++ rfcsr = ((rfcsr & ~0x80) | 0x80); ++ rt2800_rfcsr_write(rt2x00dev, 4, rfcsr); ++ usleep_range(2000, 3000); ++ break; + default: + WARN_ONCE(1, "Not supported RF chipet %x for VCO recalibration", + rt2x00dev->chip.rf); +@@ -5037,6 +5417,24 @@ static int rt2800_init_registers(struct + rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00040000); + rt2800_register_write(rt2x00dev, TX_TXBF_CFG_0, 0x8000fc21); + rt2800_register_write(rt2x00dev, TX_TXBF_CFG_3, 0x00009c40); ++ } else if (rt2x00_rf(rt2x00dev, RF7620)) { ++ rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000401); ++ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0000); ++ rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000); ++ rt2800_register_write(rt2x00dev, MIMO_PS_CFG, 0x00000002); ++ rt2800_register_write(rt2x00dev, TX_PIN_CFG, 0x00150F0F); ++ rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x06060606); ++ rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0); ++ rt2800_register_write(rt2x00dev, TX1_BB_GAIN_ATTEN, 0x0); ++ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_ATTEN, 0x6C6C666C); ++ rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN, 0x6C6C666C); ++ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_CORRECT, ++ 0x3630363A); ++ rt2800_register_write(rt2x00dev, TX1_RF_GAIN_CORRECT, ++ 0x3630363A); ++ rt2800_register_read(rt2x00dev, TX_ALG_CFG_1, ®); ++ reg = reg & (~0x80000000); ++ rt2800_register_write(rt2x00dev, TX_ALG_CFG_1, reg); + } else if (rt2x00_rt(rt2x00dev, RT5390) || + rt2x00_rt(rt2x00dev, RT5392)) { + rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404); +@@ -6075,6 +6473,225 @@ static void rt2800_init_bbp_5592(struct + rt2800_bbp_write(rt2x00dev, 103, 0xc0); + } + ++static void rt2800_bbp_glrt_write(struct rt2x00_dev *rt2x00dev, ++ const u8 reg, const u8 value) ++{ ++ rt2800_bbp_write(rt2x00dev, 195, reg); ++ rt2800_bbp_write(rt2x00dev, 196, value); ++} ++ ++static void rt2800_bbp_dcoc_write(struct rt2x00_dev *rt2x00dev, ++ const u8 reg, const u8 value) ++{ ++ rt2800_bbp_write(rt2x00dev, 158, reg); ++ rt2800_bbp_write(rt2x00dev, 159, value); ++} ++ ++static void rt2800_init_bbp_7620(struct rt2x00_dev *rt2x00dev) ++{ ++ u8 bbp; ++ ++ /* Apply Maximum Likelihood Detection (MLD) for 2 stream case */ ++ rt2800_bbp_read(rt2x00dev, 105, &bbp); ++ rt2x00_set_field8(&bbp, BBP105_MLD, ++ rt2x00dev->default_ant.rx_chain_num == 2); ++ rt2800_bbp_write(rt2x00dev, 105, bbp); ++ ++ /* Avoid data loss and CRC errors */ ++ /* MAC interface control (MAC_IF_80M, 1: 80 MHz) */ ++ rt2800_bbp4_mac_if_ctrl(rt2x00dev); ++ ++ /* Fix I/Q swap issue */ ++ rt2800_bbp_read(rt2x00dev, 1, &bbp); ++ bbp |= 0x04; ++ rt2800_bbp_write(rt2x00dev, 1, bbp); ++ ++ /* BBP for G band */ ++ rt2800_bbp_write(rt2x00dev, 3, 0x08); ++ rt2800_bbp_write(rt2x00dev, 4, 0x00); /* rt2800_bbp4_mac_if_ctrl? */ ++ rt2800_bbp_write(rt2x00dev, 6, 0x08); ++ rt2800_bbp_write(rt2x00dev, 14, 0x09); ++ rt2800_bbp_write(rt2x00dev, 15, 0xFF); ++ rt2800_bbp_write(rt2x00dev, 16, 0x01); ++ rt2800_bbp_write(rt2x00dev, 20, 0x06); ++ rt2800_bbp_write(rt2x00dev, 21, 0x00); ++ rt2800_bbp_write(rt2x00dev, 22, 0x00); ++ rt2800_bbp_write(rt2x00dev, 27, 0x00); ++ rt2800_bbp_write(rt2x00dev, 28, 0x00); ++ rt2800_bbp_write(rt2x00dev, 30, 0x00); ++ rt2800_bbp_write(rt2x00dev, 31, 0x48); ++ rt2800_bbp_write(rt2x00dev, 47, 0x40); ++ rt2800_bbp_write(rt2x00dev, 62, 0x00); ++ rt2800_bbp_write(rt2x00dev, 63, 0x00); ++ rt2800_bbp_write(rt2x00dev, 64, 0x00); ++ rt2800_bbp_write(rt2x00dev, 65, 0x2C); ++ rt2800_bbp_write(rt2x00dev, 66, 0x1C); ++ rt2800_bbp_write(rt2x00dev, 67, 0x20); ++ rt2800_bbp_write(rt2x00dev, 68, 0xDD); ++ rt2800_bbp_write(rt2x00dev, 69, 0x10); ++ rt2800_bbp_write(rt2x00dev, 70, 0x05); ++ rt2800_bbp_write(rt2x00dev, 73, 0x18); ++ rt2800_bbp_write(rt2x00dev, 74, 0x0F); ++ rt2800_bbp_write(rt2x00dev, 75, 0x60); ++ rt2800_bbp_write(rt2x00dev, 76, 0x44); ++ rt2800_bbp_write(rt2x00dev, 77, 0x59); ++ rt2800_bbp_write(rt2x00dev, 78, 0x1E); ++ rt2800_bbp_write(rt2x00dev, 79, 0x1C); ++ rt2800_bbp_write(rt2x00dev, 80, 0x0C); ++ rt2800_bbp_write(rt2x00dev, 81, 0x3A); ++ rt2800_bbp_write(rt2x00dev, 82, 0xB6); ++ rt2800_bbp_write(rt2x00dev, 83, 0x9A); ++ rt2800_bbp_write(rt2x00dev, 84, 0x9A); ++ rt2800_bbp_write(rt2x00dev, 86, 0x38); ++ rt2800_bbp_write(rt2x00dev, 88, 0x90); ++ rt2800_bbp_write(rt2x00dev, 91, 0x04); ++ rt2800_bbp_write(rt2x00dev, 92, 0x02); ++ rt2800_bbp_write(rt2x00dev, 95, 0x9A); ++ rt2800_bbp_write(rt2x00dev, 96, 0x00); ++ rt2800_bbp_write(rt2x00dev, 103, 0xC0); ++ rt2800_bbp_write(rt2x00dev, 104, 0x92); ++ /* FIXME BBP105 owerwrite */ ++ rt2800_bbp_write(rt2x00dev, 105, 0x3C); ++ rt2800_bbp_write(rt2x00dev, 106, 0x12); ++ rt2800_bbp_write(rt2x00dev, 109, 0x00); ++ rt2800_bbp_write(rt2x00dev, 134, 0x10); ++ rt2800_bbp_write(rt2x00dev, 135, 0xA6); ++ rt2800_bbp_write(rt2x00dev, 137, 0x04); ++ rt2800_bbp_write(rt2x00dev, 142, 0x30); ++ rt2800_bbp_write(rt2x00dev, 143, 0xF7); ++ rt2800_bbp_write(rt2x00dev, 160, 0xEC); ++ rt2800_bbp_write(rt2x00dev, 161, 0xC4); ++ rt2800_bbp_write(rt2x00dev, 162, 0x77); ++ rt2800_bbp_write(rt2x00dev, 163, 0xF9); ++ rt2800_bbp_write(rt2x00dev, 164, 0x00); ++ rt2800_bbp_write(rt2x00dev, 165, 0x00); ++ rt2800_bbp_write(rt2x00dev, 186, 0x00); ++ rt2800_bbp_write(rt2x00dev, 187, 0x00); ++ rt2800_bbp_write(rt2x00dev, 188, 0x00); ++ rt2800_bbp_write(rt2x00dev, 186, 0x00); ++ rt2800_bbp_write(rt2x00dev, 187, 0x01); ++ rt2800_bbp_write(rt2x00dev, 188, 0x00); ++ rt2800_bbp_write(rt2x00dev, 189, 0x00); ++ ++ rt2800_bbp_write(rt2x00dev, 91, 0x06); ++ rt2800_bbp_write(rt2x00dev, 92, 0x04); ++ rt2800_bbp_write(rt2x00dev, 93, 0x54); ++ rt2800_bbp_write(rt2x00dev, 99, 0x50); ++ rt2800_bbp_write(rt2x00dev, 148, 0x84); ++ rt2800_bbp_write(rt2x00dev, 167, 0x80); ++ rt2800_bbp_write(rt2x00dev, 178, 0xFF); ++ rt2800_bbp_write(rt2x00dev, 106, 0x13); ++ ++ /* BBP for G band GLRT function (BBP_128 ~ BBP_221) */ ++ rt2800_bbp_glrt_write(rt2x00dev, 0, 0x00); ++ rt2800_bbp_glrt_write(rt2x00dev, 1, 0x14); /* ? see above */ ++ rt2800_bbp_glrt_write(rt2x00dev, 2, 0x20); ++ rt2800_bbp_glrt_write(rt2x00dev, 3, 0x0A); ++ rt2800_bbp_glrt_write(rt2x00dev, 10, 0x16); ++ rt2800_bbp_glrt_write(rt2x00dev, 11, 0x06); ++ rt2800_bbp_glrt_write(rt2x00dev, 12, 0x02); ++ rt2800_bbp_glrt_write(rt2x00dev, 13, 0x07); ++ rt2800_bbp_glrt_write(rt2x00dev, 14, 0x05); ++ rt2800_bbp_glrt_write(rt2x00dev, 15, 0x09); ++ rt2800_bbp_glrt_write(rt2x00dev, 16, 0x20); ++ rt2800_bbp_glrt_write(rt2x00dev, 17, 0x08); ++ rt2800_bbp_glrt_write(rt2x00dev, 18, 0x4A); ++ rt2800_bbp_glrt_write(rt2x00dev, 19, 0x00); ++ rt2800_bbp_glrt_write(rt2x00dev, 20, 0x00); ++ rt2800_bbp_glrt_write(rt2x00dev, 128, 0xE0); ++ rt2800_bbp_glrt_write(rt2x00dev, 129, 0x1F); ++ rt2800_bbp_glrt_write(rt2x00dev, 130, 0x4F); ++ rt2800_bbp_glrt_write(rt2x00dev, 131, 0x32); ++ rt2800_bbp_glrt_write(rt2x00dev, 132, 0x08); ++ rt2800_bbp_glrt_write(rt2x00dev, 133, 0x28); ++ rt2800_bbp_glrt_write(rt2x00dev, 134, 0x19); ++ rt2800_bbp_glrt_write(rt2x00dev, 135, 0x0A); ++ rt2800_bbp_glrt_write(rt2x00dev, 138, 0x16); ++ rt2800_bbp_glrt_write(rt2x00dev, 139, 0x10); ++ rt2800_bbp_glrt_write(rt2x00dev, 140, 0x10); ++ rt2800_bbp_glrt_write(rt2x00dev, 141, 0x1A); ++ rt2800_bbp_glrt_write(rt2x00dev, 142, 0x36); ++ rt2800_bbp_glrt_write(rt2x00dev, 143, 0x2C); ++ rt2800_bbp_glrt_write(rt2x00dev, 144, 0x26); ++ rt2800_bbp_glrt_write(rt2x00dev, 145, 0x24); ++ rt2800_bbp_glrt_write(rt2x00dev, 146, 0x42); ++ rt2800_bbp_glrt_write(rt2x00dev, 147, 0x40); ++ rt2800_bbp_glrt_write(rt2x00dev, 148, 0x30); ++ rt2800_bbp_glrt_write(rt2x00dev, 149, 0x29); ++ rt2800_bbp_glrt_write(rt2x00dev, 150, 0x4C); ++ rt2800_bbp_glrt_write(rt2x00dev, 151, 0x46); ++ rt2800_bbp_glrt_write(rt2x00dev, 152, 0x3D); ++ rt2800_bbp_glrt_write(rt2x00dev, 153, 0x40); ++ rt2800_bbp_glrt_write(rt2x00dev, 154, 0x3E); ++ rt2800_bbp_glrt_write(rt2x00dev, 155, 0x38); ++ rt2800_bbp_glrt_write(rt2x00dev, 156, 0x3D); ++ rt2800_bbp_glrt_write(rt2x00dev, 157, 0x2F); ++ rt2800_bbp_glrt_write(rt2x00dev, 158, 0x3C); ++ rt2800_bbp_glrt_write(rt2x00dev, 159, 0x34); ++ rt2800_bbp_glrt_write(rt2x00dev, 160, 0x2C); ++ rt2800_bbp_glrt_write(rt2x00dev, 161, 0x2F); ++ rt2800_bbp_glrt_write(rt2x00dev, 162, 0x3C); ++ rt2800_bbp_glrt_write(rt2x00dev, 163, 0x35); ++ rt2800_bbp_glrt_write(rt2x00dev, 164, 0x2E); ++ rt2800_bbp_glrt_write(rt2x00dev, 165, 0x2F); ++ rt2800_bbp_glrt_write(rt2x00dev, 166, 0x49); ++ rt2800_bbp_glrt_write(rt2x00dev, 167, 0x41); ++ rt2800_bbp_glrt_write(rt2x00dev, 168, 0x36); ++ rt2800_bbp_glrt_write(rt2x00dev, 169, 0x39); ++ rt2800_bbp_glrt_write(rt2x00dev, 170, 0x30); ++ rt2800_bbp_glrt_write(rt2x00dev, 171, 0x30); ++ rt2800_bbp_glrt_write(rt2x00dev, 172, 0x0E); ++ rt2800_bbp_glrt_write(rt2x00dev, 173, 0x0D); ++ rt2800_bbp_glrt_write(rt2x00dev, 174, 0x28); ++ rt2800_bbp_glrt_write(rt2x00dev, 175, 0x21); ++ rt2800_bbp_glrt_write(rt2x00dev, 176, 0x1C); ++ rt2800_bbp_glrt_write(rt2x00dev, 177, 0x16); ++ rt2800_bbp_glrt_write(rt2x00dev, 178, 0x50); ++ rt2800_bbp_glrt_write(rt2x00dev, 179, 0x4A); ++ rt2800_bbp_glrt_write(rt2x00dev, 180, 0x43); ++ rt2800_bbp_glrt_write(rt2x00dev, 181, 0x50); ++ rt2800_bbp_glrt_write(rt2x00dev, 182, 0x10); ++ rt2800_bbp_glrt_write(rt2x00dev, 183, 0x10); ++ rt2800_bbp_glrt_write(rt2x00dev, 184, 0x10); ++ rt2800_bbp_glrt_write(rt2x00dev, 185, 0x10); ++ rt2800_bbp_glrt_write(rt2x00dev, 200, 0x7D); ++ rt2800_bbp_glrt_write(rt2x00dev, 201, 0x14); ++ rt2800_bbp_glrt_write(rt2x00dev, 202, 0x32); ++ rt2800_bbp_glrt_write(rt2x00dev, 203, 0x2C); ++ rt2800_bbp_glrt_write(rt2x00dev, 204, 0x36); ++ rt2800_bbp_glrt_write(rt2x00dev, 205, 0x4C); ++ rt2800_bbp_glrt_write(rt2x00dev, 206, 0x43); ++ rt2800_bbp_glrt_write(rt2x00dev, 207, 0x2C); ++ rt2800_bbp_glrt_write(rt2x00dev, 208, 0x2E); ++ rt2800_bbp_glrt_write(rt2x00dev, 209, 0x36); ++ rt2800_bbp_glrt_write(rt2x00dev, 210, 0x30); ++ rt2800_bbp_glrt_write(rt2x00dev, 211, 0x6E); ++ ++ /* BBP for G band DCOC function */ ++ rt2800_bbp_dcoc_write(rt2x00dev, 140, 0x0C); ++ rt2800_bbp_dcoc_write(rt2x00dev, 141, 0x00); ++ rt2800_bbp_dcoc_write(rt2x00dev, 142, 0x10); ++ rt2800_bbp_dcoc_write(rt2x00dev, 143, 0x10); ++ rt2800_bbp_dcoc_write(rt2x00dev, 144, 0x10); ++ rt2800_bbp_dcoc_write(rt2x00dev, 145, 0x10); ++ rt2800_bbp_dcoc_write(rt2x00dev, 146, 0x08); ++ rt2800_bbp_dcoc_write(rt2x00dev, 147, 0x40); ++ rt2800_bbp_dcoc_write(rt2x00dev, 148, 0x04); ++ rt2800_bbp_dcoc_write(rt2x00dev, 149, 0x04); ++ rt2800_bbp_dcoc_write(rt2x00dev, 150, 0x08); ++ rt2800_bbp_dcoc_write(rt2x00dev, 151, 0x08); ++ rt2800_bbp_dcoc_write(rt2x00dev, 152, 0x03); ++ rt2800_bbp_dcoc_write(rt2x00dev, 153, 0x03); ++ rt2800_bbp_dcoc_write(rt2x00dev, 154, 0x03); ++ rt2800_bbp_dcoc_write(rt2x00dev, 155, 0x02); ++ rt2800_bbp_dcoc_write(rt2x00dev, 156, 0x40); ++ rt2800_bbp_dcoc_write(rt2x00dev, 157, 0x40); ++ rt2800_bbp_dcoc_write(rt2x00dev, 158, 0x64); ++ rt2800_bbp_dcoc_write(rt2x00dev, 159, 0x64); ++ ++ rt2800_bbp4_mac_if_ctrl(rt2x00dev); ++} ++ + static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) + { + unsigned int i; +@@ -6117,7 +6734,10 @@ static void rt2800_init_bbp(struct rt2x0 + return; + case RT5390: + case RT5392: +- rt2800_init_bbp_53xx(rt2x00dev); ++ if (rt2x00dev->chip.rf == RF7620) ++ rt2800_init_bbp_7620(rt2x00dev); ++ else ++ rt2800_init_bbp_53xx(rt2x00dev); + break; + case RT5592: + rt2800_init_bbp_5592(rt2x00dev); +@@ -7331,6 +7951,277 @@ static void rt2800_init_rfcsr_5592(struc + rt2800_led_open_drain_enable(rt2x00dev); + } + ++static void rt2800_init_rfcsr_7620(struct rt2x00_dev *rt2x00dev) ++{ ++ u8 rfvalue; ++ u16 freq; ++ ++ /* Initialize RF central register to default value */ ++ rt2800_rfcsr_write(rt2x00dev, 0, 0x02); ++ rt2800_rfcsr_write(rt2x00dev, 1, 0x03); ++ rt2800_rfcsr_write(rt2x00dev, 2, 0x33); ++ rt2800_rfcsr_write(rt2x00dev, 3, 0xFF); ++ rt2800_rfcsr_write(rt2x00dev, 4, 0x0C); ++ rt2800_rfcsr_write(rt2x00dev, 5, 0x40); /* Read only */ ++ rt2800_rfcsr_write(rt2x00dev, 6, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 7, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 8, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 9, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 10, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 11, 0x00); ++ /* rt2800_rfcsr_write(rt2x00dev, 12, 0x43); *//* EEPROM */ ++ rt2800_rfcsr_write(rt2x00dev, 13, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 14, 0x40); ++ rt2800_rfcsr_write(rt2x00dev, 15, 0x22); ++ rt2800_rfcsr_write(rt2x00dev, 16, 0x4C); ++ rt2800_rfcsr_write(rt2x00dev, 17, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 18, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 19, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 20, 0xA0); ++ rt2800_rfcsr_write(rt2x00dev, 21, 0x12); ++ rt2800_rfcsr_write(rt2x00dev, 22, 0x07); ++ rt2800_rfcsr_write(rt2x00dev, 23, 0x13); ++ rt2800_rfcsr_write(rt2x00dev, 24, 0xFE); ++ rt2800_rfcsr_write(rt2x00dev, 25, 0x24); ++ rt2800_rfcsr_write(rt2x00dev, 26, 0x7A); ++ rt2800_rfcsr_write(rt2x00dev, 27, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 28, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 29, 0x05); ++ rt2800_rfcsr_write(rt2x00dev, 30, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 31, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 32, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 33, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 34, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 35, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 36, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 37, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 38, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 39, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 40, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 41, 0xD0); ++ rt2800_rfcsr_write(rt2x00dev, 42, 0x5B); ++ rt2800_rfcsr_write(rt2x00dev, 43, 0x00); ++ ++ rt2800_rfcsr_write(rt2x00dev, 11, 0x21); ++ if (rt2800_clk_is_20mhz(rt2x00dev)) ++ rt2800_rfcsr_write(rt2x00dev, 13, 0x03); ++ else ++ rt2800_rfcsr_write(rt2x00dev, 13, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 14, 0x7C); ++ rt2800_rfcsr_write(rt2x00dev, 16, 0x80); ++ rt2800_rfcsr_write(rt2x00dev, 17, 0x99); ++ rt2800_rfcsr_write(rt2x00dev, 18, 0x99); ++ rt2800_rfcsr_write(rt2x00dev, 19, 0x09); ++ rt2800_rfcsr_write(rt2x00dev, 20, 0x50); ++ rt2800_rfcsr_write(rt2x00dev, 21, 0xB0); ++ rt2800_rfcsr_write(rt2x00dev, 22, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 23, 0x06); ++ rt2800_rfcsr_write(rt2x00dev, 24, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 25, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 26, 0x5D); ++ rt2800_rfcsr_write(rt2x00dev, 27, 0x00); ++ rt2800_rfcsr_write(rt2x00dev, 28, 0x61); ++ rt2800_rfcsr_write(rt2x00dev, 29, 0xB5); ++ rt2800_rfcsr_write(rt2x00dev, 43, 0x02); ++ ++ rt2800_rfcsr_write(rt2x00dev, 28, 0x62); ++ rt2800_rfcsr_write(rt2x00dev, 29, 0xAD); ++ rt2800_rfcsr_write(rt2x00dev, 39, 0x80); ++ ++ /* use rt2800_adjust_freq_offset ? */ ++ rt2800_eeprom_read(rt2x00dev, EEPROM_FREQ, &freq); ++ rfvalue = freq & 0xff; ++ rt2800_rfcsr_write(rt2x00dev, 12, rfvalue); ++ ++ /* Initialize RF channel register to default value */ ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 0, 0x03); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 1, 0x00); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 2, 0x00); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 3, 0x00); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 4, 0x00); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 5, 0x08); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 6, 0x00); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 7, 0x51); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 8, 0x53); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 9, 0x16); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 10, 0x61); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 11, 0x53); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 12, 0x22); ++ /* rt2800_rfcsr_write_chanreg(rt2x00dev, 13, 0x3D); */ /* fails */ ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x06); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 15, 0x13); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 16, 0x22); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x27); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x02); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 19, 0xA7); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 20, 0x01); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 21, 0x52); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 22, 0x80); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 23, 0xB3); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 24, 0x00); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 25, 0x00); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 26, 0x00); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 27, 0x00); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 28, 0x5C); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 29, 0x6B); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 30, 0x6B); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 31, 0x31); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 32, 0x5D); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 33, 0x00); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 34, 0xE6); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 35, 0x55); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 36, 0x00); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 37, 0xBB); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 38, 0xB3); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 39, 0xB3); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 40, 0x03); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 41, 0x00); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 42, 0x00); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0xB3); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0xD3); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0xD5); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 46, 0x07); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x68); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xEF); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x1C); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x07); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0xA8); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0x85); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x10); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x07); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6A); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0x85); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x10); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 62, 0x1C); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 63, 0x00); ++ ++ rt2800_rfcsr_write_bank(rt2x00dev, 6, 45, 0xC5); ++ ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 9, 0x47); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 10, 0x71); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 11, 0x33); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x0E); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x23); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 19, 0xA4); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 20, 0x02); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 21, 0x12); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 28, 0x1C); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 29, 0xEB); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 32, 0x7D); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 34, 0xD6); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 36, 0x08); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 38, 0xB4); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0xD3); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0xB3); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0xD5); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 46, 0x27); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x69); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xFF); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x20); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x66); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xFF); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x1C); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x20); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6B); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xF7); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x09); ++ ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 10, 0x51); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x06); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 19, 0xA7); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 28, 0x2C); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x64); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 8, 0x51); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 9, 0x36); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 11, 0x53); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x16); ++ ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x6C); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xFC); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x1F); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x66); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6B); ++ ++ /* Initialize RF channel register for DRQFN */ ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0xD3); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0xE3); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0xE5); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x28); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x68); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xF7); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x02); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xC7); ++ ++ /* Initialize RF DC calibration register to default value */ ++ rt2800_rfcsr_write_dccal(rt2x00dev, 0, 0x47); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 1, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 2, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 3, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 4, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 6, 0x10); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 7, 0x10); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 8, 0x04); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 9, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 10, 0x07); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 11, 0x01); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 12, 0x07); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 13, 0x07); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 14, 0x07); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 15, 0x20); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 16, 0x22); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 18, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 19, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 20, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 21, 0xF1); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 22, 0x11); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 23, 0x02); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 24, 0x41); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 25, 0x20); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 26, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 27, 0xD7); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 28, 0xA2); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 29, 0x20); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 30, 0x49); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 31, 0x20); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 32, 0x04); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 33, 0xF1); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 34, 0xA1); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 35, 0x01); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 41, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 42, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 43, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 44, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 45, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 46, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 47, 0x3E); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 48, 0x3D); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 49, 0x3E); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 50, 0x3D); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 51, 0x3E); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 52, 0x3D); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 53, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 54, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 55, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 56, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 57, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 58, 0x10); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 59, 0x10); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 60, 0x0A); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 61, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 62, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 63, 0x00); ++ ++ rt2800_rfcsr_write_dccal(rt2x00dev, 3, 0x08); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 4, 0x04); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x20); ++ ++ rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C); ++} ++ + static void rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) + { + if (rt2800_is_305x_soc(rt2x00dev)) { +@@ -7366,7 +8257,10 @@ static void rt2800_init_rfcsr(struct rt2 + rt2800_init_rfcsr_5350(rt2x00dev); + break; + case RT5390: +- rt2800_init_rfcsr_5390(rt2x00dev); ++ if (rt2x00dev->chip.rf == RF7620) ++ rt2800_init_rfcsr_7620(rt2x00dev); ++ else ++ rt2800_init_rfcsr_5390(rt2x00dev); + break; + case RT5392: + rt2800_init_rfcsr_5392(rt2x00dev); +@@ -7780,6 +8674,7 @@ static int rt2800_init_eeprom(struct rt2 + case RF5390: + case RF5392: + case RF5592: ++ case RF7620: + break; + default: + rt2x00_err(rt2x00dev, "Invalid RF chipset 0x%04x detected\n", +@@ -8258,6 +9153,24 @@ static const struct rf_channel rf_vals_5 + {196, 83, 0, 12, 1}, + }; + ++static const struct rf_channel rf_vals_7620[] = { ++ /* Channel, Rdiv, N, K | (D >> 8), Ksd */ ++ {1, 3, 0x50, 0 | (0 >> 8), 0x19999}, ++ {2, 3, 0x50, 0 | (0 >> 8), 0x24444}, ++ {3, 3, 0x50, 0 | (0 >> 8), 0x2EEEE}, ++ {4, 3, 0x50, 0 | (0 >> 8), 0x39999}, ++ {5, 3, 0x51, 0 | (0 >> 8), 0x04444}, ++ {6, 3, 0x51, 0 | (0 >> 8), 0x0EEEE}, ++ {7, 3, 0x51, 0 | (0 >> 8), 0x19999}, ++ {8, 3, 0x51, 0 | (0 >> 8), 0x24444}, ++ {9, 3, 0x51, 0 | (0 >> 8), 0x2EEEE}, ++ {10, 3, 0x51, 0 | (0 >> 8), 0x39999}, ++ {11, 3, 0x52, 0 | (0 >> 8), 0x04444}, ++ {12, 3, 0x52, 0 | (0 >> 8), 0x0EEEE}, ++ {13, 3, 0x52, 0 | (0 >> 8), 0x19999}, ++ {14, 3, 0x52, 0 | (0 >> 8), 0x33333}, ++}; ++ + static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) + { + struct hw_mode_spec *spec = &rt2x00dev->spec; +@@ -8361,6 +9274,11 @@ static int rt2800_probe_hw_mode(struct r + spec->channels = rf_vals_3x; + break; + ++ case RF7620: ++ spec->num_channels = ARRAY_SIZE(rf_vals_7620); ++ spec->channels = rf_vals_7620; ++ break; ++ + case RF3052: + case RF3053: + spec->num_channels = ARRAY_SIZE(rf_vals_3x); +@@ -8498,6 +9416,7 @@ static int rt2800_probe_hw_mode(struct r + case RF5390: + case RF5392: + case RF5592: ++ case RF7620: + __set_bit(CAPABILITY_VCO_RECALIBRATION, &rt2x00dev->cap_flags); + break; + } diff --git a/package/kernel/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch b/package/kernel/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch deleted file mode 100644 index a901a44ba4..0000000000 --- a/package/kernel/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/drivers/net/wireless/marvell/mwl8k.c -+++ b/drivers/net/wireless/marvell/mwl8k.c -@@ -5681,6 +5681,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw") - MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API)); - - static const struct pci_device_id mwl8k_pci_id_table[] = { -+ { PCI_VDEVICE(MARVELL, 0x2a02), .driver_data = MWL8363, }, - { PCI_VDEVICE(MARVELL, 0x2a0a), .driver_data = MWL8363, }, - { PCI_VDEVICE(MARVELL, 0x2a0c), .driver_data = MWL8363, }, - { PCI_VDEVICE(MARVELL, 0x2a24), .driver_data = MWL8363, }, diff --git a/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch b/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch new file mode 100644 index 0000000000..106ef706b8 --- /dev/null +++ b/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch @@ -0,0 +1,21 @@ +--- a/drivers/net/wireless/marvell/libertas/cfg.c ++++ b/drivers/net/wireless/marvell/libertas/cfg.c +@@ -2127,6 +2127,8 @@ struct wireless_dev *lbs_cfg_alloc(struc + goto err_wiphy_new; + } + ++ set_wiphy_dev(wdev->wiphy, dev); ++ + lbs_deb_leave(LBS_DEB_CFG80211); + return wdev; + +--- a/drivers/net/wireless/marvell/libertas/main.c ++++ b/drivers/net/wireless/marvell/libertas/main.c +@@ -986,6 +986,7 @@ struct lbs_private *lbs_add_card(void *c + goto err_adapter; + } + ++ dev_net_set(dev, wiphy_net(wdev->wiphy)); + dev->ieee80211_ptr = wdev; + dev->ml_priv = priv; + SET_NETDEV_DEV(dev, dmdev); diff --git a/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch b/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch new file mode 100644 index 0000000000..04b4954d29 --- /dev/null +++ b/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch @@ -0,0 +1,11 @@ +--- a/drivers/net/wireless/marvell/libertas/cfg.c ++++ b/drivers/net/wireless/marvell/libertas/cfg.c +@@ -2217,6 +2217,8 @@ int lbs_cfg_register(struct lbs_private + wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); + wdev->wiphy->reg_notifier = lbs_reg_notifier; + ++ memcpy(wdev->wiphy->perm_addr, priv->current_addr, ETH_ALEN); ++ + ret = wiphy_register(wdev->wiphy); + if (ret < 0) + pr_err("cannot register wiphy device\n"); diff --git a/package/kernel/mac80211/patches/850-brcmsmac-remove-extra-regulation-restriction.patch b/package/kernel/mac80211/patches/850-brcmsmac-remove-extra-regulation-restriction.patch new file mode 100644 index 0000000000..3c93386b30 --- /dev/null +++ b/package/kernel/mac80211/patches/850-brcmsmac-remove-extra-regulation-restriction.patch @@ -0,0 +1,27 @@ +--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/channel.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/channel.c +@@ -58,19 +58,12 @@ + (((c) < 149) ? 3 : 4)))) + + #define BRCM_2GHZ_2412_2462 REG_RULE(2412-10, 2462+10, 40, 0, 19, 0) +-#define BRCM_2GHZ_2467_2472 REG_RULE(2467-10, 2472+10, 20, 0, 19, \ +- NL80211_RRF_NO_IR) ++#define BRCM_2GHZ_2467_2472 REG_RULE(2467-10, 2472+10, 20, 0, 19, 0) + +-#define BRCM_5GHZ_5180_5240 REG_RULE(5180-10, 5240+10, 40, 0, 21, \ +- NL80211_RRF_NO_IR) +-#define BRCM_5GHZ_5260_5320 REG_RULE(5260-10, 5320+10, 40, 0, 21, \ +- NL80211_RRF_DFS | \ +- NL80211_RRF_NO_IR) +-#define BRCM_5GHZ_5500_5700 REG_RULE(5500-10, 5700+10, 40, 0, 21, \ +- NL80211_RRF_DFS | \ +- NL80211_RRF_NO_IR) +-#define BRCM_5GHZ_5745_5825 REG_RULE(5745-10, 5825+10, 40, 0, 21, \ +- NL80211_RRF_NO_IR) ++#define BRCM_5GHZ_5180_5240 REG_RULE(5180-10, 5240+10, 40, 0, 21, 0) ++#define BRCM_5GHZ_5260_5320 REG_RULE(5260-10, 5320+10, 40, 0, 21, 0) ++#define BRCM_5GHZ_5500_5700 REG_RULE(5500-10, 5700+10, 40, 0, 21, 0) ++#define BRCM_5GHZ_5745_5825 REG_RULE(5745-10, 5825+10, 40, 0, 21, 0) + + static const struct ieee80211_regdomain brcms_regdom_x2 = { + .n_reg_rules = 6, diff --git a/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch b/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch new file mode 100644 index 0000000000..d09057f896 --- /dev/null +++ b/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch @@ -0,0 +1,97 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 8 Jun 2015 16:11:40 +0200 +Subject: [PATCH] brcmfmac: register wiphy(s) during module_init +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This is needed by OpenWrt which expects all PHYs to be created after +module loads successfully. + +Signed-off-by: Rafał Miłecki +--- + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +@@ -1196,6 +1196,7 @@ int __init brcmf_core_init(void) + { + if (!schedule_work(&brcmf_driver_work)) + return -EBUSY; ++ flush_work(&brcmf_driver_work); + + return 0; + } +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +@@ -444,6 +444,7 @@ struct brcmf_fw { + u16 bus_nr; + void (*done)(struct device *dev, const struct firmware *fw, + void *nvram_image, u32 nvram_len); ++ struct completion *completion; + }; + + static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx) +@@ -478,6 +479,8 @@ static void brcmf_fw_request_nvram_done( + goto fail; + + fwctx->done(fwctx->dev, fwctx->code, nvram, nvram_length); ++ if (fwctx->completion) ++ complete(fwctx->completion); + kfree(fwctx); + return; + +@@ -485,6 +488,8 @@ fail: + brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev)); + release_firmware(fwctx->code); + device_release_driver(fwctx->dev); ++ if (fwctx->completion) ++ complete(fwctx->completion); + kfree(fwctx); + } + +@@ -500,6 +505,8 @@ static void brcmf_fw_request_code_done(c + /* only requested code so done here */ + if (!(fwctx->flags & BRCMF_FW_REQUEST_NVRAM)) { + fwctx->done(fwctx->dev, fw, NULL, 0); ++ if (fwctx->completion) ++ complete(fwctx->completion); + kfree(fwctx); + return; + } +@@ -517,6 +524,8 @@ static void brcmf_fw_request_code_done(c + fail: + brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev)); + device_release_driver(fwctx->dev); ++ if (fwctx->completion) ++ complete(fwctx->completion); + kfree(fwctx); + } + +@@ -528,6 +537,8 @@ int brcmf_fw_get_firmwares_pcie(struct d + u16 domain_nr, u16 bus_nr) + { + struct brcmf_fw *fwctx; ++ struct completion completion; ++ int err; + + brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(dev)); + if (!fw_cb || !code) +@@ -548,9 +559,17 @@ int brcmf_fw_get_firmwares_pcie(struct d + fwctx->domain_nr = domain_nr; + fwctx->bus_nr = bus_nr; + +- return request_firmware_nowait(THIS_MODULE, true, code, dev, ++ init_completion(&completion); ++ fwctx->completion = &completion; ++ ++ err = request_firmware_nowait(THIS_MODULE, true, code, dev, + GFP_KERNEL, fwctx, + brcmf_fw_request_code_done); ++ if (!err) ++ wait_for_completion_timeout(fwctx->completion, ++ msecs_to_jiffies(5000)); ++ fwctx->completion = NULL; ++ return err; + } + + int brcmf_fw_get_firmwares(struct device *dev, u16 flags, diff --git a/package/kernel/mac80211/patches/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch b/package/kernel/mac80211/patches/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch new file mode 100644 index 0000000000..774b333402 --- /dev/null +++ b/package/kernel/mac80211/patches/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch @@ -0,0 +1,50 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 9 Jul 2015 00:07:59 +0200 +Subject: [PATCH] brcmfmac: workaround bug with some inconsistent BSSes state +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Rafał Miłecki +--- + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -656,9 +656,37 @@ static struct wireless_dev *brcmf_cfg802 + u32 *flags, + struct vif_params *params) + { ++ struct net_device *dev; + struct wireless_dev *wdev; + int err; + ++ /* ++ * There is a bug with in-firmware BSS management. When adding virtual ++ * interface brcmfmac first tells firmware to create new BSS and then ++ * it creates new struct net_device. ++ * ++ * If creating/registering netdev(ice) fails, BSS remains in some bugged ++ * state. It conflicts with existing BSSes by overtaking their auth ++ * requests. ++ * ++ * It results in one BSS (addresss X) sending beacons and another BSS ++ * (address Y) replying to authentication requests. This makes interface ++ * unusable as AP. ++ * ++ * To workaround this bug we may try to guess if register_netdev(ice) ++ * will fail. The most obvious case is using interface name that already ++ * exists. This is actually quite likely with brcmfmac & some user space ++ * scripts as brcmfmac doesn't allow deleting virtual interfaces. ++ * So this bug can be triggered even by something trivial like: ++ * iw dev wlan0 delete ++ * iw phy phy0 interface add wlan0 type __ap ++ */ ++ dev = dev_get_by_name(&init_net, name); ++ if (dev) { ++ dev_put(dev); ++ return ERR_PTR(-ENFILE); ++ } ++ + brcmf_dbg(TRACE, "enter: %s type %d\n", name, type); + err = brcmf_vif_add_validate(wiphy_to_cfg(wiphy), type); + if (err) { diff --git a/package/kernel/mac80211/patches/862-brcmfmac-Disable-power-management.patch b/package/kernel/mac80211/patches/862-brcmfmac-Disable-power-management.patch new file mode 100644 index 0000000000..1819cf3999 --- /dev/null +++ b/package/kernel/mac80211/patches/862-brcmfmac-Disable-power-management.patch @@ -0,0 +1,27 @@ +From 66ae1b1750720a33e29792a177b1e696f4f005fb Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 9 Mar 2016 17:25:59 +0000 +Subject: [PATCH] brcmfmac: Disable power management + +Disable wireless power saving in the brcmfmac WLAN driver. This is a +temporary measure until the connectivity loss resulting from power +saving is resolved. + +Signed-off-by: Phil Elwell +--- + drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -2775,6 +2775,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip + * preference in cfg struct to apply this to + * FW later while initializing the dongle + */ ++#if defined(CONFIG_ARCH_BCM2835) ++ brcmf_dbg(INFO, "power management disabled\n"); ++ enabled = false; ++#endif + cfg->pwr_save = enabled; + if (!check_vif_up(ifp->vif)) { + diff --git a/package/kernel/mac80211/patches/863-brcmfmac-add-in-driver-tables-with-country-codes.patch b/package/kernel/mac80211/patches/863-brcmfmac-add-in-driver-tables-with-country-codes.patch new file mode 100644 index 0000000000..e7551c3a70 --- /dev/null +++ b/package/kernel/mac80211/patches/863-brcmfmac-add-in-driver-tables-with-country-codes.patch @@ -0,0 +1,60 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Subject: [PATCH] brcmfmac: add in-driver tables with country codes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This adds early support for changing region. Ideally this data should +be stored in DT as all these mappings are devices specific. + +Signed-off-by: Rafał Miłecki +--- + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +@@ -23,6 +23,36 @@ + #include "common.h" + #include "of.h" + ++/* TODO: FIXME: Use DT */ ++static void brcmf_of_probe_cc(struct device *dev, ++ struct brcmf_mp_device *settings) ++{ ++ static struct brcmfmac_pd_cc_entry netgear_r8000_cc_ent[] = { ++ { "JP", "JP", 78 }, ++ { "US", "Q2", 86 }, ++ }; ++ struct brcmfmac_pd_cc_entry *cc_ent = NULL; ++ int table_size = 0; ++ ++ if (of_machine_is_compatible("netgear,r8000")) { ++ cc_ent = netgear_r8000_cc_ent; ++ table_size = ARRAY_SIZE(netgear_r8000_cc_ent); ++ } ++ ++ if (cc_ent && table_size) { ++ struct brcmfmac_pd_cc *cc; ++ size_t memsize; ++ ++ memsize = table_size * sizeof(struct brcmfmac_pd_cc_entry); ++ cc = devm_kzalloc(dev, sizeof(*cc) + memsize, GFP_KERNEL); ++ if (!cc) ++ return; ++ cc->table_size = table_size; ++ memcpy(cc->table, cc_ent, memsize); ++ settings->country_codes = cc; ++ } ++} ++ + void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, + struct brcmf_mp_device *settings) + { +@@ -32,6 +62,8 @@ void brcmf_of_probe(struct device *dev, + u32 irqf; + u32 val; + ++ brcmf_of_probe_cc(dev, settings); ++ + if (!np || bus_type != BRCMF_BUSTYPE_SDIO || + !of_device_is_compatible(np, "brcm,bcm4329-fmac")) + return; diff --git a/package/kernel/mac80211/patches/864-brcmfmac-do-not-use-internal-roaming-engine-by-default.patch b/package/kernel/mac80211/patches/864-brcmfmac-do-not-use-internal-roaming-engine-by-default.patch new file mode 100644 index 0000000000..891c539fbf --- /dev/null +++ b/package/kernel/mac80211/patches/864-brcmfmac-do-not-use-internal-roaming-engine-by-default.patch @@ -0,0 +1,23 @@ +brcmfmac: do not use internal roaming engine by default + +Some evidence of curing disconnects with this disabled, so make it a default. +Can be overridden with module parameter roamoff=0 +See: http://projectable.me/optimize-my-pi-wi-fi/ + +Signed-off-by: Phil Elwell +--- + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +@@ -69,7 +69,11 @@ static int brcmf_fcmode; + module_param_named(fcmode, brcmf_fcmode, int, 0); + MODULE_PARM_DESC(fcmode, "Mode of firmware signalled flow control"); + ++#if defined(CONFIG_ARCH_BCM2835) ++static int brcmf_roamoff = 1; ++#else + static int brcmf_roamoff; ++#endif + module_param_named(roamoff, brcmf_roamoff, int, S_IRUSR); + MODULE_PARM_DESC(roamoff, "Do not use internal roaming engine"); + diff --git a/package/kernel/om-watchdog/files/om-watchdog.init b/package/kernel/om-watchdog/files/om-watchdog.init index 4ed178db7e..4ba6beafb6 100644 --- a/package/kernel/om-watchdog/files/om-watchdog.init +++ b/package/kernel/om-watchdog/files/om-watchdog.init @@ -17,9 +17,11 @@ get_gpio() { case "$board" in "om2p" | \ + "om2pv4" | \ "om2p-hs" | \ "om2p-hsv2" | \ "om2p-hsv3" | \ + "om2p-hsv4" | \ "om5p-acv2") return 12 ;; @@ -40,7 +42,9 @@ get_gpio() { "mr900" | \ "mr900v2" | \ "mr1750" | \ - "mr1750v2") + "mr1750v2" | \ + "a40" | \ + "a60") return 16 ;; esac diff --git a/package/libs/libpcap/Config.in b/package/libs/libpcap/Config.in index 5fee75a595..11599273e7 100644 --- a/package/libs/libpcap/Config.in +++ b/package/libs/libpcap/Config.in @@ -3,13 +3,15 @@ menu "Configuration" config PCAP_HAS_USB bool "Include USB support" - depends on PACKAGE_kmod-usb-core default n config PCAP_HAS_BT bool "Include bluetooth support" - depends on PACKAGE_kmod-bluetooth depends on BROKEN default n +config PCAP_HAS_NETFILTER + bool "Include netfilter support" + default n + endmenu diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile index d3360d2dee..4d0ce40993 100644 --- a/package/libs/libpcap/Makefile +++ b/package/libs/libpcap/Makefile @@ -48,9 +48,12 @@ TARGET_CFLAGS += \ CONFIGURE_VARS += \ ac_cv_linux_vers=$(LINUX_VERSION) \ - ac_cv_header_libusb_1_0_libusb_h=no \ - ac_cv_netfilter_can_compile=no + ac_cv_header_libusb_1_0_libusb_h=no +ifeq ($(CONFIG_PCAP_HAS_NETFILTER),) +CONFIGURE_VARS += \ + ac_cv_netfilter_can_compile=no +endif CONFIGURE_ARGS += \ --enable-shared \ diff --git a/package/libs/libtool/Makefile b/package/libs/libtool/Makefile index 2d5cedf786..5eb521a72b 100644 --- a/package/libs/libtool/Makefile +++ b/package/libs/libtool/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libtool PKG_VERSION:=2.4 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/libtool @@ -34,14 +34,14 @@ endef define Build/InstallDev $(MAKE) -C $(PKG_BUILD_DIR) \ - bindir="$(2)/bin" \ - datadir="$(2)/share" \ - prefix="$(2)" \ - exec_prefix="$(2)" \ + bindir="$(2)/libltdl/bin" \ + datadir="$(2)/libltdl/share" \ + prefix="$(2)/libltdl" \ + exec_prefix="$(2)/libltdl" \ install $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include - mv $(2)/lib/* $(1)/usr/lib/ - mv $(2)/include/* $(1)/usr/include/ + mv $(2)/libltdl/lib/* $(1)/usr/lib/ + mv $(2)/libltdl/include/* $(1)/usr/include/ endef define Package/libltdl/install diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile index 38dce1a714..71c53ae8fe 100644 --- a/package/libs/libubox/Makefile +++ b/package/libs/libubox/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/libubox.git -PKG_SOURCE_DATE:=2016-11-29 -PKG_SOURCE_VERSION:=77a629375d7387a33a59509d9d751a8798134cab -PKG_MIRROR_HASH:=b11c24d45cdf5a1909f0f97d185c3e1ba49602561a8cf3ad18f594ca0eaf4a64 +PKG_SOURCE_DATE:=2017-02-24 +PKG_SOURCE_VERSION:=96305a3cafcc9c0df7f189567671bb26ce3eb129 +PKG_MIRROR_HASH:=19dc9f73621a65d1374427160f59e338db45ee6edc30edff6a6fee10dcdfc8b6 CMAKE_INSTALL:=1 PKG_LICENSE:=ISC diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 990aabe066..65a6750c4b 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mbedtls -PKG_VERSION:=2.4.0 -PKG_RELEASE:=2 +PKG_VERSION:=2.4.2 +PKG_RELEASE:=1 PKG_USE_MIPS16:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-gpl.tgz PKG_SOURCE_URL:=https://tls.mbed.org/download/ -PKG_HASH:=80eff0e0028f969355d6e34ffdd3dbf4eb2a9367b07ff2f3f70e6d75beee9e3f +PKG_HASH:=d01f2d5586a52055329d194d909103f445bd2d0b6b2b5f1c830fbf828ac6299f PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ @@ -48,6 +48,8 @@ endef PKG_INSTALL:=1 +TARGET_CFLAGS += -ffunction-sections -fdata-sections + CMAKE_OPTIONS += \ -DCMAKE_BUILD_TYPE:String="Release" \ -DUSE_SHARED_MBEDTLS_LIBRARY:Bool=ON \ @@ -59,6 +61,7 @@ define Build/InstallDev $(CP) $(PKG_INSTALL_DIR)/usr/include/mbedtls $(1)/usr/include/ $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.a $(1)/usr/lib/ endef define Package/libmbedtls/install diff --git a/package/libs/mbedtls/patches/200-config.patch b/package/libs/mbedtls/patches/200-config.patch index 96d7c156a7..510872380f 100644 --- a/package/libs/mbedtls/patches/200-config.patch +++ b/package/libs/mbedtls/patches/200-config.patch @@ -222,7 +222,7 @@ /** * \def MBEDTLS_MD_C @@ -2158,7 +2158,7 @@ - * Caller: library/mbedtls_md.c + * Caller: library/md.c * */ -#define MBEDTLS_RIPEMD160_C diff --git a/package/libs/ncurses/Makefile b/package/libs/ncurses/Makefile index 88a31e299b..60a8a176df 100644 --- a/package/libs/ncurses/Makefile +++ b/package/libs/ncurses/Makefile @@ -135,7 +135,7 @@ define Build/InstallDev $(CP) $(PKG_INSTALL_DIR)/usr/bin/ncursesw6-config $(2)/bin/ $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' -e 's/$$$$INCS //g' \ $(2)/bin/ncursesw6-config - ln -sf $(STAGING_DIR_HOSTPKG)/bin/ncursesw6-config $(1)/usr/bin/ncursesw6-config + ln -sf $(STAGING_DIR)/host/bin/ncursesw6-config $(1)/usr/bin/ncursesw6-config endef define Host/Compile diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 0d69d705c9..9b6430234e 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl PKG_BASE:=1.0.2 -PKG_BUGFIX:=j +PKG_BUGFIX:=k PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) PKG_RELEASE:=1 PKG_USE_MIPS16:=0 @@ -23,7 +23,7 @@ PKG_SOURCE_URL:=http://www.openssl.org/source/ \ http://www.openssl.org/source/old/$(PKG_BASE)/ \ ftp://ftp.funet.fi/pub/crypt/mirrors/ftp.openssl.org/source \ ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/ -PKG_HASH:=e7aff292be21c259c6af26469c7a9b3ba26e9abaaffd325e3dccc9785256c431 +PKG_HASH:=6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0 PKG_LICENSE:=OpenSSL PKG_LICENSE_FILES:=LICENSE diff --git a/package/libs/openssl/patches/110-optimize-for-size.patch b/package/libs/openssl/patches/110-optimize-for-size.patch index 172184228e..0f174a3469 100644 --- a/package/libs/openssl/patches/110-optimize-for-size.patch +++ b/package/libs/openssl/patches/110-optimize-for-size.patch @@ -1,6 +1,6 @@ --- a/Configure +++ b/Configure -@@ -468,6 +468,12 @@ my %table=( +@@ -470,6 +470,12 @@ my %table=( "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", diff --git a/package/libs/openssl/patches/150-no_engines.patch b/package/libs/openssl/patches/150-no_engines.patch index 274ecbe0a5..586d1f2935 100644 --- a/package/libs/openssl/patches/150-no_engines.patch +++ b/package/libs/openssl/patches/150-no_engines.patch @@ -1,6 +1,6 @@ --- a/Configure +++ b/Configure -@@ -2114,6 +2114,11 @@ EOF +@@ -2128,6 +2128,11 @@ EOF close(OUT); } diff --git a/package/libs/openssl/patches/160-disable_doc_tests.patch b/package/libs/openssl/patches/160-disable_doc_tests.patch index 0fd1fa19dd..73459ff905 100644 --- a/package/libs/openssl/patches/160-disable_doc_tests.patch +++ b/package/libs/openssl/patches/160-disable_doc_tests.patch @@ -27,7 +27,7 @@ WDIRS= windows LIBS= libcrypto.a libssl.a SHARED_CRYPTO=libcrypto$(SHLIB_EXT) -@@ -275,7 +275,7 @@ reflect: +@@ -276,7 +276,7 @@ reflect: sub_all: build_all @@ -36,7 +36,7 @@ build_libs: build_libcrypto build_libssl openssl.pc -@@ -533,7 +533,7 @@ dist: +@@ -534,7 +534,7 @@ dist: @$(MAKE) SDIRS='$(SDIRS)' clean @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar @@ -47,7 +47,7 @@ @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ --- a/Makefile.org +++ b/Makefile.org -@@ -531,7 +531,7 @@ dist: +@@ -532,7 +532,7 @@ dist: @$(MAKE) SDIRS='$(SDIRS)' clean @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar diff --git a/package/libs/openssl/patches/190-remove_timestamp_check.patch b/package/libs/openssl/patches/190-remove_timestamp_check.patch index 4620bf90a6..424e66063c 100644 --- a/package/libs/openssl/patches/190-remove_timestamp_check.patch +++ b/package/libs/openssl/patches/190-remove_timestamp_check.patch @@ -9,7 +9,7 @@ # as we stick to -e, CLEARENV ensures that local variables in lower # Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn -@@ -403,11 +403,6 @@ openssl.pc: Makefile +@@ -404,11 +404,6 @@ openssl.pc: Makefile echo 'Version: '$(VERSION); \ echo 'Requires: libssl libcrypto' ) > openssl.pc diff --git a/package/libs/openssl/patches/200-parallel_build.patch b/package/libs/openssl/patches/200-parallel_build.patch index 276800378d..f1d9f07051 100644 --- a/package/libs/openssl/patches/200-parallel_build.patch +++ b/package/libs/openssl/patches/200-parallel_build.patch @@ -1,6 +1,6 @@ --- a/Makefile.org +++ b/Makefile.org -@@ -281,17 +281,17 @@ build_libcrypto: build_crypto build_engi +@@ -282,17 +282,17 @@ build_libcrypto: build_crypto build_engi build_libssl: build_ssl libssl.pc build_crypto: @@ -24,7 +24,7 @@ all_testapps: build_libs build_testapps build_testapps: -@@ -464,7 +464,7 @@ update: errors stacks util/libeay.num ut +@@ -465,7 +465,7 @@ update: errors stacks util/libeay.num ut @set -e; target=update; $(RECURSIVE_BUILD_CMD) depend: @@ -33,7 +33,7 @@ lint: @set -e; target=lint; $(RECURSIVE_BUILD_CMD) -@@ -526,9 +526,9 @@ dist: +@@ -527,9 +527,9 @@ dist: @$(MAKE) SDIRS='$(SDIRS)' clean @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar @@ -45,7 +45,7 @@ @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \ -@@ -537,12 +537,19 @@ install_sw: +@@ -538,12 +538,19 @@ install_sw: $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \ $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \ $(INSTALL_PREFIX)$(OPENSSLDIR)/private @@ -66,7 +66,7 @@ @set -e; liblist="$(LIBS)"; for i in $$liblist ;\ do \ if [ -f "$$i" ]; then \ -@@ -626,12 +633,7 @@ install_html_docs: +@@ -627,12 +634,7 @@ install_html_docs: done; \ done diff --git a/package/libs/polarssl/Makefile b/package/libs/polarssl/Makefile deleted file mode 100644 index 04a7107a95..0000000000 --- a/package/libs/polarssl/Makefile +++ /dev/null @@ -1,74 +0,0 @@ -# -# Copyright (C) 2011-2015 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=polarssl -SRC_PKG_NAME:=mbedtls -PKG_VERSION:=1.3.18 -PKG_RELEASE:=1 -PKG_USE_MIPS16:=0 - -PKG_SOURCE:=$(SRC_PKG_NAME)-$(PKG_VERSION)-gpl.tgz -PKG_SOURCE_URL:=https://tls.mbed.org/download/ -PKG_HASH:=a229217182e024847deba3cb70bdd17e5ff4ffd9ff306cbbccfdbdff41950ea1 - -PKG_BUILD_DIR:=$(BUILD_DIR)/$(SRC_PKG_NAME)-$(PKG_VERSION) - -PKG_BUILD_PARALLEL:=1 -PKG_LICENSE:=GPL-2.0+ - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/cmake.mk - -define Package/polarssl/Default - SUBMENU:=SSL - TITLE:=Embedded SSL - URL:=http://polarssl.org/ -endef - -define Package/polarssl/Default/description -The aim of the PolarSSL project is to provide a quality, open-source -cryptographic library written in C and targeted at embedded systems. -endef - -define Package/libpolarssl -$(call Package/polarssl/Default) - SECTION:=libs - CATEGORY:=Libraries - TITLE+= (library) - ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE) -endef - -define Package/libpolarssl/description -$(call Package/polarssl/Default/description) -This package contains the PolarSSL library. -endef - -PKG_INSTALL:=1 - -CMAKE_OPTIONS += \ - -DCMAKE_BUILD_TYPE:String="Release" \ - -DUSE_SHARED_MBEDTLS_LIBRARY:Bool=ON \ - -DENABLE_TESTING:Bool=OFF \ - -DENABLE_PROGRAMS:Bool=OFF \ - -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include - $(CP) $(PKG_INSTALL_DIR)/usr/include/polarssl $(1)/usr/include/ - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmbedtls.so.* $(1)/usr/lib/ - $(LN) libmbedtls.so.$(PKG_VERSION) $(1)/usr/lib/libpolarssl.so -endef - -define Package/libpolarssl/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmbedtls.so.* $(1)/usr/lib/ - $(LN) libmbedtls.so.$(PKG_VERSION) $(1)/usr/lib/libpolarssl.so -endef - -$(eval $(call BuildPackage,libpolarssl)) diff --git a/package/libs/polarssl/patches/200-reduce_config.patch b/package/libs/polarssl/patches/200-reduce_config.patch deleted file mode 100644 index 491ecec388..0000000000 --- a/package/libs/polarssl/patches/200-reduce_config.patch +++ /dev/null @@ -1,242 +0,0 @@ ---- a/include/polarssl/config.h -+++ b/include/polarssl/config.h -@@ -432,8 +432,8 @@ - * Requires: POLARSSL_HMAC_DRBG_C - * - * Comment this macro to disable deterministic ECDSA. -- */ - #define POLARSSL_ECDSA_DETERMINISTIC -+ */ - - /** - * \def POLARSSL_KEY_EXCHANGE_PSK_ENABLED -@@ -454,8 +454,8 @@ - * TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * TLS_PSK_WITH_3DES_EDE_CBC_SHA - * TLS_PSK_WITH_RC4_128_SHA -- */ - #define POLARSSL_KEY_EXCHANGE_PSK_ENABLED -+ */ - - /** - * \def POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED -@@ -478,8 +478,8 @@ - * TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA - * TLS_DHE_PSK_WITH_RC4_128_SHA -- */ - #define POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED -+ */ - - /** - * \def POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED -@@ -498,8 +498,8 @@ - * TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA - * TLS_ECDHE_PSK_WITH_RC4_128_SHA -- */ - #define POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED -+ */ - - /** - * \def POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED -@@ -523,8 +523,8 @@ - * TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA - * TLS_RSA_PSK_WITH_RC4_128_SHA -- */ - #define POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED -+ */ - - /** - * \def POLARSSL_KEY_EXCHANGE_RSA_ENABLED -@@ -602,8 +602,8 @@ - * TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - * TLS_ECDHE_RSA_WITH_RC4_128_SHA -- */ - #define POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED -+ */ - - /** - * \def POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED -@@ -626,8 +626,8 @@ - * TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA - * TLS_ECDHE_ECDSA_WITH_RC4_128_SHA -- */ - #define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED -+ */ - - /** - * \def POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED -@@ -650,8 +650,8 @@ - * TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 -- */ - #define POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED -+ */ - - /** - * \def POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED -@@ -674,8 +674,8 @@ - * TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 -- */ - #define POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED -+ */ - - /** - * \def POLARSSL_PK_PARSE_EC_EXTENDED -@@ -835,8 +835,8 @@ - * \def POLARSSL_SELF_TEST - * - * Enable the checkup functions (*_self_test). -- */ - #define POLARSSL_SELF_TEST -+ */ - - /** - * \def POLARSSL_SSL_ALL_ALERT_MESSAGES -@@ -1139,8 +1139,8 @@ - * Requires: POLARSSL_VERSION_C - * - * Comment this to disable run-time checking and save ROM space -- */ - #define POLARSSL_VERSION_FEATURES -+ */ - - /** - * \def POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3 -@@ -1469,8 +1469,8 @@ - * TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 -- */ - #define POLARSSL_CAMELLIA_C -+ */ - - /** - * \def POLARSSL_CCM_C -@@ -1497,8 +1497,8 @@ - * Requires: POLARSSL_PEM_PARSE_C - * - * This module is used for testing (ssl_client/server). -- */ - #define POLARSSL_CERTS_C -+ */ - - /** - * \def POLARSSL_CIPHER_C -@@ -1537,8 +1537,8 @@ - * library/ssl_tls.c - * - * This module provides debugging functions. -- */ - #define POLARSSL_DEBUG_C -+ */ - - /** - * \def POLARSSL_DES_C -@@ -1593,8 +1593,8 @@ - * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK - * - * Requires: POLARSSL_ECP_C -- */ - #define POLARSSL_ECDH_C -+ */ - - /** - * \def POLARSSL_ECDSA_C -@@ -1608,8 +1608,8 @@ - * ECDHE-ECDSA - * - * Requires: POLARSSL_ECP_C, POLARSSL_ASN1_WRITE_C, POLARSSL_ASN1_PARSE_C -- */ - #define POLARSSL_ECDSA_C -+ */ - - /** - * \def POLARSSL_ECP_C -@@ -1621,8 +1621,8 @@ - * library/ecdsa.c - * - * Requires: POLARSSL_BIGNUM_C and at least one POLARSSL_ECP_DP_XXX_ENABLED -- */ - #define POLARSSL_ECP_C -+ */ - - /** - * \def POLARSSL_ENTROPY_C -@@ -1698,8 +1698,8 @@ - * Requires: POLARSSL_MD_C - * - * Uncomment to enable the HMAC_DRBG random number geerator. -- */ - #define POLARSSL_HMAC_DRBG_C -+ */ - - /** - * \def POLARSSL_MD_C -@@ -1825,8 +1825,8 @@ - * Requires: POLARSSL_HAVE_ASM - * - * This modules adds support for the VIA PadLock on x86. -- */ - #define POLARSSL_PADLOCK_C -+ */ - - /** - * \def POLARSSL_PBKDF2_C -@@ -1991,8 +1991,8 @@ - * Module: library/ripemd160.c - * Caller: library/md.c - * -- */ - #define POLARSSL_RIPEMD160_C -+ */ - - /** - * \def POLARSSL_RSA_C -@@ -2071,8 +2071,8 @@ - * Caller: - * - * Requires: POLARSSL_SSL_CACHE_C -- */ - #define POLARSSL_SSL_CACHE_C -+ */ - - /** - * \def POLARSSL_SSL_CLI_C -@@ -2148,8 +2148,8 @@ - * Caller: library/havege.c - * - * This module is used by the HAVEGE random number generator. -- */ - #define POLARSSL_TIMING_C -+ */ - - /** - * \def POLARSSL_VERSION_C -@@ -2159,8 +2159,8 @@ - * Module: library/version.c - * - * This module provides run-time version information. -- */ - #define POLARSSL_VERSION_C -+ */ - - /** - * \def POLARSSL_X509_USE_C -@@ -2269,8 +2269,8 @@ - * - * Module: library/xtea.c - * Caller: -- */ - #define POLARSSL_XTEA_C -+ */ - - /* \} name SECTION: mbed TLS modules */ - diff --git a/package/libs/uclibc++/patches/050-Bugfix-erase-on-derived-__base_associative.patch b/package/libs/uclibc++/patches/050-Bugfix-erase-on-derived-__base_associative.patch new file mode 100644 index 0000000000..2ddb8a984e --- /dev/null +++ b/package/libs/uclibc++/patches/050-Bugfix-erase-on-derived-__base_associative.patch @@ -0,0 +1,40 @@ +From 946b29e62927eadfc4e87f27b8d30e5974b78c4c Mon Sep 17 00:00:00 2001 +From: Ben Kelly +Date: Mon, 6 Feb 2017 13:08:25 +0200 +Subject: [PATCH] Bugfix erase() on derived __base_associative + +When calling erase() on a containers derived from __base_associative +(e.g. multimap) and providing a pair of iterators a segfault will +occur. + +Example code to reproduce: + + typedef std::multimap testmap; + testmap t; + t.insert(std::pair(1, 1)); + t.insert(std::pair(2, 1)); + t.insert(std::pair(3, 1)); + t.erase(t.begin(), t.end()); + +Signed-off-by: Ben Kelly +--- + include/associative_base | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/include/associative_base b/include/associative_base +index 27ae0ef..be8b27f 100644 +--- a/include/associative_base ++++ b/include/associative_base +@@ -200,8 +200,7 @@ public: + } + void erase(iterator first, iterator last){ + while(first != last){ +- backing.erase(first.base_iterator()); +- ++first; ++ first = backing.erase(first.base_iterator()); + } + } + +-- +2.7.4 + diff --git a/package/libs/zlib/Makefile b/package/libs/zlib/Makefile index d6155b6d4e..902381bdea 100644 --- a/package/libs/zlib/Makefile +++ b/package/libs/zlib/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zlib -PKG_VERSION:=1.2.10 +PKG_VERSION:=1.2.11 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=http://www.zlib.net @SF/libpng -PKG_HASH:=9612bf086047078ce3a1c154fc9052113fc1a2a97234a059da17a6299bd4dd32 +PKG_SOURCE_URL:=@SF/libpng http://www.zlib.net +PKG_HASH:=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066 PKG_LICENSE:=Zlib PKG_LICENSE_FILES:=README diff --git a/package/luci/.buildpath b/package/luci/.buildpath deleted file mode 100644 index 81fa6469ec..0000000000 --- a/package/luci/.buildpath +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/package/luci/.cproject b/package/luci/.cproject deleted file mode 100644 index e1a4774106..0000000000 --- a/package/luci/.cproject +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/package/luci/.gitignore b/package/luci/.gitignore deleted file mode 100644 index 07494e98ef..0000000000 --- a/package/luci/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -dist/ -/host -*.o -*.so -*.swp -*.po~ -/docs -modules/luci-base/src/po2lmo diff --git a/package/luci/.project b/package/luci/.project deleted file mode 100644 index 11b398b269..0000000000 --- a/package/luci/.project +++ /dev/null @@ -1,78 +0,0 @@ - - - luci - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.core.cnature - org.eclipse.dltk.lua.core.nature - - diff --git a/package/luci/applications/luci-app-adblock/luasrc/model/cbi/adblock.lua b/package/luci/applications/luci-app-adblock/luasrc/model/cbi/adblock.lua index d80cb486e3..0a4a4cdd2f 100644 --- a/package/luci/applications/luci-app-adblock/luasrc/model/cbi/adblock.lua +++ b/package/luci/applications/luci-app-adblock/luasrc/model/cbi/adblock.lua @@ -34,13 +34,13 @@ des = bl:option(DummyValue, "adb_src_desc", translate("Description")) -- Additional options -s2 = m:section(NamedSection, "backup", "service", translate("Backup options")) +s2 = m:section(NamedSection, "global", "adblock", translate("Backup options")) -o4 = s2:option(Flag, "enabled", translate("Enable blocklist backup")) +o4 = s2:option(Flag, "adb_backup", translate("Enable blocklist backup")) o4.rmempty = false o4.default = 0 -o5 = s2:option(Value, "adb_dir", translate("Backup directory")) +o5 = s2:option(Value, "adb_backupdir", translate("Backup directory")) o5.rmempty = false o5.datatype = "directory" diff --git a/package/luci/applications/luci-app-adblock/po/pt-br/adblock.po b/package/luci/applications/luci-app-adblock/po/pt-br/adblock.po new file mode 100644 index 0000000000..a238dc7f94 --- /dev/null +++ b/package/luci/applications/luci-app-adblock/po/pt-br/adblock.po @@ -0,0 +1,92 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: pt_BR\n" + +msgid "" +"). Note that list URLs and Shallalist category selections are not " +"configurable via Luci." +msgstr "" +"). Note que a lista de URL e as seleções de categoria da Shallalist não são " +"configuráveis pelo Luci." + +msgid "Adblock" +msgstr "Adblock" + +msgid "Available blocklist sources (" +msgstr "Fontes de listas de bloqueio disponíveis (" + +msgid "Backup directory" +msgstr "Diretório da cópia de segurança" + +msgid "Backup options" +msgstr "Opções da cópia de segurança" + +msgid "Blocklist sources" +msgstr "Fontes de listas de bloqueio" + +msgid "" +"Configuration of the adblock package to block ad/abuse domains by using DNS." +msgstr "" +"Configuração do pacote adblock para bloquear, usando o DNS, domínios que " +"distribuem propagandas abusivas." + +msgid "Description" +msgstr "Descrição" + +msgid "Enable adblock" +msgstr "Habilitar adblock" + +msgid "Enable blocklist backup" +msgstr "Habilitar cópia de segurança da lista de bloqueio" + +msgid "Enable verbose debug logging" +msgstr "Habilite registros detalhados para depuração" + +msgid "Enabled" +msgstr "Habilitado" + +msgid "Extra options" +msgstr "Opções adicionais" + +msgid "" +"File with whitelisted hosts/domains that are allowed despite being on a " +"blocklist." +msgstr "" +"Arquivo com a lista branca dos equipamentos/domínios que serão autorizados " +"mesmo estando na lista de bloqueio." + +msgid "Global options" +msgstr "Opções Globais" + +msgid "" +"Options for further tweaking in case the defaults are not suitable for you." +msgstr "" +"Opções para aprimoramentos adicionais caso as opções padrão não sejam " +"suficientes para você." + +msgid "Restrict reload trigger to certain interface(s)" +msgstr "Restringir o gatilho de recarga para somente alguma(s) interface(s)" + +msgid "" +"Space separated list of wan interfaces that trigger reload action. To " +"disable reload trigger set it to 'false'. Default: empty" +msgstr "" +"Lista das interfaces WAN, separadas por espaço, que podem disparar uma ação " +"de recarga. Para desabilitar este gatilho, defina-o como 'false'. Padrão: em " +"branco" + +msgid "Whitelist file" +msgstr "Arquivo da lista branca" + +msgid "see list details" +msgstr "veja os detalhes da lista" diff --git a/package/luci/applications/luci-app-ahcp/po/pt-br/ahcp.po b/package/luci/applications/luci-app-ahcp/po/pt-br/ahcp.po index 55ec29cdc7..741c14572b 100644 --- a/package/luci/applications/luci-app-ahcp/po/pt-br/ahcp.po +++ b/package/luci/applications/luci-app-ahcp/po/pt-br/ahcp.po @@ -1,20 +1,20 @@ msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"PO-Revision-Date: 2014-03-29 23:07+0200\n" -"Last-Translator: Luiz Angelo \n" +"Project-Id-Version: \n" +"PO-Revision-Date: 2017-02-17 17:07-0200\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" "Language-Team: none\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Pootle 2.0.6\n" +"X-Generator: Poedit 1.8.11\n" +"POT-Creation-Date: \n" msgid "AHCP Server" msgstr "Servidor AHCP" -#, fuzzy msgid "" "AHCP is an autoconfiguration protocol for IPv6 and dual-stack IPv6/IPv4 " "networks designed to be used in place of router discovery or DHCP on " diff --git a/package/luci/applications/luci-app-aria2/po/pt-br/aria2.po b/package/luci/applications/luci-app-aria2/po/pt-br/aria2.po new file mode 100644 index 0000000000..1bb4137446 --- /dev/null +++ b/package/luci/applications/luci-app-aria2/po/pt-br/aria2.po @@ -0,0 +1,236 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: pt_BR\n" + +msgid "\"Falloc\" is not available in all cases." +msgstr "\"Falloc\" não está disponível em todas as classes." + +msgid "DHT enabled" +msgstr "" +"DHT habilitado" + +msgid "LPD enabled" +msgstr "" +"LPD habilitado" + +msgid "Additional Bt tracker enabled" +msgstr "Rastreadores BitTorrent adicionais habilitado" + +msgid "Aria2" +msgstr "Aria2" + +msgid "Aria2 Settings" +msgstr "Configurações do Aria2" + +msgid "Aria2 Status" +msgstr "Estado do Aria2" + +msgid "" +"Aria2 is a multi-protocol & multi-source download utility, here you can " +"configure the settings." +msgstr "" +"Aria2 é um utilitário de transferência multi-protocolo de múltiplas fontes, " +"aqui você pode configurá-lo." + +msgid "Autosave session interval" +msgstr "Intervalo para autossalvamento da sessão" + +msgid "BitTorrent Settings" +msgstr "Configurações do BitTorrent" + +msgid "BitTorrent listen port" +msgstr "Porta de escuta do BitTorrent" + +msgid "Collecting data..." +msgstr "Coletando dados..." + +msgid "Config file directory" +msgstr "Diretório dos arquivos de configuração" + +msgid "Debug" +msgstr "Depuração" + +msgid "Default download directory" +msgstr "Diretório padrão de arquivos baixados" + +msgid "Disk cache" +msgstr "Cache em Disco" + +msgid "Enable log" +msgstr "Habilitar registros" + +msgid "Enabled" +msgstr "Habilitado" + +msgid "Error" +msgstr "Erro" + +msgid "Extra Settings" +msgstr "Configurações Adicionais" + +msgid "Falloc" +msgstr "Falloc" + +msgid "Files and Locations" +msgstr "Arquivos e Locais" + +msgid "Follow torrent" +msgstr "Seguir torrent" + +msgid "General Settings" +msgstr "Configurações Gerais" + +msgid "Generate Randomly" +msgstr "Gerar aleatoriamente" + +msgid "Info" +msgstr "Informações" + +msgid "List of additional Bt tracker" +msgstr "Lista de rastreadores BitTorrent adicionais" + +msgid "List of extra settings" +msgstr "Lista de configurações adicionais" + +msgid "Log file is in the config file dir." +msgstr "" +"Arquivo de registro (log) está no diretório do arquivo de configuração." + +msgid "Log level" +msgstr "Nível do registro" + +msgid "Max concurrent downloads" +msgstr "Número máximo de transferencias simultâneas" + +msgid "Max connection per server" +msgstr "Numero máximo de conexões por servidor" + +msgid "Max number of peers per torrent" +msgstr "Numero máximo de parceiros por torrent" + +msgid "Max number of split" +msgstr "Numero máximo de divisões" + +msgid "Min split size" +msgstr "Tamanho mínimo da divisão" + +msgid "No Authentication" +msgstr "Sem Autenticação" + +msgid "Notice" +msgstr "Aviso" + +msgid "Off" +msgstr "Desligado" + +msgid "Open WebUI-Aria2" +msgstr "Abrir WebUI-Aria2" + +msgid "Open YAAW" +msgstr "Abrir YAAW" + +msgid "Overall download limit" +msgstr "Limite global para baixar" + +msgid "Overall speed limit enabled" +msgstr "Limite da taxa de transferência global habilitado" + +msgid "Overall upload limit" +msgstr "Limite global para subir" + +msgid "Per task download limit" +msgstr "Limite por tarefa para baixar" + +msgid "Per task speed limit enabled" +msgstr "Limite da taxa de transferência por tarefa habilitado" + +msgid "Per task upload limit" +msgstr "Limite por tarefa para subir" + +msgid "Prealloc" +msgstr "Pré-alocação" + +msgid "Preallocation" +msgstr "Pré-alocação" + +msgid "Prefix of peer ID" +msgstr "Prefixo da identificação do paceiro" + +msgid "RPC Token" +msgstr "" +"Chave eletrônica do RPC" + +msgid "RPC authentication method" +msgstr "" +"Método de autenticação do RPC" + +msgid "RPC password" +msgstr "" +"Senha do RPC" + +msgid "RPC port" +msgstr "" +"Porta do RPC" + +msgid "RPC username" +msgstr "" +"Nome do usuario do RPC" + +msgid "Run daemon as user" +msgstr "Executar serviço como usuário" + +msgid "Sec" +msgstr "Segurança" + +msgid "Task Settings" +msgstr "Configurações das tarefas" + +msgid "The Aria2 service is not running." +msgstr "O serviço Aria2 está parado." + +msgid "The Aria2 service is running." +msgstr "O serviço Aria2 está em execução." + +msgid "Token" +msgstr "Chave eletrônica" + +msgid "Trunc" +msgstr "Truncar" + +msgid "Use WebSocket" +msgstr "Use WebSockets" + +msgid "User agent value" +msgstr "Valor da identificação do agente do usuário" + +msgid "Username & Password" +msgstr "Usuário & Senha" + +msgid "View Json-RPC URL" +msgstr "Visualizar URL do JSON-RPC" + +msgid "Warn" +msgstr "Atenção" + +msgid "in bytes, You can append K or M." +msgstr "em bytes. Você pode sufixar com K (quilo) ou M (mega)." + +msgid "in bytes/sec, You can append K or M." +msgstr "em bytes por segundo. Você pode sufixar com K (quilo) ou M (mega)." diff --git a/package/luci/applications/luci-app-commands/po/pt-br/commands.po b/package/luci/applications/luci-app-commands/po/pt-br/commands.po index 83c7bd5db5..a0c7724d6e 100644 --- a/package/luci/applications/luci-app-commands/po/pt-br/commands.po +++ b/package/luci/applications/luci-app-commands/po/pt-br/commands.po @@ -1,15 +1,16 @@ msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"PO-Revision-Date: 2014-03-15 22:02+0200\n" -"Last-Translator: Luiz Angelo \n" +"Project-Id-Version: \n" +"PO-Revision-Date: 2017-02-20 17:39-0300\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" "Language-Team: none\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Pootle 2.0.6\n" +"X-Generator: Poedit 1.8.11\n" +"POT-Creation-Date: \n" msgid "A short textual description of the configured command" msgstr "Uma pequena descrição textual do comando configurado" @@ -96,3 +97,21 @@ msgstr "" msgid "Waiting for command to complete..." msgstr "Aguardando a conclusão do comando..." + +#~ msgid "Command executed successfully." +#~ msgstr "O comando executou com sucesso." + +#~ msgid "Command exited with status code" +#~ msgstr "O comando encerrou com um estado de erro" + +#~ msgid "Download execution result" +#~ msgstr "Baixar os resultados da execução" + +#~ msgid "Or display result" +#~ msgstr "Ou mostre o resultado" + +#~ msgid "Standard Error" +#~ msgstr "Saída de Erro" + +#~ msgid "Standard Output" +#~ msgstr "Saída Padrão" diff --git a/package/luci/applications/luci-app-ddns/po/pt-br/ddns.po b/package/luci/applications/luci-app-ddns/po/pt-br/ddns.po index 4970846516..ab22837b28 100644 --- a/package/luci/applications/luci-app-ddns/po/pt-br/ddns.po +++ b/package/luci/applications/luci-app-ddns/po/pt-br/ddns.po @@ -2,15 +2,15 @@ msgid "" msgstr "" "Project-Id-Version: luci-app-ddns 2.4.0-1\n" "POT-Creation-Date: 2016-01-30 11:07+0100\n" -"PO-Revision-Date: 2016-07-01 22:40-0300\n" -"Last-Translator: Matheus Dal Mago \n" +"PO-Revision-Date: 2017-02-20 17:41-0300\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" "Language-Team: \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Poedit 1.8.8\n" +"X-Generator: Poedit 1.8.11\n" msgid "&" msgstr "&" @@ -228,7 +228,7 @@ msgid "Error Retry Interval" msgstr "Intervalo de tentativas em Erro" msgid "Event Network" -msgstr "" +msgstr "Rede de Evento" msgid "File" msgstr "Arquivo" @@ -438,16 +438,16 @@ msgid "No certificates found" msgstr "Nenhum certificado encontrado" msgid "No data" -msgstr "" +msgstr "Sem dados" msgid "No logging" -msgstr "" +msgstr "Sem registros" msgid "Non-public and by default blocked IP's" msgstr "IPs não públicos e bloqueados por padrão" msgid "Notice" -msgstr "" +msgstr "Aviso" msgid "Number of last lines stored in log files" msgstr "Número das últimas linhas salvas nos arquivos de log" @@ -475,7 +475,7 @@ msgstr "" "Em Erro, o script irá para a execução após um número definido de tentativas" msgid "OpenWrt Wiki" -msgstr "" +msgstr "Wiki do OpenWRT" msgid "Optional Encoded Parameter" msgstr "Parâmetro Opcionalmente Codificado" @@ -490,7 +490,7 @@ msgid "Optional: Replaces [PARAMOPT] in Update-URL (NOT URL-encoded)" msgstr "Opcional: Substitui [PARAMOPT] na URL de atualização" msgid "Overview" -msgstr "" +msgstr "Visão Geral" msgid "PROXY-Server" msgstr "servidor PROXY" @@ -575,7 +575,7 @@ msgid "There is no service configured." msgstr "Não há serviço configurado" msgid "Timer Settings" -msgstr "" +msgstr "Configurações do Controlador de Tempo" msgid "To change global settings click here" msgstr "Clique aqui para mudar configurações globais" diff --git a/package/luci/applications/luci-app-dynapoint/Makefile b/package/luci/applications/luci-app-dynapoint/Makefile new file mode 100644 index 0000000000..d16ef4a8fa --- /dev/null +++ b/package/luci/applications/luci-app-dynapoint/Makefile @@ -0,0 +1,20 @@ +# +# Copyright (C) 2016 The LuCI Team +# +# This is free software, licensed under the GNU General Public License v3. +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=LuCI Support for DynaPoint +LUCI_DEPENDS:=+dynapoint + +PKG_NAME:=luci-app-dynapoint +PKG_VERSION:=1.0 +PKG_RELEASE:=1 +PKG_LICENSE:=GPL-3.0+ +PKG_MAINTAINER:=Tobias Ilte +include ../../luci.mk + +# call BuildPackage - OpenWrt buildroot signature + diff --git a/package/luci/applications/luci-app-dynapoint/luasrc/controller/dynapoint.lua b/package/luci/applications/luci-app-dynapoint/luasrc/controller/dynapoint.lua new file mode 100644 index 0000000000..65348632e9 --- /dev/null +++ b/package/luci/applications/luci-app-dynapoint/luasrc/controller/dynapoint.lua @@ -0,0 +1,9 @@ +module("luci.controller.dynapoint", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/dynapoint") then + return + end + entry({"admin", "services", "dynapoint"}, cbi("dynapoint"), _("DynaPoint")) +end + diff --git a/package/luci/applications/luci-app-dynapoint/luasrc/model/cbi/dynapoint.lua b/package/luci/applications/luci-app-dynapoint/luasrc/model/cbi/dynapoint.lua new file mode 100644 index 0000000000..e6871a5bc4 --- /dev/null +++ b/package/luci/applications/luci-app-dynapoint/luasrc/model/cbi/dynapoint.lua @@ -0,0 +1,99 @@ +local uci = require "luci.model.uci".cursor() +local a = require "luci.model.ipkg" +local DISP = require "luci.dispatcher" + +local wlcursor = luci.model.uci.cursor_state() +local wireless = wlcursor:get_all("wireless") +local ifaces = {} + +for k, v in pairs(wireless) do + if v[".type"] == "wifi-iface" then + table.insert(ifaces, v) + end +end + +m = Map("dynapoint") +m:chain("wireless") + +s = m:section(NamedSection, "internet", "rule", translate("Configuration"), translate("Check Internet connectivity via HTTP header download")) + +hosts = s:option(DynamicList, "hosts", translate("List of host addresses"), translate("List of host addresses (url or IP) to track and request http headers from")) +hosts.datatype = "string" + +interval = s:option(Value, "interval", translate("Test-run interval"), translate("Time interval in seconds to re-start a new test run")) +interval.datatype = "uinteger" +interval.default = "30" + +offline_treshold = s:option(Value, "offline_threshold", translate("Switch_to_offline threshold"), translate("Failure counter after how many failed download attempts, the state is considered as offline")) +offline_treshold.datatype = "uinteger" +offline_treshold.default = "1" + +add_hostname_to_ssid = s:option(Flag, "add_hostname_to_ssid", translate("Append hostname to ssid"), translate("Append the router's hostname to the SSID when connectivity check fails")) +add_hostname_to_ssid.rmempty = false + + +if (a.installed("curl") == true) then + use_curl = s:option(Flag, "use_curl", translate("Use curl"), translate("Use curl instead of wget for testing the connectivity.")) + use_curl.rmempty = false + + curl_interface = s:option(Value, "curl_interface", translate("Used interface"), translate("Which interface should curl use. (Use ifconfig to find out)")) + curl_interface.datatype = "string" + curl_interface:depends("use_curl","1") + curl_interface.placeholder = "eth0" +else + use_curl = s:option(Flag, "use_curl", translate("Use curl instead of wget"), translate("Curl is currently not installed.") + .." Please install the package in the " + ..[[]] + .. "Software Section" .. [[]] + .. "." + ) + use_curl.rmempty = false + use_curl.template = "dynapoint/cbi_checkbox" +end + +m1 = Map("wireless", "DynaPoint", translate("Dynamic Access Point Manager")) + +aps = m1:section(TypedSection, "wifi-iface", translate("List of Wireless Virtual Interfaces (wVIF)")) +aps.addremove = false +aps.anonymous = true +aps.template = "cbi/tblsection" + +status = aps:option(DummyValue, "disabled", translate("WiFi Status")) +status.template = "dynapoint/cbi_color" + +function status.cfgvalue(self,section) + local val = m1:get(section, "disabled") + if val == "1" then return translate("Disabled") end + if (val == nil or val == "0") then return translate("Enabled") end + return val +end + +device = aps:option(DummyValue, "device", translate("Device")) +function device.cfgvalue(self,section) + local dev = m1:get(section, "device") + local val = m1:get(dev, "hwmode") + if val == "11a" then return dev .. " (5 GHz)" else + return dev .. " (2,4 GHz)" + end + return val +end + + + + + +mode = aps:option(DummyValue, "mode", translate("Mode")) + +ssid = aps:option(DummyValue, "ssid", translate("SSID")) + + +action = aps:option(ListValue, "dynapoint_rule", translate("Activate this wVIF if status is:")) +action.widget="select" +action:value("internet",translate("Online")) +action:value("!internet",translate("Offline")) +action:value("",translate("Not used by DynaPoint")) +action.default = "" + +return m1,m + diff --git a/package/luci/applications/luci-app-dynapoint/luasrc/view/dynapoint/cbi_checkbox.htm b/package/luci/applications/luci-app-dynapoint/luasrc/view/dynapoint/cbi_checkbox.htm new file mode 100644 index 0000000000..5f8bcd5ee0 --- /dev/null +++ b/package/luci/applications/luci-app-dynapoint/luasrc/view/dynapoint/cbi_checkbox.htm @@ -0,0 +1,6 @@ +<%+cbi/valueheader%> + + + + +<%+cbi/valuefooter%> diff --git a/package/luci/applications/luci-app-dynapoint/luasrc/view/dynapoint/cbi_color.htm b/package/luci/applications/luci-app-dynapoint/luasrc/view/dynapoint/cbi_color.htm new file mode 100644 index 0000000000..bfc710e236 --- /dev/null +++ b/package/luci/applications/luci-app-dynapoint/luasrc/view/dynapoint/cbi_color.htm @@ -0,0 +1,18 @@ +<%+cbi/valueheader%> + + +<% +if (self:cfgvalue(section) == translate("Disabled")) then +%> + +<%=self:cfgvalue(section)%> + +<% +else +%> +<%=self:cfgvalue(section)%> +<% +end +%> + +<%+cbi/valuefooter%> diff --git a/package/luci/applications/luci-app-dynapoint/po/de/dynapoint.po b/package/luci/applications/luci-app-dynapoint/po/de/dynapoint.po new file mode 100644 index 0000000000..e2507e493e --- /dev/null +++ b/package/luci/applications/luci-app-dynapoint/po/de/dynapoint.po @@ -0,0 +1,106 @@ +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2016-08-31 15:51+0200\n" +"Language-Team: German\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Activate this wVIF if status is:" +msgstr "Aktiviere diese drahtlose Schnittstelle wenn:" + +msgid "Append hostname to ssid" +msgstr "Anfügen des hostname zur SSID" + +msgid "Append the router's hostname to the SSID when connectivity check fails" +msgstr "" +"Fügt den hostname des routers zur SSID an, wenn die Verbindungsüberprüfung " +"fehl schlägt" + +msgid "Check Internet connectivity via HTTP header download" +msgstr "Testen der Internetverfügbarkeit via HTTP header download" + +msgid "Configuration" +msgstr "Konfiguration" + +msgid "Curl is currently not installed." +msgstr "Curl ist momentan nicht installiert." + +msgid "Device" +msgstr "Gerät" + +msgid "Disabled" +msgstr "Deaktiviert" + +msgid "DynaPoint" +msgstr "" + +msgid "Dynamic Access Point Manager" +msgstr "" + +msgid "Enabled" +msgstr "Aktiviert" + +msgid "" +"Failure counter after how many failed download attempts, the state is " +"considered as offline" +msgstr "" +"Anzahl der fehlgeschlagenen Downloadversuche, nach denen die Verbindung als offline angesehen wird" + +msgid "List of Wireless Virtual Interfaces (wVIF)" +msgstr "Liste der Drahtlosen virtuellen Schnittstellen" + +msgid "List of host addresses" +msgstr "Liste der Zieladressen" + +msgid "" +"List of host addresses (url or IP) to track and request http headers from" +msgstr "Liste der Zieladressen (URL oder IP) für den HTTP header download" + +msgid "Mode" +msgstr "Modus" + +msgid "Not used by DynaPoint" +msgstr "Nicht von DynaPoint benutzt" + +msgid "Offline" +msgstr "Offline" + +msgid "Online" +msgstr "Online" + +msgid "SSID" +msgstr "" + +msgid "Switch_to_offline threshold" +msgstr "Offline-Schwelle" + +msgid "Test-run interval" +msgstr "Testlaufintervall" + +msgid "Time interval in seconds to re-start a new test run" +msgstr "Zeitintervall in Sekunden für einen Testlauf" + +msgid "Use curl" +msgstr "Curl benutzen" + +msgid "Use curl instead of wget" +msgstr "Curl anstatt wget benutzen" + +msgid "Use curl instead of wget for testing the connectivity." +msgstr "Curl anstatt wget benutzen, um die Internetverbindung zu überprüfen." + +msgid "Used interface" +msgstr "Benutztes interface" + +msgid "Which interface should curl use. (Use ifconfig to find out)" +msgstr "" +"Welches Interface von curl benutzt werden soll. (ifconfig benutzen, um das " +"herauszufinden" + +msgid "WiFi Status" +msgstr "" + diff --git a/package/luci/applications/luci-app-dynapoint/po/ja/dynapoint.po b/package/luci/applications/luci-app-dynapoint/po/ja/dynapoint.po new file mode 100644 index 0000000000..75031985f7 --- /dev/null +++ b/package/luci/applications/luci-app-dynapoint/po/ja/dynapoint.po @@ -0,0 +1,108 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Last-Translator: INAGAKI Hiroshi \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language: ja\n" + +msgid "Activate this wVIF if status is:" +msgstr "wVIFを有効化する接続ステータス:" + +msgid "Append hostname to ssid" +msgstr "ホスト名をSSIDに追加する" + +msgid "Append the router's hostname to the SSID when connectivity check fails" +msgstr "接続性のチェックが失敗した場合、ルーターのホスト名をSSIDに追加します。" + +msgid "Check Internet connectivity via HTTP header download" +msgstr "" +"HTTP ヘッダーのダウンロードを通して、インターネットの接続性をチェックします。" + +msgid "Configuration" +msgstr "設定" + +msgid "Curl is currently not installed." +msgstr "curl は現在インストールされていません。" + +msgid "Device" +msgstr "デバイス" + +msgid "Disabled" +msgstr "無効" + +msgid "DynaPoint" +msgstr "DynaPoint" + +msgid "Dynamic Access Point Manager" +msgstr "ダイナミック アクセスポイント マネージャー" + +msgid "Enabled" +msgstr "有効" + +msgid "" +"Failure counter after how many failed download attempts, the state is " +"considered as offline" +msgstr "状態をオフラインと見なすまでの、ダウンロード試行の失敗回数です。" + +msgid "List of Wireless Virtual Interfaces (wVIF)" +msgstr "無線仮想インターフェース (wVIF) のリスト" + +msgid "List of host addresses" +msgstr "ホストアドレスのリスト" + +msgid "" +"List of host addresses (url or IP) to track and request http headers from" +msgstr "" +"HTTP ヘッダーの追跡およびリクエストを行う、ホスト アドレス(URLまたはIP)のリ" +"ストです。" + +msgid "Mode" +msgstr "モード" + +msgid "Not used by DynaPoint" +msgstr "DynaPointで使用しない" + +msgid "Offline" +msgstr "オフライン" + +msgid "Online" +msgstr "オンライン" + +msgid "SSID" +msgstr "SSID" + +msgid "Switch_to_offline threshold" +msgstr "オフライン化閾値" + +msgid "Test-run interval" +msgstr "テスト実行間隔" + +msgid "Time interval in seconds to re-start a new test run" +msgstr "接続性テストを再実行するまでの時間間隔(秒)です。" + +msgid "Use curl" +msgstr "curl を使用する" + +msgid "Use curl instead of wget" +msgstr "wget の代わりに curl を使用する" + +msgid "Use curl instead of wget for testing the connectivity." +msgstr "接続性のテストの際、wget の代わりに curl を使用します。" + +msgid "Used interface" +msgstr "使用するインターフェース" + +msgid "Which interface should curl use. (Use ifconfig to find out)" +msgstr "" +"curl が使用するインターフェースです。ifconfigを使用してインターフェース名を確" +"認します。" + +msgid "WiFi Status" +msgstr "無線ステータス" diff --git a/package/luci/applications/luci-app-dynapoint/po/pt-br/dynapoint.po b/package/luci/applications/luci-app-dynapoint/po/pt-br/dynapoint.po new file mode 100644 index 0000000000..59b02629a9 --- /dev/null +++ b/package/luci/applications/luci-app-dynapoint/po/pt-br/dynapoint.po @@ -0,0 +1,107 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: pt_BR\n" + +msgid "Activate this wVIF if status is:" +msgstr "Aivar este wVIF se o estado for:" + +msgid "Append hostname to ssid" +msgstr "Sufixar o nome do equipamento ao SSID" + +msgid "Append the router's hostname to the SSID when connectivity check fails" +msgstr "" +"Sufixar o nome do roteador ao SSID quando a verificação da conectividade " +"falhar" + +msgid "Check Internet connectivity via HTTP header download" +msgstr "Cerifique a conectividade com a internet baixando o cabeçalho HTTP " + +msgid "Configuration" +msgstr "Configuração" + +msgid "Curl is currently not installed." +msgstr "O cURL não está instalado." + +msgid "Device" +msgstr "Dispositivo" + +msgid "Disabled" +msgstr "Desabilitado" + +msgid "DynaPoint" +msgstr "DynaPoint" + +msgid "Dynamic Access Point Manager" +msgstr "Gerenciamento do Ponto de Acesso Dinâmico" + +msgid "Enabled" +msgstr "Habilitado" + +msgid "" +"Failure counter after how many failed download attempts, the state is " +"considered as offline" +msgstr "Numero de falhar para considerar como inalcançável" + +msgid "List of Wireless Virtual Interfaces (wVIF)" +msgstr "Lista de Interfaces Virtuais Wireless (wVIF)" + +msgid "List of host addresses" +msgstr "Lista de endereços dos equipamentos" + +msgid "" +"List of host addresses (url or IP) to track and request http headers from" +msgstr "" +"Lista de endereços dos equipamentos (URL ou endereço IP) para requisitar " +"cabeçalhos HTTP" + +msgid "Mode" +msgstr "Modo" + +msgid "Not used by DynaPoint" +msgstr "Não usado pelo DynaPoint" + +msgid "Offline" +msgstr "Desconectado" + +msgid "Online" +msgstr "Conectado" + +msgid "SSID" +msgstr "SSID" + +msgid "Switch_to_offline threshold" +msgstr "Limiar para mudar para desconectado" + +msgid "Test-run interval" +msgstr "Intervalo para execução do teste" + +msgid "Time interval in seconds to re-start a new test run" +msgstr "Intervalo, em segundos, para reiniciar um nova execução do teste" + +msgid "Use curl" +msgstr "Usar cURL" + +msgid "Use curl instead of wget" +msgstr "Usar cURL ao invés do wget" + +msgid "Use curl instead of wget for testing the connectivity." +msgstr "Usar cURL ao invés do wget para testar a conectividade." + +msgid "Used interface" +msgstr "Dispositivos usadas" + +msgid "Which interface should curl use. (Use ifconfig to find out)" +msgstr "Qual dispositivo o cURL deve usar. (Use ifconfig para listá-las)" + +msgid "WiFi Status" +msgstr "Estado da WiFi" diff --git a/package/luci/applications/luci-app-dynapoint/po/templates/dynapoint.pot b/package/luci/applications/luci-app-dynapoint/po/templates/dynapoint.pot new file mode 100644 index 0000000000..f352425be3 --- /dev/null +++ b/package/luci/applications/luci-app-dynapoint/po/templates/dynapoint.pot @@ -0,0 +1,92 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "Activate this wVIF if status is:" +msgstr "" + +msgid "Append hostname to ssid" +msgstr "" + +msgid "Append the router's hostname to the SSID when connectivity check fails" +msgstr "" + +msgid "Check Internet connectivity via HTTP header download" +msgstr "" + +msgid "Configuration" +msgstr "" + +msgid "Curl is currently not installed." +msgstr "" + +msgid "Device" +msgstr "" + +msgid "Disabled" +msgstr "" + +msgid "DynaPoint" +msgstr "" + +msgid "Dynamic Access Point Manager" +msgstr "" + +msgid "Enabled" +msgstr "" + +msgid "" +"Failure counter after how many failed download attempts, the state is " +"considered as offline" +msgstr "" + +msgid "List of Wireless Virtual Interfaces (wVIF)" +msgstr "" + +msgid "List of host addresses" +msgstr "" + +msgid "" +"List of host addresses (url or IP) to track and request http headers from" +msgstr "" + +msgid "Mode" +msgstr "" + +msgid "Not used by DynaPoint" +msgstr "" + +msgid "Offline" +msgstr "" + +msgid "Online" +msgstr "" + +msgid "SSID" +msgstr "" + +msgid "Switch_to_offline threshold" +msgstr "" + +msgid "Test-run interval" +msgstr "" + +msgid "Time interval in seconds to re-start a new test run" +msgstr "" + +msgid "Use curl" +msgstr "" + +msgid "Use curl instead of wget" +msgstr "" + +msgid "Use curl instead of wget for testing the connectivity." +msgstr "" + +msgid "Used interface" +msgstr "" + +msgid "Which interface should curl use. (Use ifconfig to find out)" +msgstr "" + +msgid "WiFi Status" +msgstr "" diff --git a/package/luci/applications/luci-app-dynapoint/root/etc/uci-defaults/40_luci-dynapoint b/package/luci/applications/luci-app-dynapoint/root/etc/uci-defaults/40_luci-dynapoint new file mode 100644 index 0000000000..7287ccd420 --- /dev/null +++ b/package/luci/applications/luci-app-dynapoint/root/etc/uci-defaults/40_luci-dynapoint @@ -0,0 +1,13 @@ +#!/bin/sh + +# needed for "Save and Apply" to restart dynapoint +uci -q batch <<-EOF >/dev/null + delete ucitrack.@dynapoint[-1] + add ucitrack dynapoint + set ucitrack.@dynapoint[-1].init="dynapoint" + commit dynapoint +EOF + +rm -f /tmp/luci-indexcache +exit 0 + diff --git a/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/forward-details.lua b/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/forward-details.lua index 22f1c77164..17a49483d7 100644 --- a/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/forward-details.lua +++ b/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/forward-details.lua @@ -73,7 +73,7 @@ o = s:option(Value, "src_ip", translate("Source IP address"), translate("Only match incoming traffic from this IP or range.")) o.rmempty = true -o.datatype = "neg(ip4addr)" +o.datatype = "neg(ipmask4)" o.placeholder = translate("any") luci.sys.net.ipv4_hints(function(ip, name) @@ -99,7 +99,7 @@ end) o.rmempty = true -o.datatype = "neg(ip4addr)" +o.datatype = "neg(ipmask4)" o.placeholder = translate("any") @@ -119,7 +119,7 @@ o.template = "cbi/firewall_zonelist" o = s:option(Value, "dest_ip", translate("Internal IP address"), translate("Redirect matched incoming traffic to the specified \ internal host")) -o.datatype = "ip4addr" +o.datatype = "ipmask4" luci.sys.net.ipv4_hints(function(ip, name) o:value(ip, "%s (%s)" %{ ip, name }) diff --git a/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua b/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua index 97e93ae050..1c838888f1 100644 --- a/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua +++ b/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua @@ -99,7 +99,7 @@ elseif rule_type == "redirect" then o = s:option(Value, "src_ip", translate("Source IP address")) o.rmempty = true - o.datatype = "neg(ipaddr)" + o.datatype = "neg(ipmask4)" o.placeholder = translate("any") luci.sys.net.ipv4_hints(function(ip, name) @@ -123,7 +123,7 @@ elseif rule_type == "redirect" then o = s:option(Value, "dest_ip", translate("Destination IP address")) - o.datatype = "neg(ip4addr)" + o.datatype = "neg(ipmask4)" luci.sys.net.ipv4_hints(function(ip, name) o:value(ip, "%s (%s)" %{ ip, name }) @@ -269,7 +269,7 @@ else o = s:option(Value, "src_ip", translate("Source address")) - o.datatype = "neg(ipaddr)" + o.datatype = "neg(ipmask)" o.placeholder = translate("any") luci.sys.net.ipv4_hints(function(ip, name) @@ -290,7 +290,7 @@ else o = s:option(Value, "dest_ip", translate("Destination address")) - o.datatype = "neg(ipaddr)" + o.datatype = "neg(ipmask)" o.placeholder = translate("any") luci.sys.net.ipv4_hints(function(ip, name) diff --git a/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua b/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua index c8b8f22bda..500d1bf32f 100644 --- a/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua +++ b/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua @@ -126,7 +126,7 @@ msrc = s:taboption("advanced", DynamicList, "masq_src", translate("Restrict Masquerading to given source subnets")) msrc.optional = true -msrc.datatype = "list(neg(or(uciname,hostname,ip4addr)))" +msrc.datatype = "list(neg(or(uciname,hostname,ipmask4)))" msrc.placeholder = "0.0.0.0/0" msrc:depends("family", "") msrc:depends("family", "ipv4") @@ -135,7 +135,7 @@ mdest = s:taboption("advanced", DynamicList, "masq_dest", translate("Restrict Masquerading to given destination subnets")) mdest.optional = true -mdest.datatype = "list(neg(or(uciname,hostname,ip4addr)))" +mdest.datatype = "list(neg(or(uciname,hostname,ipmask4)))" mdest.placeholder = "0.0.0.0/0" mdest:depends("family", "") mdest:depends("family", "ipv4") diff --git a/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/zones.lua b/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/zones.lua index 694bbd872e..500e5078f4 100644 --- a/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/zones.lua +++ b/package/luci/applications/luci-app-firewall/luasrc/model/cbi/firewall/zones.lua @@ -19,7 +19,6 @@ s.addremove = false s:option(Flag, "syn_flood", translate("Enable SYN-flood protection")) o = s:option(Flag, "drop_invalid", translate("Drop invalid packets")) -o.default = o.enabled p = { s:option(ListValue, "input", translate("Input")), diff --git a/package/luci/applications/luci-app-firewall/po/ko/firewall.po b/package/luci/applications/luci-app-firewall/po/ko/firewall.po new file mode 100644 index 0000000000..f43fdc8826 --- /dev/null +++ b/package/luci/applications/luci-app-firewall/po/ko/firewall.po @@ -0,0 +1,505 @@ +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-03-30 17:00+0200\n" +"PO-Revision-Date: 2012-11-14 17:32+0200\n" +"Last-Translator: Weongyo Jeong \n" +"Language-Team: LANGUAGE \n" +"Language: ko\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Pootle 2.0.6\n" + +msgid "%s in %s" +msgstr "" + +msgid "%s%s with %s" +msgstr "%s%s ,%s" + +msgid "%s, %s in %s" +msgstr "" + +msgid "(Unnamed Entry)" +msgstr "" + +msgid "(Unnamed Rule)" +msgstr "" + +msgid "(Unnamed SNAT)" +msgstr "" + +msgid "%d pkts. per %s" +msgstr "" + +msgid "%d pkts. per %s, burst %d pkts." +msgstr "" + +msgid "%s and limit to %s" +msgstr "" + +msgid "Action" +msgstr "" + +msgid "Add" +msgstr "" + +msgid "Add and edit..." +msgstr "추가 후 수정..." + +msgid "Advanced Settings" +msgstr "" + +msgid "Allow forward from source zones:" +msgstr "Source zone 로부터의 forward 허용:" + +msgid "Allow forward to destination zones:" +msgstr "Destination zone 으로 forward 허용:" + +msgid "Any" +msgstr "" + +msgid "Covered networks" +msgstr "" + +msgid "Custom Rules" +msgstr "Custom Rule" + +msgid "" +"Custom rules allow you to execute arbritary iptables commands which are not " +"otherwise covered by the firewall framework. The commands are executed after " +"each firewall restart, right after the default ruleset has been loaded." +msgstr "" +"Custom rule 은 방화벽 UI 로 해결이 되지 않는 임의의 iptables 명령을 실행할 " +"수 있도록 합니다. 입력된 명령어들은 매 방화벽 재시작시 실행되는데 default " +"ruleset 이 load 된 후 시점입니다." + +msgid "Destination IP address" +msgstr "Destination IP 주소" + +msgid "Destination address" +msgstr "Destination 주소" + +msgid "Destination port" +msgstr "" + +msgid "Destination zone" +msgstr "" + +msgid "Do not rewrite" +msgstr "" + +msgid "Drop invalid packets" +msgstr "" + +msgid "Enable" +msgstr "활성화" + +msgid "Enable NAT Loopback" +msgstr "NAT Loopback 활성화" + +msgid "Enable SYN-flood protection" +msgstr "SYN-flood protection 활성화" + +msgid "Enable logging on this zone" +msgstr "zone 의 logging 활성화" + +msgid "External IP address" +msgstr "외부 IP 주소" + +msgid "External port" +msgstr "외부 port" + +msgid "External zone" +msgstr "외부 zone" + +msgid "Extra arguments" +msgstr "추가 argument" + +msgid "Firewall" +msgstr "방화벽" + +msgid "Firewall - Custom Rules" +msgstr "방화벽 - Custom Rules" + +msgid "Firewall - Port Forwards" +msgstr "방화벽 - Port Forwards" + +msgid "Firewall - Traffic Rules" +msgstr "방화벽 - Traffic Rules" + +msgid "Firewall - Zone Settings" +msgstr "방화벽 - Zone 설정" + +msgid "Force connection tracking" +msgstr "" + +msgid "Forward" +msgstr "" + +msgid "Forward to" +msgstr "" + +msgid "Friday" +msgstr "금요일" + +msgid "From %s in %s" +msgstr "" + +msgid "From %s in %s with source %s" +msgstr "" + +msgid "From %s in %s with source %s and %s" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "IPv4" +msgstr "" + +msgid "IPv4 and IPv6" +msgstr "" + +msgid "IPv4 only" +msgstr "" + +msgid "IPv6" +msgstr "" + +msgid "IPv6 only" +msgstr "" + +msgid "Input" +msgstr "" + +msgid "Inter-Zone Forwarding" +msgstr "" + +msgid "Internal IP address" +msgstr "내부 IP 주소" + +msgid "Internal port" +msgstr "내부 port" + +msgid "Internal zone" +msgstr "내부 zone" + +msgid "Limit log messages" +msgstr "" + +msgid "MSS clamping" +msgstr "" + +msgid "Masquerading" +msgstr "" + +msgid "Match" +msgstr "" + +msgid "Match ICMP type" +msgstr "" + +msgid "Match forwarded traffic to the given destination port or port range." +msgstr "" + +msgid "" +"Match incoming traffic directed at the given destination port or port range " +"on this host" +msgstr "" + +msgid "" +"Match incoming traffic originating from the given source port or port range " +"on the client host." +msgstr "" + +msgid "Monday" +msgstr "월요일" + +msgid "Month Days" +msgstr "" + +msgid "Name" +msgstr "이름" + +msgid "New SNAT rule" +msgstr "새로운 SNAT rule" + +msgid "New forward rule" +msgstr "새로운 forward rule" + +msgid "New input rule" +msgstr "새로운 input rule" + +msgid "New port forward" +msgstr "새로운 port forward" + +msgid "New source NAT" +msgstr "새로운 source NAT" + +msgid "Only match incoming traffic directed at the given IP address." +msgstr "" + +msgid "Only match incoming traffic from these MACs." +msgstr "" + +msgid "Only match incoming traffic from this IP or range." +msgstr "" + +msgid "" +"Only match incoming traffic originating from the given source port or port " +"range on the client host" +msgstr "" + +msgid "Open ports on router" +msgstr "" + +msgid "Other..." +msgstr "" + +msgid "Output" +msgstr "" + +msgid "Passes additional arguments to iptables. Use with care!" +msgstr "iptables 명령에 추가 인자들을 더합니다. 조심해 사용하세요!" + +msgid "Port Forwards" +msgstr "Port Forward" + +msgid "" +"Port forwarding allows remote computers on the Internet to connect to a " +"specific computer or service within the private LAN." +msgstr "" +"Port forwarding 기능은 인터넷 상의 원격 컴퓨터가 내부 LAN 에 속한 특정 컴퓨터" +"나 서비스에 접속할 수 있도록 합니다." + +msgid "Protocol" +msgstr "" + +msgid "" +"Redirect matched incoming traffic to the given port on the internal host" +msgstr "" + +msgid "Redirect matched incoming traffic to the specified internal host" +msgstr "" + +msgid "Restart Firewall" +msgstr "" + +msgid "Restrict Masquerading to given destination subnets" +msgstr "주어진 destination subnet 으로 Masquerading 제한" + +msgid "Restrict Masquerading to given source subnets" +msgstr "주어진 source subnet 으로 Masquerading 제한" + +msgid "Restrict to address family" +msgstr "Address family 제한" + +msgid "Rewrite matched traffic to the given address." +msgstr "" + +msgid "" +"Rewrite matched traffic to the given source port. May be left empty to only " +"rewrite the IP address." +msgstr "" + +msgid "Rewrite to source %s" +msgstr "" + +msgid "Rewrite to source %s, %s" +msgstr "" + +msgid "SNAT IP address" +msgstr "" + +msgid "SNAT port" +msgstr "" + +msgid "Saturday" +msgstr "토요일" + +msgid "Source IP address" +msgstr "Source IP 주소" + +msgid "Source MAC address" +msgstr "Source MAC 주소" + +msgid "Source NAT" +msgstr "" + +msgid "" +"Source NAT is a specific form of masquerading which allows fine grained " +"control over the source IP used for outgoing traffic, for example to map " +"multiple WAN addresses to internal subnets." +msgstr "" +"Source NAT 기능은 masquerading 의 한 형태로써 outgoing 트래픽이 사용할 " +"source IP 를 세밀하게 제어할 수 있습니다. 예를 들어 다수의 WAN 주소들을 내" +"부 subnet 에 매핑(mapping) 할 경우 사용됩니다." + +msgid "Source address" +msgstr "Source 주소" + +msgid "Source port" +msgstr "" + +msgid "Source zone" +msgstr "" + +msgid "Start Date (yyyy-mm-dd)" +msgstr "시작 날짜 (yyyy-mm-dd)" + +msgid "Start Time (hh:mm:ss)" +msgstr "시작 시간 (hh:mm:ss)" + +msgid "Stop Date (yyyy-mm-dd)" +msgstr "종료 날짜 (yyyy-mm-dd)" + +msgid "Stop Time (hh:mm:ss)" +msgstr "종료 시간 (hh:mm:ss)" + +msgid "Sunday" +msgstr "일요일" + +msgid "" +"The firewall creates zones over your network interfaces to control network " +"traffic flow." +msgstr "" +"방화벽 기능을 이용하여 네트워크 인터페이스와 연결된 zone 을 생성할 수 있고 이" +"를 이용하여 네트워크 traffic flow 를 제어할 수 있습니다." + +msgid "" +"The options below control the forwarding policies between this zone (%s) and " +"other zones. Destination zones cover forwarded traffic " +"originating from %q. Source zones match forwarded " +"traffic from other zones targeted at %q. The forwarding " +"rule is unidirectional, e.g. a forward from lan to wan does " +"not imply a permission to forward from wan to lan as well." +msgstr "" +"이 zone (%s) ê³¼ 다른 zone 들 사이의 forwarding 정책을 제어하는 옵션들입니다. " +"Destination zones 은 %q 에서 출발한 forward " +"traffic 을 뜻하고, Source zones 은 다른 zone 들에서 %q 로 전" +"달되는 forward traffic 을 뜻합니다. Forwarding rule 은 " +"unidirectional 인데, 예를 들어 LAN 에서 WAN 으로의 forward 규칙이 " +"WAN 에서 LAN 으로의 forward 를 허락하는 것이 아닙니다." + +msgid "" +"This page allows you to change advanced properties of the port forwarding " +"entry. In most cases there is no need to modify those settings." +msgstr "" +"이 메뉴에서는 port forwarding 의 고급 설정 정보를 변경할 수 있습니다. 대부분" +"의 경우 이 설정을 수정할 일이 없습니다." + +msgid "" +"This page allows you to change advanced properties of the traffic rule " +"entry, such as matched source and destination hosts." +msgstr "" +"이 메뉴에서는 traffic rule 항목의 고급 설정, 예를 들어 source host 와 " +"destination host 매칭, 을 변경할 수 있습니다." + +#, fuzzy +msgid "" +"This section defines common properties of %q. The input and " +"output options set the default policies for traffic entering and " +"leaving this zone while the forward option describes the policy for " +"forwarded traffic between different networks within the zone. Covered " +"networks specifies which available networks are members of this zone." +msgstr "" +"이 섹션은 %q 의 공통 속성을 설정할 수 있습니다. input ê³¼ " +"output 옵션은 이 zone 으로 전달되어 들오거나 나가는 트래픽에 대한 기" +"본 정책을 뜻합니다. forward 옵션은 zone 내에서 다른 네트워크들 사이" +"를 오가는 forward traffic 에 대한 정책을 뜻합니다. Covered networks " +"에서는 zone 의 영향을 받을 네트워크들을 지정할 수 있습니다." + +msgid "Thursday" +msgstr "목요일" + +msgid "Time in UTC" +msgstr "UTC 기준시" + +msgid "To %s at %s on this device" +msgstr "" + +msgid "To %s in %s" +msgstr "" + +msgid "To %s on this device" +msgstr "" + +msgid "To %s, %s in %s" +msgstr "" + +msgid "To source IP" +msgstr "" + +msgid "To source port" +msgstr "" + +msgid "Traffic Rules" +msgstr "Traffic Rule" + +msgid "" +"Traffic rules define policies for packets traveling between different zones, " +"for example to reject traffic between certain hosts or to open WAN ports on " +"the router." +msgstr "" +"Traffic rule 은 서로 다른 zone 사이를 오가는 패킷들에 대한 정책을 정의합니" +"다. 예를 들어 특정 host 들 사이의 트래픽을 차단하거나 공유기의 WAN port 를 " +"open 할때 사용됩니다." + +msgid "Tuesday" +msgstr "화요일" + +msgid "Via %s" +msgstr "" + +msgid "Via %s at %s" +msgstr "" + +msgid "Wednesday" +msgstr "수요일" + +msgid "Week Days" +msgstr "주일" + +msgid "" +"You may specify multiple by selecting \"-- custom --\" and then entering " +"protocols separated by space." +msgstr "" + +msgid "Zone %q" +msgstr "" + +msgid "Zone ⇒ Forwardings" +msgstr "" + +msgid "Zones" +msgstr "Zone 내역" + +msgid "accept" +msgstr "" + +msgid "any" +msgstr "" + +msgid "any host" +msgstr "" + +msgid "any router IP" +msgstr "" + +msgid "any zone" +msgstr "" + +msgid "don't track" +msgstr "" + +msgid "drop" +msgstr "" + +msgid "reject" +msgstr "" + +msgid "traffic" +msgstr "" diff --git a/package/luci/applications/luci-app-firewall/po/pt-br/firewall.po b/package/luci/applications/luci-app-firewall/po/pt-br/firewall.po index 2d601f8575..ab714b50b9 100644 --- a/package/luci/applications/luci-app-firewall/po/pt-br/firewall.po +++ b/package/luci/applications/luci-app-firewall/po/pt-br/firewall.po @@ -1,17 +1,17 @@ msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-03-30 17:00+0200\n" -"PO-Revision-Date: 2014-06-21 19:03+0200\n" -"Last-Translator: Éder \n" -"Language-Team: LANGUAGE \n" +"PO-Revision-Date: 2017-02-20 17:43-0300\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Pootle 2.0.6\n" +"X-Generator: Poedit 1.8.11\n" +"Language-Team: \n" msgid "%s in %s" msgstr "%s in %s" @@ -143,7 +143,7 @@ msgid "Forward to" msgstr "Encaminhar para" msgid "Friday" -msgstr "" +msgstr "Sexta-feira" msgid "From %s in %s" msgstr "Vindo de %s em %s" @@ -222,10 +222,10 @@ msgstr "" "equipamento cliente." msgid "Monday" -msgstr "" +msgstr "Segunda-Feira" msgid "Month Days" -msgstr "" +msgstr "Dias do mês" msgid "Name" msgstr "Nome" @@ -296,7 +296,7 @@ msgid "Redirect matched incoming traffic to the specified internal host" msgstr "Redireciona tráfego entrante para o computador interno especificado" msgid "Restart Firewall" -msgstr "" +msgstr "Reiniciar o Firewall" msgid "Restrict Masquerading to given destination subnets" msgstr "Restringe o mascaramento para uma subrede de destino específica" @@ -330,7 +330,7 @@ msgid "SNAT port" msgstr "Porta da SNAT" msgid "Saturday" -msgstr "" +msgstr "Sábado" msgid "Source IP address" msgstr "Endereço IP de origem" @@ -360,19 +360,19 @@ msgid "Source zone" msgstr "Zona de origem" msgid "Start Date (yyyy-mm-dd)" -msgstr "" +msgstr "Dia inicial (aaaa-mm-dd)" msgid "Start Time (hh:mm:ss)" -msgstr "" +msgstr "Hora inicial (hh:mm:ss)" msgid "Stop Date (yyyy-mm-dd)" -msgstr "" +msgstr "Dia final (aaaa-mm-dd)" msgid "Stop Time (hh:mm:ss)" -msgstr "" +msgstr "Hora final (hh:mm:ss)" msgid "Sunday" -msgstr "" +msgstr "Domingo" msgid "" "The firewall creates zones over your network interfaces to control network " @@ -411,7 +411,6 @@ msgstr "" "Esta página permite que você mude propriedades avançadas da entrada da regra " "de tráfego, como os equipamentos de origem e destino." -#, fuzzy msgid "" "This section defines common properties of %q. The input and " "output options set the default policies for traffic entering and " @@ -427,10 +426,10 @@ msgstr "" "zona." msgid "Thursday" -msgstr "" +msgstr "Quita-feira" msgid "Time in UTC" -msgstr "" +msgstr "Hora em UTC" msgid "To %s at %s on this device" msgstr "Para %s em %s neste dispositivo" @@ -463,7 +462,7 @@ msgstr "" "ou abrir portas WAN no roteador." msgid "Tuesday" -msgstr "" +msgstr "Terça-feira" msgid "Via %s" msgstr "Via %s" @@ -472,10 +471,10 @@ msgid "Via %s at %s" msgstr "Via %s at %s" msgid "Wednesday" -msgstr "" +msgstr "Quarta-feira" msgid "Week Days" -msgstr "" +msgstr "Dias da semana" msgid "" "You may specify multiple by selecting \"-- custom --\" and then entering " diff --git a/package/luci/applications/luci-app-fwknopd/po/pt-br/fwknopd.po b/package/luci/applications/luci-app-fwknopd/po/pt-br/fwknopd.po new file mode 100644 index 0000000000..286b49db31 --- /dev/null +++ b/package/luci/applications/luci-app-fwknopd/po/pt-br/fwknopd.po @@ -0,0 +1,116 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: pt_BR\n" + +msgid "" +"Allow SPA clients to request access to services through an iptables firewall " +"instead of just to it." +msgstr "" +"Permitir que clientes SPA requeiram acesso a serviços através de um firewall " +"iptables ao invés de apenas fazê-lo." + +msgid "Allow SPA clients to request forwarding destination by DNS name." +msgstr "" +"Permitir que clientes SPA requeiram encaminhamento de destinos por nome DNS." + +msgid "Base 64 key" +msgstr "Chave em formato base64" + +msgid "" +"Define a set of ports and protocols (tcp or udp) that will be opened if a " +"valid knock sequence is seen. If this entry is not set, fwknopd will attempt " +"to honor any proto/port request specified in the SPA data (unless of it " +"matches any “RESTRICT_PORTS” entries). Multiple entries are comma-separated." +msgstr "" +"Define um conjunto de porta e protocolos (TCP ou UDP) que serão abertos se " +"uma sequência de batidas for observada. Se esta entrada não estiver " +"definida, fwknopd irá tentar honrar qualquer requisição de protocolo/porta " +"especificada nos dados SPA (a não ser se casar com qualquer entrada de " +"\"RESTRICT_PORTS\"). Múltiplas entradas serão separadas por vírgula." + +msgid "" +"Define the length of time access will be granted by fwknopd through the " +"firewall after a valid knock sequence from a source IP address. If " +"“FW_ACCESS_TIMEOUT” is not set then the default timeout of 30 seconds will " +"automatically be set." +msgstr "" +"Define a duração do tempo de acesso que será concedido pelo fwknopd através " +"do firewall depois de uma sequência de batidas válida de um endereço IP. Se " +"“FW_ACCESS_TIMEOUT” não estiver definido, o valor padrão será de 30 " +"segundos. " + +msgid "" +"Define the symmetric key used for decrypting an incoming SPA packet that is " +"encrypted by the fwknop client with Rijndael." +msgstr "" +"Define a chave simétrica usada para decifrar um pacote SPA entrante que foi " +"cifrado pelo cliente fwknop com o algoritmo Rijndael." + +msgid "Enable Uci/Luci control" +msgstr "Habilitar o controle UCI/Luci" + +msgid "Enable config overwrite" +msgstr "Habilitar a sobrescrita da configuração" + +msgid "Firewall Knock Daemon" +msgstr "Servidor do Firwall Knock" + +msgid "Firewall Knock Operator" +msgstr "Operador do Firewall Knock" + +msgid "" +"Force all SPA packets to contain a real IP address within the encrypted " +"data. This makes it impossible to use the -s command line argument on the " +"fwknop client command line, so either -R has to be used to automatically " +"resolve the external address (if the client behind a NAT) or the client must " +"know the external IP and set it via the -a argument." +msgstr "" +"Forçar que todos os pacotes SPA contenham um endereço IP real dentro do " +"pacote cifrado. Isto torna impossível o uso do argumento de linha de comando " +"'-s' no cliente fwknop. Desta forma, ou o argumento '-R' deve ser usada para " +"resolver os endereços externos automaticamente (se o cliente estiver atrás " +"de uma NAT) ou o ciente deve conhecer o seu endereço IP externo e defini-lo " +"através do argumento '-a'." + +msgid "" +"Maximum age in seconds that an SPA packet will be accepted. defaults to 120 " +"seconds" +msgstr "" +"Idade máxima, em segundos, que um pacote SPA será aceito. Padrão é 120 " +"segundos." + +msgid "Normal Key" +msgstr "Chave Normal" + +msgid "Specify the ethernet interface on which fwknopd will sniff packets." +msgstr "" +"Especifica o dispositivo ethernet no qual o fwknopd irá observar os pacotes." + +msgid "The base64 hmac key" +msgstr "A chave de autenticação HMAC em formato base64" + +msgid "Use ANY for any source ip" +msgstr "Use \"ANY\" para qualquer endereço IP de origem" + +msgid "" +"When unchecked, the config files in /etc/fwknopd will be used as is, " +"ignoring any settings here." +msgstr "" +"Quando desmarcado, os arquivos de configuração em /etc/fwknopd serão usados " +"como estão, ignorando qualquer ajustes feitos aqui." + +msgid "access.conf stanzas" +msgstr "Estâncias do access.conf" + +msgid "fwknopd.conf config options" +msgstr "Opções do fwknopd.conf" diff --git a/package/luci/applications/luci-app-meshwizard/po/pt-br/meshwizard.po b/package/luci/applications/luci-app-meshwizard/po/pt-br/meshwizard.po index a2238e52e8..9421e02531 100644 --- a/package/luci/applications/luci-app-meshwizard/po/pt-br/meshwizard.po +++ b/package/luci/applications/luci-app-meshwizard/po/pt-br/meshwizard.po @@ -1,17 +1,17 @@ msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-10-11 00:23+0200\n" -"PO-Revision-Date: 2014-03-17 10:01+0200\n" -"Last-Translator: Luiz Angelo \n" -"Language-Team: LANGUAGE \n" +"PO-Revision-Date: 2017-02-20 18:00-0300\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Pootle 2.0.6\n" +"X-Generator: Poedit 1.8.11\n" +"Language-Team: \n" msgid "Activate or deactivate IPv6 config globally." msgstr "Habilita e desabilita a configuração IPv6 globalmente." @@ -70,7 +70,6 @@ msgstr "Endereço IPv6 da rede em malha" msgid "Mesh Wizard" msgstr "Assistente de Configuração da Rede em Malha" -#, fuzzy msgid "" "Note: this will set up this interface for mesh operation, i.e. add it to " "zone 'freifunk' and enable olsr." diff --git a/package/luci/applications/luci-app-mjpg-streamer/po/pt-br/mjpg-streamer.po b/package/luci/applications/luci-app-mjpg-streamer/po/pt-br/mjpg-streamer.po new file mode 100644 index 0000000000..28bfa186b0 --- /dev/null +++ b/package/luci/applications/luci-app-mjpg-streamer/po/pt-br/mjpg-streamer.po @@ -0,0 +1,172 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: pt_BR\n" + +msgid "Allow ringbuffer to exceed limit by this amount" +msgstr "Permitir que o buffer em anel exceda o limite por essa quantidade" + +msgid "Ask for username and password on connect" +msgstr "Pergunte por um usuário e senha na conexão" + +msgid "Authentication required" +msgstr "Requer autenticação" + +msgid "Auto" +msgstr "Automático" + +msgid "Automatic disabling of MJPEG mode" +msgstr "Desativação automática do modo MJPEG" + +msgid "Blink" +msgstr "Pisca" + +msgid "Check to save the stream to an mjpeg file" +msgstr "Marque para salvar o fluxo em um arquivo MJPEG" + +msgid "Command to run" +msgstr "Comando para executar:" + +msgid "Device" +msgstr "Dispositivo" + +msgid "Do not initalize dynctrls of Linux-UVC driver" +msgstr "Não inicie o dynctrls do driver do Linux-UVC" + +msgid "Don't initalize dynctrls" +msgstr "Não inicia o dynctrls" + +msgid "Drop frames smaller then this limit" +msgstr "Descarte quadros menores que este limite" + +msgid "Enable MJPG-streamer" +msgstr "Ativa o MJPG-streamer" + +msgid "Enable YUYV format" +msgstr "Ativar Formato YUYV" + +msgid "Enabled" +msgstr "Habilitado" + +msgid "Exceed" +msgstr "Ultrapassado" + +msgid "" +"Execute command after saving picture. Mjpg-streamer parse the filename as " +"first parameter to your script." +msgstr "" +"Execute o comando depois de salvar a imagem. Mjpg-streamer passa o nome do " +"arquivo como primeiro parâmetro para o comando." + +msgid "File input" +msgstr "Entrada do arquivo" + +msgid "File output" +msgstr "Saída do arquivo" + +msgid "Folder" +msgstr "Pasta" + +msgid "Folder that contains webpages" +msgstr "Pasta que contém páginas web" + +msgid "Frames per second" +msgstr "Quadros por segundos" + +msgid "General" +msgstr "Geral" + +msgid "HTTP output" +msgstr "Saída HTTP" + +msgid "Input plugin" +msgstr "Plugins de entrada" + +msgid "Interval between saving pictures" +msgstr "Intervalo entre o salvamento das imagens" + +msgid "JPEG compression quality" +msgstr "Qualidade da compressão JPEG" + +msgid "Led control" +msgstr "Controle de LED" + +msgid "MJPG-streamer" +msgstr "MJPG-streamer" + +msgid "Max. number of pictures to hold" +msgstr "Número máximo de imagens a serem mantidas" + +msgid "Mjpeg output" +msgstr "Saída Mjpeg" + +msgid "Off" +msgstr "Desligado" + +msgid "On" +msgstr "Ligado" + +msgid "Output plugin" +msgstr "Plugin de saída" + +msgid "Password" +msgstr "Senha" + +msgid "Plugin settings" +msgstr "Configurações do Plugin" + +msgid "Port" +msgstr "Porta" + +msgid "Resolution" +msgstr "Resolução" + +msgid "Ring buffer size" +msgstr "Tamanho do buffer em anel" + +msgid "Set folder to save pictures" +msgstr "Definir pasta para salvas as imagens" + +msgid "Set the inteval in millisecond" +msgstr "Defina o intervalo em milisegundos" + +msgid "" +"Set the minimum size if the webcam produces small-sized garbage frames. May " +"happen under low light conditions" +msgstr "" +"Defina o tamanho mínimo se a webcam produz quadros lixo de tamanho pequeno. " +"Pode acontecer sob condições de pouca luz" + +msgid "" +"Set the quality in percent. This setting activates YUYV format, disables " +"MJPEG" +msgstr "" +"Defina a qualidade em porcentagem. Esta definição ativa o formato YUYV, " +"desativa MJPEG" + +msgid "TCP port for this HTTP server" +msgstr "Porta TCP para este servidor HTTP" + +msgid "UVC input" +msgstr "Dispositivo UVC de entrada" + +msgid "Username" +msgstr "Usuário" + +msgid "WWW folder" +msgstr "Pasta WWW" + +msgid "" +"mjpg streamer is a streaming application for Linux-UVC compatible webcams" +msgstr "" +"Mjpg streamer é uma aplicação de streaming para webcams compatíveis com o " +"Linux-UVC" diff --git a/package/luci/applications/luci-app-olsr/po/pt-br/olsr.po b/package/luci/applications/luci-app-olsr/po/pt-br/olsr.po index 1461c1dd8b..499176c16b 100644 --- a/package/luci/applications/luci-app-olsr/po/pt-br/olsr.po +++ b/package/luci/applications/luci-app-olsr/po/pt-br/olsr.po @@ -1,17 +1,17 @@ msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-06-10 03:41+0200\n" -"PO-Revision-Date: 2014-06-21 19:36+0200\n" -"Last-Translator: Éder \n" -"Language-Team: LANGUAGE \n" +"PO-Revision-Date: 2017-02-20 18:01-0300\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Pootle 2.0.6\n" +"X-Generator: Poedit 1.8.11\n" +"Language-Team: \n" msgid "Active MID announcements" msgstr "" @@ -59,7 +59,6 @@ msgstr "" "Somente pode ser um endereço IPv4 ou IPv6 válidos ou um endereço 'padrão'" # 20140621: edersg: tradução -#, fuzzy msgid "Can only be a valid IPv6 address or 'default'" msgstr "" "Somente pode ser um endereço IPv4 ou IPv6 válidos ou um endereço 'padrão'" @@ -173,7 +172,6 @@ msgstr "" "Validade do HNA" -#, fuzzy msgid "HNA6 Announcements" msgstr "" "Anúncios do reduzir LQ para todos os nós nesta interface em 20%: padrão 0.8" # 20140621: edersg: tradução -#, fuzzy msgid "" "Multiply routes with the factor given here. Allowed values are between 0.01 " "and 1.0. It is only used when LQ-Level is greater than 0. Examples:
HNA
" -#, fuzzy msgid "OLSR - HNA6-Announcements" msgstr "" "OLSR - Anúncios HNA " "local de 0.0.0.0/0, ::ffff:0:0/96 ou 2000::/3. O padrão é \"ambos\"." -#, fuzzy msgid "" "Which kind of uplink is exported to the other mesh nodes. An uplink is " "detected by looking for a local HNA6 ::ffff:0:0/96 or 2000::/3. Default " diff --git a/package/luci/applications/luci-app-openvpn/po/pt-br/openvpn.po b/package/luci/applications/luci-app-openvpn/po/pt-br/openvpn.po index 916370e7f9..84b0540581 100644 --- a/package/luci/applications/luci-app-openvpn/po/pt-br/openvpn.po +++ b/package/luci/applications/luci-app-openvpn/po/pt-br/openvpn.po @@ -1,17 +1,17 @@ msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-06-10 03:41+0200\n" -"PO-Revision-Date: 2014-03-29 23:19+0200\n" -"Last-Translator: Luiz Angelo \n" -"Language-Team: LANGUAGE \n" +"PO-Revision-Date: 2017-02-20 18:04-0300\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Pootle 2.0.6\n" +"X-Generator: Poedit 1.8.11\n" +"Language-Team: \n" msgid "%s" msgstr "%s" @@ -154,7 +154,7 @@ msgid "Don't log timestamps" msgstr "Não registar a data/hora" msgid "Don't pull routes automatically" -msgstr "" +msgstr "Não puxe as rotas automaticamente" msgid "Don't re-read key on restart" msgstr "Não reler a chave entre os reinícios" @@ -505,13 +505,13 @@ msgid "Temporary directory for client-connect return file" msgstr "Diretório temporário para arquivo de retorno de conexão-cliente" msgid "The highest supported TLS version" -msgstr "" +msgstr "A mais alta versão suporta do TLS" msgid "The key direction for 'tls-auth' and 'secret' options" -msgstr "" +msgstr "A direção da chave para as opções 'tls-auth' e 'secret'" msgid "The lowest supported TLS version" -msgstr "" +msgstr "A mais baixa versão suporta do TLS" msgid "Timeframe for key exchange" msgstr "Janela temporal para troca de chaves" diff --git a/package/luci/applications/luci-app-privoxy/po/pt-br/privoxy.po b/package/luci/applications/luci-app-privoxy/po/pt-br/privoxy.po new file mode 100644 index 0000000000..8d3eee20d5 --- /dev/null +++ b/package/luci/applications/luci-app-privoxy/po/pt-br/privoxy.po @@ -0,0 +1,516 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: pt_BR\n" + +msgid "" +"A URL to be displayed in the error page that users will see if access to an " +"untrusted page is denied." +msgstr "" +"A URL a ser exibida na página de erro que os usuários verão se o acesso a " +"uma página não confiável é negado." + +msgid "" +"A URL to documentation about the local Privoxy setup, configuration or " +"policies." +msgstr "" +"A URL para a documentação sobre o Privoxy local, configuração ou políticas." + +msgid "A directory where Privoxy can create temporary files." +msgstr "Um diretório onde Privoxy pode criar arquivos temporários." + +msgid "Access Control" +msgstr "Controle de Acesso" + +msgid "Actions that are applied to all sites and maybe overruled later on." +msgstr "" +"Ações que são aplicadas a todos as páginas e talvez descartado mais tarde." + +msgid "An alternative directory where the templates are loaded from." +msgstr "Um diretório alternativo de onde os modelos são carregados." + +msgid "An email address to reach the Privoxy administrator." +msgstr "Um endereço de e-mail para alcançar o administrador do Privoxy." + +msgid "" +"Assumed server-side keep-alive timeout (in seconds) if not specified by the " +"server." +msgstr "" +"Tempo limite, em segundos, da manutenção da conexão (keep-alive) do servidor " +"se não for especificado." + +msgid "Boot delay" +msgstr "Atraso de iniciação" + +msgid "CGI user interface" +msgstr "Interface de usuário CGI" + +msgid "Common Log Format" +msgstr "Formato de registros (log) comum" + +msgid "" +"Configure here the routing of HTTP requests through a chain of multiple " +"proxies. Note that parent proxies can severely decrease your privacy level. " +"Also specified here are SOCKS proxies." +msgstr "" +"Configure aqui o encaminhamento de pedidos HTTP através de uma cadeia de " +"múltiplos proxies. Note-se que proxies pai pode diminuir muito o nível de " +"privacidade. Também serão aceitos proxies SOCKS." + +msgid "Debug GIF de-animation" +msgstr "Depurar de-animação GIF" + +msgid "Debug force feature" +msgstr "Recurso de depuração forçado" + +msgid "Debug redirects" +msgstr "Redirecionamentos de depuração" + +msgid "Debug regular expression filters" +msgstr "Depuração de filtros de expressão regular" + +msgid "Delay (in seconds) during system boot before Privoxy start" +msgstr "" +"Atraso (em segundos) durante a inicialização do sistema antes do Privoxy " +"iniciar" + +msgid "Directory does not exist!" +msgstr "O diretório não existe!" + +msgid "Disabled == Transparent Proxy Mode" +msgstr "Desativado == Modo Proxy Transparente" + +msgid "Documentation" +msgstr "Documentação" + +msgid "During delay ifup-events are not monitored !" +msgstr "Durante a espera, eventos ifup não serão monitorados!" + +msgid "Enable proxy authentication forwarding" +msgstr "Habilitar o encaminhamento de autenticação de proxy" + +msgid "" +"Enable/Disable autostart of Privoxy on system startup and interface events" +msgstr "" +"Ativar/Desativar a iniciação automática do Privoxy junto com a iniciação do " +"sistema ou eventos de interface" + +msgid "Enable/Disable filtering when Privoxy starts." +msgstr "Ativar / Desativar filtragem quando Privoxy iniciar." + +msgid "Enabled" +msgstr "Habilitado" + +msgid "" +"Enabling this option is NOT recommended if there is no parent proxy that " +"requires authentication!" +msgstr "" +"A ativação dessa opção não é recomendado se não houver nenhum proxy pai que " +"requer autenticação!" + +msgid "File '%s' not found inside Configuration Directory" +msgstr "O arquivo '%s' não foi encontrado dentro do Diretório de Configuração" + +msgid "File not found or empty" +msgstr "Arquivo não encontrado ou vazio" + +msgid "Files and Directories" +msgstr "Arquivos e diretórios" + +msgid "For help use link at the relevant option" +msgstr "Para ajuda, use o link na respectiva opção" + +msgid "Forwarding" +msgstr "Encaminhando" + +msgid "" +"If enabled, Privoxy hides the 'go there anyway' link. The user obviously " +"should not be able to bypass any blocks." +msgstr "" +"Se ativado, Privoxy esconde o link \"ir lá de qualquer maneira\". O usuário, " +"obviamente, não deve ser capaz de contornar qualquer bloqueio." + +msgid "" +"If you intend to operate Privoxy for more users than just yourself, it might " +"be a good idea to let them know how to reach you, what you block and why you " +"do that, your policies, etc." +msgstr "" +"Se você pretende operar Privoxy para mais usuários do que apenas a si mesmo, " +"pode ser uma boa ideia para que eles saibam como falar com você, o que você " +"bloquear e por que você faz isso, as suas políticas, etc." + +msgid "Invalid email address" +msgstr "Endereço de e-mail inválido" + +msgid "It is NOT recommended for the casual user." +msgstr "Não é recomendado para o usuário casual." + +msgid "Location of the Privoxy User Manual." +msgstr "Localização do Manual do Usuário do Privoxy." + +msgid "Log File Viewer" +msgstr "Visualizador de arquivo de registros (log)" + +msgid "Log all data read from the network" +msgstr "Registrar todos os dados lidos da rede" + +msgid "Log all data written to the network" +msgstr "Registrar todos os dados gravados na rede" + +msgid "Log the applying actions" +msgstr "Registrar as ações aplicadas" + +msgid "" +"Log the destination for each request Privoxy let through. See also 'Debug " +"1024'." +msgstr "" +"Registrar o destino para cada pedido que o Privoxy deixou passar. Consulte " +"também 'Debug 1024'." + +msgid "" +"Log the destination for requests Privoxy didn't let through, and the reason " +"why." +msgstr "" +"Registrar o destino para os pedidos que o Privoxy não deixou passar, e a " +"razão pela qual." + +msgid "Logging" +msgstr "Registrando (logging)" + +msgid "Main actions file" +msgstr "Arquivo principal de ações" + +msgid "Mandatory Input: No Data given!" +msgstr "Entrada obrigatória: Dados não foram informados!" + +msgid "Mandatory Input: No Directory given!" +msgstr "Entrada obrigatória: Nenhum Diretório foi informado!" + +msgid "Mandatory Input: No File given!" +msgstr "Entrada obrigatória: Nenhum Arquivo foi informado!" + +msgid "Mandatory Input: No Port given!" +msgstr "Entrada obrigatória: Nenhuma Porta foi informado!" + +msgid "Mandatory Input: No files given!" +msgstr "Entrada obrigatória: Nenhum Arquivo foi informado!" + +msgid "Mandatory Input: No valid IPv4 address or host given!" +msgstr "" +"Entrada obrigatória: Nenhum endereço IPv4 ou nome de equipamento válido foi " +"fornecido!" + +msgid "Mandatory Input: No valid IPv6 address given!" +msgstr "Entrada obrigatória: Nenhum endereço IPv6 válido foi informado!" + +msgid "Mandatory Input: No valid Port given!" +msgstr "Entrada obrigatória: Nenhuma porta válida foi informada!" + +msgid "Maximum number of client connections that will be served." +msgstr "O número máximo de conexões de cliente que será aceito." + +msgid "Maximum size (in KB) of the buffer for content filtering." +msgstr "Tamanho máximo (em KB) do buffer para filtragem de conteúdo." + +msgid "Miscellaneous" +msgstr "Diversos" + +msgid "NOT installed" +msgstr "NÃO instalado" + +msgid "No trailing '/', please." +msgstr "Sem '/' final, por favor." + +msgid "Non-fatal errors - *we highly recommended enabling this*" +msgstr "Erros não fatais - *é altamente recomendado ativar isto*" + +msgid "" +"Number of seconds after which a socket times out if no data is received." +msgstr "" +"Número de segundos após o qual uma conexão expira se nenhum dado for " +"recebido." + +msgid "" +"Number of seconds after which an open connection will no longer be reused." +msgstr "" +"Número de segundos após o qual uma conexão aberta deixará de ser reutilizada." + +msgid "" +"Only when using 'external filters', Privoxy has to create temporary files." +msgstr "" +"Somente quando for usado os \"filtros externos\". O Privoxy tem que criar " +"arquivos temporários." + +msgid "Please install current version !" +msgstr "Por favor, instale a versão atual!" + +msgid "Please press [Read] button" +msgstr "Por favor, pressione o botão [Ler]" + +msgid "Please read Privoxy manual for details!" +msgstr "Por favor, leia o manual do Privoxy para mais detalhes!" + +msgid "Please update to the current version!" +msgstr "Por favor, atualize para a versão atual!" + +msgid "Privoxy WEB proxy" +msgstr "Privoxy Web Proxy" + +msgid "" +"Privoxy can (and normally does) use a number of other files for additional " +"configuration, help and logging. This section of the configuration file " +"tells Privoxy where to find those other files." +msgstr "" +"Privoxy pode (e normalmente o faz) utilizar uma série de outros arquivos de " +"configuração, ajuda e de registros. Esta seção do arquivo de configuração " +"informa o Privoxy onde encontrar os outros arquivos." + +msgid "" +"Privoxy is a non-caching web proxy with advanced filtering capabilities for " +"enhancing privacy, modifying web page data and HTTP headers, controlling " +"access, and removing ads and other obnoxious Internet junk." +msgstr "" +"Privoxy é um proxy web sem cache com capacidades avançadas de filtragem para " +"aumentar a privacidade, modificar dados de páginas web e cabeçalhos HTTP, " +"controlar o acesso e remover anúncios e outras porcarias detestável da " +"Internet." + +msgid "Read / Reread log file" +msgstr "Ler / Ler novamente o arquivo de registros (log)" + +msgid "Show I/O status" +msgstr "Mostrar status de Entrada/Saída" + +msgid "Show each connection status" +msgstr "Mostrar cada estado de conexão" + +msgid "Show header parsing" +msgstr "Mostrar análise do cabeçalho" + +msgid "Software package '%s' is not installed." +msgstr "O pacote de software '%s' não está instalado." + +msgid "Software package '%s' is outdated." +msgstr "O pacote '%' está desatualizado." + +msgid "Start" +msgstr "Iniciar" + +msgid "Start / Stop" +msgstr "Iniciar / Parar" + +msgid "Start/Stop Privoxy WEB Proxy" +msgstr "Inicia / Para o Privoxy Web Proxy" + +msgid "Startup banner and warnings." +msgstr "Mensagens e avisos iniciais." + +msgid "Syntax:" +msgstr "Sintaxe:" + +msgid "Syntax: Client header names delimited by spaces." +msgstr "Sintaxe: nomes de cabeçalho do cliente delimitados por espaços." + +msgid "Syntax: target_pattern http_parent[:port]" +msgstr "Sintaxe: padrão_alvo http_superior[:porta]" + +msgid "Syntax: target_pattern socks_proxy[:port] http_parent[:port]" +msgstr "Sintaxe: padrão_alvo proxy_socks[:porta] http_superior[:porta]" + +msgid "System" +msgstr "Sistema" + +msgid "" +"The actions file(s) to use. Multiple actionsfile lines are permitted, and " +"are in fact recommended!" +msgstr "" +"O(s) arquivo(s) ações a ser usado. Várias linhas no arquivo são permitidas, " +"e são, de fato, recomendadas!" + +msgid "" +"The address and TCP port on which Privoxy will listen for client requests." +msgstr "" +"O endereço e porta TCP em que Privoxy vai esperar por pedidos dos clientes." + +msgid "" +"The compression level that is passed to the zlib library when compressing " +"buffered content." +msgstr "" +"O nível de compressão que é passada para a biblioteca zlib ao comprimir o " +"conteúdo em buffer." + +msgid "" +"The directory where all logging takes place (i.e. where the logfile is " +"located)." +msgstr "" +"O diretório onde todos os registros ocorrem (ex: onde o arquivo de log está " +"localizado)." + +msgid "The directory where the other configuration files are located." +msgstr "O diretório onde os outros arquivos de configuração estão localizados." + +msgid "" +"The filter files contain content modification rules that use regular " +"expressions." +msgstr "" +"Os arquivos de filtro contêm regras de modificação de conteúdo que usam " +"expressões regulares." + +msgid "The hostname shown on the CGI pages." +msgstr "O nome da máquina mostrado nas páginas de CGI." + +msgid "The log file to use. File name, relative to log directory." +msgstr "" +"O arquivo de registros a ser usado. O nome do arquivo, relativo ao diretório " +"de log." + +msgid "The order in which client headers are sorted before forwarding them." +msgstr "" +"A ordem em que os cabeçalhos dos clientes são classificados antes de " +"encaminhá-los." + +msgid "" +"The status code Privoxy returns for pages blocked with +handle-as-empty-" +"document." +msgstr "" +"O código de status Privoxy retorna para páginas bloqueadas com +handle-as-" +"empty-document." + +msgid "" +"The trust mechanism is an experimental feature for building white-lists and " +"should be used with care." +msgstr "" +"O mecanismo de confiança é um recurso experimental para a construção de " +"listas de destinos confiáveis e deve ser usado com cuidado." + +msgid "" +"The value of this option only matters if the experimental trust mechanism " +"has been activated." +msgstr "" +"O valor desta opção só importa se o mecanismo de confiança experimental foi " +"ativado." + +msgid "" +"This option is only there for debugging purposes. It will drastically reduce " +"performance." +msgstr "" +"Esta opção só está lá para fins de depuração. Ele irá reduzir drasticamente " +"o desempenho." + +msgid "" +"This option will be removed in future releases as it has been obsoleted by " +"the more general header taggers." +msgstr "" +"Esta opção será removida em versões futuras, uma vez que ficou obsoleta " +"pelos marcadores de cabeçalho mais genéricos." + +msgid "" +"This tab controls the security-relevant aspects of Privoxy's configuration." +msgstr "" +"Esta guia controla os aspectos da configuração do Privoxy relevantes para a " +"segurança." + +msgid "" +"Through which SOCKS proxy (and optionally to which parent HTTP proxy) " +"specific requests should be routed." +msgstr "" +"Através de qual Proxy SOCKS (e, opcionalmente, para o qual proxy HTTP " +"superior) pedidos específicos devem ser encaminhados." + +msgid "To which parent HTTP proxy specific requests should be routed." +msgstr "" +"Para qual proxy HTTP superior os pedidos específicos devem ser encaminhados." + +msgid "User customizations" +msgstr "Personalizações do usuário" + +msgid "Value is not a number" +msgstr "O valor não é um número" + +msgid "Value not between 0 and 300" +msgstr "Valor não está entre 0 e 300" + +msgid "Value not between 0 and 9" +msgstr "Valor não está entre 0 e 9" + +msgid "Value not between 1 and 4096" +msgstr "Valor não entre 1 e 4096" + +msgid "Value not greater 0 or empty" +msgstr "Valor não é maior que 0 ou vazio" + +msgid "Value range 1 to 4096, no entry defaults to 4096" +msgstr "Faixa do valor de 1 até 4096. Se vazio, será 4096" + +msgid "Version" +msgstr "Versão" + +msgid "Version Information" +msgstr "Informação da Versão" + +msgid "Whether intercepted requests should be treated as valid." +msgstr "Se as solicitações interceptados deve ser tratadas como válidas." + +msgid "" +"Whether or not Privoxy recognizes special HTTP headers to change toggle " +"state." +msgstr "" +"Se o Privoxy deve reconhecer cabeçalhos HTTP especiais para mudar de " +"alternância do estado." + +msgid "Whether or not buffered content is compressed before delivery." +msgstr "Se o conteúdo em buffer é comprimido antes da entrega." + +msgid "" +"Whether or not outgoing connections that have been kept alive should be " +"shared between different incoming connections." +msgstr "" +"Se as conexões de saída que foram mantidas vivas devem ser compartilhadas " +"entre diferentes conexões de entrada." + +msgid "Whether or not pipelined requests should be served." +msgstr "Se os pedidos de pipeline deve ser aceitos." + +msgid "Whether or not proxy authentication through Privoxy should work." +msgstr "Se a autenticação de proxy através do Privoxy deve funcionar." + +msgid "Whether or not the web-based actions file editor may be used." +msgstr "Se o editor de arquivos de ações baseadas na web deve ser utilizado." + +msgid "Whether or not the web-based toggle feature may be used." +msgstr "Se deve ser usado o recurso de alternância baseado na web." + +msgid "Whether requests to Privoxy's CGI pages can be blocked or redirected." +msgstr "" +"Se as solicitações para páginas CGI do Privoxy podem ser bloqueadas ou " +"redirecionadas." + +msgid "" +"Whether the CGI interface should stay compatible with broken HTTP clients." +msgstr "" +"Se a interface CGI deve se manter compatível com clientes HTTP mal " +"implementados." + +msgid "Whether to run only one server thread." +msgstr "Se deseja executar o servidor como apenas uma thread." + +msgid "Who can access what." +msgstr "Quem pode acessar o quê." + +msgid "installed" +msgstr "instalado" + +msgid "or higher" +msgstr "ou maior" + +msgid "required" +msgstr "necessário" diff --git a/package/luci/applications/luci-app-radicale/po/pt-br/radicale.po b/package/luci/applications/luci-app-radicale/po/pt-br/radicale.po new file mode 100644 index 0000000000..67bf586908 --- /dev/null +++ b/package/luci/applications/luci-app-radicale/po/pt-br/radicale.po @@ -0,0 +1,432 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: pt_BR\n" + +msgid "" +"'AUTO' selects the highest protocol version that client and server support." +msgstr "'AUTO' seleciona a versão mais alto protocolo que o cliente e o servidor suportar." + +msgid "" +"'Hostname:Port' or 'IPv4:Port' or '[IPv6]:Port' Radicale should listen on" +msgstr "'NomeDoEquipamento:porta' ou 'IPv4:Porta' ou '[IPv6]:Porta' em que o Radicale deve escutar" + +msgid "AUTO" +msgstr "AUTO" + +msgid "Access-Control-Allow-Headers" +msgstr "Access-Control-Allow-Headers" + +msgid "Access-Control-Allow-Methods" +msgstr "Access-Control-Allow-Methods" + +msgid "Access-Control-Allow-Origin" +msgstr "Access-Control-Allow-Origin" + +msgid "Access-Control-Expose-Headers" +msgstr "Access-Control-Expose-Headers" + +msgid "Additional HTTP headers" +msgstr "Additional HTTP headers" + +msgid "Address:Port" +msgstr "Endereço: Porta" + +#, fuzzy +msgid "Authentication" +msgstr "Autenticação" + +msgid "" +"Authentication login is matched against the 'user' key, and collection's " +"path is matched against the 'collection' key." +msgstr "O nome do usuário na autenticação é comparado com a chave do 'user', e o caminho da coleção é comparado com a chave 'coleção'." + +msgid "Authentication method" +msgstr "Método de autenticação" + +msgid "Authentication method to allow access to Radicale server." +msgstr "Método de autenticação para permitir o acesso ao servidor Radicale." + +msgid "Auto-start" +msgstr "Iniciar automaticamente" + +msgid "Boot delay" +msgstr "Atraso na iniciação" + +msgid "CalDAV/CardDAV" +msgstr "CalDAV/CardDAV" + +msgid "" +"Calendars and address books are available for both local and remote access, " +"possibly limited through authentication policies." +msgstr "Agendas e contados estão disponíveis tanto para acesso local como remoto, possivelmente limitado através das políticas de autenticação." + +msgid "Certificate file" +msgstr "Arquivo do certificado" + +msgid "" +"Change here the encoding Radicale will use instead of 'UTF-8' for responses " +"to the client and/or to store data inside collections." +msgstr "Mude aqui a codificação que o Radicale usará em vez de 'UTF-8' para respostas a clientes ou para armazenar dados dentro das coleções." + +msgid "Ciphers" +msgstr "Cifras" + +msgid "Console Log level" +msgstr "Nível de detalhamento dos registros (log)" + +msgid "Control the access to data collections." +msgstr "Controlar o acesso às coleções de dados." + +#, fuzzy +msgid "Critical" +msgstr "Crítico" + +msgid "" +"Cross-origin resource sharing (CORS) is a mechanism that allows restricted " +"resources (e.g. fonts, JavaScript, etc.) on a web page to be requested from " +"another domain outside the domain from which the resource originated." +msgstr "O compartilhamento de recursos de origem cruzada (CORS) é um mecanismo que permite que os recursos de acesso restrito (por exemplo, fontes, JavaScript, etc.) em uma página web ser solicitado de outro domínio fora do domínio a partir do qual o recurso foi originado." + +msgid "Custom" +msgstr "Personalizadas" + +msgid "Database" +msgstr "Banco de Dados" + +#, fuzzy +msgid "Debug" +msgstr "Depuração" + +msgid "Delay (in seconds) during system boot before Radicale start" +msgstr "Atraso (em segundos) durante a inicialização do sistema antes do Radicale iniciar" + +#, fuzzy +msgid "Directory" +msgstr "Diretório" + +msgid "Directory not exists/found !" +msgstr "O diretório não foi encontrado!" + +msgid "Directory required !" +msgstr "O diretório é necessário!" + +msgid "Directory where the rotating log-files are stored" +msgstr "O diretório onde os registros(log) rotativos são armazenados" + +msgid "During delay ifup-events are not monitored !" +msgstr "Durante a espera, eventos ifup não serão monitorados!" + +msgid "Enable HTTPS" +msgstr "Ativar HTTPS" + +msgid "" +"Enable/Disable auto-start of Radicale on system start-up and interface events" +msgstr "Ativar/Desativar iniciação automática do Radicale na iniciação do sistema e em eventos de interface" + +msgid "Encoding" +msgstr "Codificação" + +msgid "Encoding for responding requests." +msgstr "Codificação para responder pedidos." + +msgid "Encoding for storing local collections." +msgstr "Codificação para armazenar coleções locais." + +msgid "Encryption method" +msgstr "Método de criptografia" + +#, fuzzy +msgid "Error" +msgstr "Erro" + +msgid "File '%s' not found !" +msgstr "Arquivo '%s' não encontrado!" + +msgid "File Log level" +msgstr "Nível de detalhamento dos registos(log) em arquivos" + +msgid "File not found !" +msgstr "Arquivo não encontrado!" + +msgid "File-system" +msgstr "Sistema de arquivos" + +msgid "" +"For example, for the 'user' key, '.+' means 'authenticated user' and '.*' " +"means 'anybody' (including anonymous users)." +msgstr "Por exemplo, para a chave 'user', '.+' Significa 'usuário autenticado' e '.*' Significa 'qualquer um' (incluindo usuários anônimos)." + +msgid "Full access for Owner only" +msgstr "Acesso completo somente para o proprietário" + +msgid "Full access for authenticated Users" +msgstr "Acesso completo para usuários autenticados" + +msgid "Full access for everybody (including anonymous)" +msgstr "Acesso completo para todos (incluindo anônimo)" + +msgid "Full path and file name of certificate" +msgstr "Caminho completo e nome do arquivo do certificado" + +msgid "Full path and file name of private key" +msgstr "Caminho e arquivo nome completo da chave privada" + +#, fuzzy +msgid "Info" +msgstr "Informações" + +msgid "Keep in mind to use the correct hashing algorithm !" +msgstr "Fique atento para usar o algoritmo de resumo digital(hash) correto!" + +msgid "Leading or ending slashes are trimmed from collection's path." +msgstr "Barras inicias e finais serão removidas do caminho da coleção." + +msgid "Log-backup Count" +msgstr "Contagem Registro(log) de Backup" + +msgid "Log-file Viewer" +msgstr "Visualizador de Arquivo de Registros(log)" + +msgid "Log-file directory" +msgstr "Diretório do arquivo de registros(log)" + +msgid "Log-file size" +msgstr "Tamanho do arquivo de registros(log)" + +#, fuzzy +msgid "Logging" +msgstr "Registrando os eventos" + +msgid "Logon message" +msgstr "Mensagem de entrada" + +msgid "Maximum size of each rotation log-file." +msgstr "Tamanho máximo para a rotação do arquivo de registros(log)" + +msgid "Message displayed in the client when a password is needed." +msgstr "Mensagem exibida para o cliente quando uma senha é necessária." + +#, fuzzy +msgid "NOT installed" +msgstr "NÃO instalado" + +#, fuzzy +msgid "None" +msgstr "Nada" + +msgid "Number of backup files of log to create." +msgstr "Número de backups dos arquivos de registros(log) a serem criados." + +msgid "OPTIONAL: See python's ssl module for available ciphers" +msgstr "Opcional: veja o módulo SSL do python para conhecer as cifras disponíveis" + +msgid "One or more missing/invalid fields on tab" +msgstr "Um ou campos inválidos/ausentes na aba" + +msgid "Owner allow write, authenticated users allow read" +msgstr "O proprietário pode escrever, os usuários autenticados podem ler" + +msgid "Path/File required !" +msgstr "O caminho/arquivo é necessário!" + +msgid "" +"Place here the 'user:password' pairs for your users which should have access " +"to Radicale." +msgstr "Coloque aqui os pares 'usuário:senha' para os seus usuários que devem ter acesso a Radicale." + +msgid "Please install current version !" +msgstr "Por favor, instale a versão atual!" + +msgid "Please press [Reload] button below to reread the file." +msgstr "Por favor, pressione o botão [Recarregar] abaixo para reler o arquivo." + +msgid "Please update to current version !" +msgstr "Por favor, atualize para a versão atual!" + +msgid "Port numbers below 1024 (Privileged ports) are not supported" +msgstr "Os porta abaixo de 1024 (portas privilegiadas) não são suportadas" + +msgid "Private key file" +msgstr "Arquivo da chave privada" + +msgid "Radicale CalDAV/CardDAV Server" +msgstr "Radicale Servidor CalDAV/CardDAV" + +msgid "Radicale uses '/etc/radicale/rights' as regexp-based file." +msgstr "Radicale usa o '/etc/radicale/rights' como arquivo baseado em expressão regular." + +msgid "Radicale uses '/etc/radicale/users' as htpasswd file." +msgstr "Radicale usa o '/etc/radicale/users' como o arquivo htpasswd." + +msgid "Read only!" +msgstr "Somente leitura!" + +msgid "RegExp file" +msgstr "Arquivo de expressões regulares" + +msgid "Reload" +msgstr "Recarregar" + +msgid "Response Encoding" +msgstr "Codificação da Resposta" + +msgid "Rights" +msgstr "Direitos" + +msgid "Rights are based on a regexp-based file" +msgstr "Os direitos são baseados em um arquivo baseado em expressões regulares" + +msgid "Rights backend" +msgstr "Serviço de Direitos" + +msgid "SHA-1" +msgstr "SHA-1" + +msgid "SSL Protocol" +msgstr "Protocolo SSL" + +#, fuzzy +msgid "Save" +msgstr "Salvar" + +msgid "Section names are only used for naming the rule." +msgstr "Os nomes das seção são usados ​​apenas para nomear a regra." + +#, fuzzy +msgid "Server" +msgstr "Servidor" + +msgid "Setting this parameter to '0' will disable rotation of log-file." +msgstr "Definindo este parâmetro para '0' irá desativar a rotação dos arquivos de registros(log)." + +msgid "Software package '%s' is not installed." +msgstr "O pacote de software '%s' não está instalado." + +msgid "Software package '%s' is outdated." +msgstr "O pacote '%' está desatualizado." + +#, fuzzy +msgid "Software update required" +msgstr "A atualização do software é necessária" + +#, fuzzy +msgid "Start" +msgstr "Iniciar" + +#, fuzzy +msgid "Start / Stop" +msgstr "Iniciar / Parar" + +msgid "Start/Stop Radicale server" +msgstr "Iniciar/Parar o servidor Radicale" + +msgid "Storage" +msgstr "Armazenamento" + +msgid "Storage Encoding" +msgstr "Codificação do Armazenamento" + +msgid "Storage backend" +msgstr "Serviço de armazenamento" + +msgid "Syslog Log level" +msgstr "Nível de detalhamento do serviço de registro (syslog)" + +#, fuzzy +msgid "System" +msgstr "Sistema" + +msgid "" +"The Radicale Project is a complete CalDAV (calendar) and CardDAV (contact) " +"server solution." +msgstr "O Projeto Radicale é uma solução completa de CalDAV (agenda) e CardDAV (contatos)." + +msgid "" +"They can be viewed and edited by calendar and contact clients on mobile " +"phones or computers." +msgstr "Eles podem ser visualizados e editados pelos clientes de agenda e de contatos em telefones celulares ou computadores." + +msgid "To edit the file follow this link!" +msgstr "Para editar o arquivo, siga este link!" + +msgid "To view latest log file follow this link!" +msgstr "Para visualizar mais recente arquivo de registros(log), siga este link!" + +msgid "Value is not a number" +msgstr "O valor não é um número" + +msgid "Value is not an Integer >= 0 !" +msgstr "O valor não é um número natural (>=0)!" + +msgid "Value not between 0 and 300" +msgstr "Valor não está entre 0 e 300" + +msgid "Value required ! Integer >= 0 !" +msgstr "O valor é necessário! Número natural (>=0)!" + +#, fuzzy +msgid "Version" +msgstr "Versão" + +#, fuzzy +msgid "Version Information" +msgstr "Informação da Versão" + +msgid "" +"WARNING: Only 'File-system' is documented and tested by Radicale development" +msgstr "AVISO: Apenas 'Sistema de Arquivos "está documentado e testado pelo desenvolvimento do Radicale" + +#, fuzzy +msgid "Warning" +msgstr "Alerta" + +msgid "" +"You can also get groups from the user regex in the collection with {0}, {1}, " +"etc." +msgstr "Você também pode obter grupos a partir da expressão regular do usuário na coleção com {0}, {1} , etc." + +msgid "" +"You can use Python's ConfigParser interpolation values %(login)s and " +"%(path)s." +msgstr "Você pode usar a interpolação de valores %(login)s e %(path)s do ConfigParser do Python." + +msgid "crypt" +msgstr "cifrar" + +msgid "custom" +msgstr "personalizado" + +msgid "htpasswd file" +msgstr "arquivo htpasswd" + +#, fuzzy +msgid "installed" +msgstr "instalado" + +msgid "no valid path given!" +msgstr "Nenhum caminho válido foi informado!" + +#, fuzzy +msgid "or higher" +msgstr "ou maior" + +msgid "plain" +msgstr "plano" + +#, fuzzy +msgid "required" +msgstr "necessário" + +msgid "salted SHA-1" +msgstr "SHA-1 com salto" + diff --git a/package/luci/applications/luci-app-shadowsocks-libev/po/pt-br/shadowsocks-libev.po b/package/luci/applications/luci-app-shadowsocks-libev/po/pt-br/shadowsocks-libev.po new file mode 100644 index 0000000000..f2b18e374c --- /dev/null +++ b/package/luci/applications/luci-app-shadowsocks-libev/po/pt-br/shadowsocks-libev.po @@ -0,0 +1,97 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: pt_BR\n" + +msgid "Access Control" +msgstr "Controle de Acesso" + +msgid "Allow all except listed" +msgstr "Permitir todos, exceto os listados" + +msgid "Allow listed only" +msgstr "Permitir somente os listados" + +msgid "Bypassed IP" +msgstr "Endereços IP Ignorados" + +msgid "Connection Timeout" +msgstr "Tempo limite de conexão" + +msgid "Custom" +msgstr "Personalizado" + +msgid "Disabled" +msgstr "Desabilitado" + +msgid "Enable" +msgstr "Ativar" + +msgid "Enabled" +msgstr "Ativado" + +msgid "Encrypt Method" +msgstr "Método de Cifragem" + +msgid "Forwarded IP" +msgstr "Endereço IP Encaminhado" + +msgid "Forwarding Tunnel" +msgstr "Tunel para Encaminhamento" + +msgid "Global Setting" +msgstr "Opções Globais" + +msgid "Ignore List" +msgstr "Lista de Ignorados" + +msgid "LAN" +msgstr "LAN" + +msgid "LAN IP List" +msgstr "Lista de endereços IP da LAN" + +msgid "Local Port" +msgstr "Porta Local" + +msgid "Password" +msgstr "Senha" + +msgid "Relay Mode" +msgstr "Modo de Retransmissor" + +msgid "Server Address" +msgstr "Endereço do Servidor" + +msgid "Server Port" +msgstr "Porta do servidor" + +msgid "ShadowSocks-libev" +msgstr "ShadowSocks-libev" + +msgid "ShadowSocks-libev is not running" +msgstr "O serviço ShadowSocks-libev está parado" + +msgid "ShadowSocks-libev is running" +msgstr "O serviço ShadowSocks-libev está em execução." + +msgid "UDP Forward" +msgstr "Encaminhamento UDP" + +msgid "UDP Local Port" +msgstr "Porta Local UDP" + +msgid "UDP Relay" +msgstr "Retransmissão UDP" + +msgid "WAN" +msgstr "WAN" diff --git a/package/luci/applications/luci-app-shairplay/po/pt-br/shairplay.po b/package/luci/applications/luci-app-shairplay/po/pt-br/shairplay.po new file mode 100644 index 0000000000..c7d0ab18a3 --- /dev/null +++ b/package/luci/applications/luci-app-shairplay/po/pt-br/shairplay.po @@ -0,0 +1,54 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: pt_BR\n" +"X-Poedit-Bookmarks: -1,5,-1,-1,-1,-1,-1,-1,-1,-1\n" + +msgid "AO Device ID" +msgstr "Identificador do dispositivo AO" + +msgid "AO Device Name" +msgstr "Nome do dispositivo AO" + +msgid "AO Driver" +msgstr "Driver do AO" + +msgid "Airport Name" +msgstr "Nome do Airport" + +msgid "Default" +msgstr "Padrão" + +msgid "Enabled" +msgstr "Habilitado" + +msgid "HW Address" +msgstr "Endereço de Hardware" + +msgid "Password" +msgstr "Senha" + +msgid "Port" +msgstr "Porta" + +msgid "Respawn" +msgstr "Redisparar" + +msgid "Shairplay" +msgstr "Shairplay" + +msgid "" +"Shairplay is a simple AirPlay server implementation, here you can configure " +"the settings." +msgstr "" +"Shairplay é uma implementação simples de um servidor AirPlay. Aqui você pode " +"configurá-lo." diff --git a/package/luci/applications/luci-app-statistics/po/pt-br/statistics.po b/package/luci/applications/luci-app-statistics/po/pt-br/statistics.po index 3b3590f264..357f54317f 100644 --- a/package/luci/applications/luci-app-statistics/po/pt-br/statistics.po +++ b/package/luci/applications/luci-app-statistics/po/pt-br/statistics.po @@ -1,17 +1,17 @@ msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-06-10 03:41+0200\n" -"PO-Revision-Date: 2014-03-15 22:12+0200\n" -"Last-Translator: Luiz Angelo \n" -"Language-Team: LANGUAGE \n" +"PO-Revision-Date: 2017-02-22 18:27-0300\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Pootle 2.0.6\n" +"X-Generator: Poedit 1.8.11\n" +"Language-Team: \n" msgid "Action (target)" msgstr "Ação (destino)" @@ -29,7 +29,7 @@ msgid "Add notification command" msgstr "Adicionar o comando de notificação" msgid "Aggregate number of connected users" -msgstr "" +msgstr "Numero agregado de usuários conectados" msgid "Base Directory" msgstr "Diretório Base" @@ -38,10 +38,10 @@ msgid "Basic monitoring" msgstr "Monitoramento básico" msgid "CPU Frequency" -msgstr "" +msgstr "Frequência da CPU" msgid "CPU Frequency Plugin Configuration" -msgstr "" +msgstr "Configuração do Plugin da Frequência da CPU" msgid "CPU Plugin Configuration" msgstr "Configuração do plugin CPU" @@ -134,16 +134,16 @@ msgid "Email" msgstr "Email" msgid "Empty value = monitor all" -msgstr "" +msgstr "Valor vazio = monitore todos" msgid "Enable this plugin" msgstr "Habilitar este plugin" msgid "Entropy" -msgstr "" +msgstr "Entropia" msgid "Entropy Plugin Configuration" -msgstr "" +msgstr "Configuração do Plugin de Entropia" msgid "Exec" msgstr "Exec" @@ -165,13 +165,13 @@ msgstr "" "Encaminhamento entre o endereço de escuta e os endereços dos servidores" msgid "Gather compression statistics" -msgstr "" +msgstr "Obter estatísticas sobre a compressão" msgid "General plugins" -msgstr "" +msgstr "Plugins Gerais" msgid "Generate a separate graph for each logged user" -msgstr "" +msgstr "Gerar um gráfico separado para cada usuário conectado" msgid "Graphs" msgstr "Gráficos" @@ -204,6 +204,7 @@ msgstr "" msgid "Hold Ctrl to select multiple items or to deselect entries." msgstr "" +"Segure o Ctrl para selecionar múltiplos itens ou para retirar entradas. " msgid "Host" msgstr "Equipamento" @@ -259,6 +260,8 @@ msgid "" "Max values for a period can be used instead of averages when not using 'only " "average RRAs'" msgstr "" +"Valores máximos para um período podem ser usados em vez de médias quando não " +"estiver usando 'somente RRAs de médias'" msgid "Maximum allowed connections" msgstr "Máximo de conexões permitidas" @@ -276,10 +279,10 @@ msgid "Monitor all local listen ports" msgstr "Monitorar todas as portas locais" msgid "Monitor all sensors" -msgstr "" +msgstr "Monitorar todas os sensores" msgid "Monitor device(s) / thermal zone(s)" -msgstr "" +msgstr "Dispositivo(s) de monitoramento / zona(s) térmica(s)" msgid "Monitor devices" msgstr "Monitorar dispositivos" @@ -345,13 +348,13 @@ msgid "Only create average RRAs" msgstr "Somente criar RRAs de média" msgid "OpenVPN" -msgstr "" +msgstr "OpenVPN" msgid "OpenVPN Plugin Configuration" -msgstr "" +msgstr "Configuração do Plugin do OpenVPN" msgid "OpenVPN status files" -msgstr "" +msgstr "Arquivos de estado do OpenVPN" msgid "Options" msgstr "Opções" @@ -411,13 +414,13 @@ msgid "Seconds" msgstr "Segundos" msgid "Sensor list" -msgstr "" +msgstr "Lista de sensores" msgid "Sensors" -msgstr "" +msgstr "Sensores" msgid "Sensors Plugin Configuration" -msgstr "" +msgstr "Configuração do Plugin de Sensores" msgid "Server host" msgstr "Endereço do servidor" @@ -426,13 +429,13 @@ msgid "Server port" msgstr "Porta do servidor" msgid "Setup" -msgstr "" +msgstr "Configuração" msgid "Shaping class monitoring" msgstr "Monitoramento das Classes de Shaping" msgid "Show max values instead of averages" -msgstr "" +msgstr "Mostrar valores máximos em vez de médias" msgid "Socket file" msgstr "Arquivo do socket" @@ -456,10 +459,10 @@ msgid "Specifies what information to collect about the global topology." msgstr "Especifica quais informações serão coletadas sobre a topologia global." msgid "Splash Leases" -msgstr "" +msgstr "Concessões do Splash" msgid "Splash Leases Plugin Configuration" -msgstr "" +msgstr "Configuração do Plugin das Concessões do Splash" msgid "Statistics" msgstr "Estatística" @@ -508,6 +511,7 @@ msgid "" "The OpenVPN plugin gathers information about the current vpn connection " "status." msgstr "" +"O plugin OpenVPN reúne informações sobre o status atual da conexão VPN." msgid "" "The conntrack plugin collects statistics about the number of tracked " @@ -560,7 +564,7 @@ msgstr "" "Plugin::Collectd mas pode ser utilizado de outras maneiras também." msgid "The entropy plugin collects statistics about the available entropy." -msgstr "" +msgstr "O plugin de entropia coleta estatísticas sobre a entropia disponível." msgid "" "The exec plugin starts external commands to read values from or to notify " @@ -651,17 +655,24 @@ msgid "" "The sensors plugin uses the Linux Sensors framework to gather environmental " "statistics." msgstr "" +"O plugin de sensores usa a estrutura de sensores do Linux para coletar " +"estatísticas ambientais." msgid "" "The splash leases plugin uses libuci to collect statistics about splash " "leases." msgstr "" +"O plug-in de concessões splash usa o libuci para coletar estatísticas sobre " +"concessões de splash." msgid "" "The statistics package uses Collectd " "to gather data and RRDtool to " "render diagram images." msgstr "" +"O pacote de estatísticas usa Collectd para coletar dados e RRDtool para desenhar os gráficos." msgid "" "The tcpconns plugin collects informations about open tcp connections on " @@ -675,6 +686,9 @@ msgid "" "read from /sys/class/thermal/*/temp ( '*' denotes the thermal device to be " "read, e.g. thermal_zone1 )" msgstr "" +"O plugin térmico monitorará a temperatura do sistema. Os dados são " +"tipicamente lidos de /sys/class/thermal/*/temp ('*' indica o dispositivo " +"térmico a ser lido, ex:, thermal_zone1)" msgid "" "The unixsock plugin creates a unix socket which can be used to read " @@ -685,15 +699,19 @@ msgstr "" msgid "The uptime plugin collects statistics about the uptime of the system." msgstr "" +"O plugin de tempo de atividade coleta estatísticas sobre o tempo de " +"atividade do sistema." msgid "Thermal" -msgstr "" +msgstr "Térmico" msgid "Thermal Plugin Configuration" -msgstr "" +msgstr "Configuração do Plugin Térmico" msgid "This plugin collects statistics about the processor frequency scaling." msgstr "" +"Este plugin coleta as estatísticas sobre o escalonamento da frequência do " +"processador." msgid "" "This section defines on which interfaces collectd will wait for incoming " @@ -727,13 +745,13 @@ msgid "Unixsock Plugin Configuration" msgstr "Configuração do plugin Unixsock" msgid "Uptime" -msgstr "" +msgstr "Tempo de atividade" msgid "Uptime Plugin Configuration" -msgstr "" +msgstr "Configuração do Plugin de Tempo de Atividade" msgid "Use improved naming schema" -msgstr "" +msgstr "Use um esquema de nomeação melhorado" msgid "Used PID file" msgstr "Arquivo PID usado" @@ -753,6 +771,8 @@ msgstr "Configuração do Plugin iwinfo da Rede Sem Fio (Wireless)" msgid "" "You can install additional collectd-mod-* plugins to enable more statistics." msgstr "" +"Você pode instalar plugins adicionais (collectd-mod-*) para habilitar mais " +"estatísticas." msgid "e.g. br-ff" msgstr "ex: br-ff" @@ -775,6 +795,15 @@ msgstr "segundos; vários valores, separar com espaço" msgid "server interfaces" msgstr "interfaces do servidor" +#~ msgid "" +#~ "Note: as pages are rendered by user 'nobody', the *.rrd files, the " +#~ "storage directory and all its parent directories need to be world " +#~ "readable." +#~ msgstr "" +#~ "Nota: como as páginas são renderizadas pelo usuário 'nobody', os arquivos " +#~ "* .rrd, o diretório de armazenamento e todos os seus diretórios " +#~ "superiores precisam ser legíveis a todos." + #~ msgid "Collectd" #~ msgstr "Coletar" diff --git a/package/luci/applications/luci-app-travelmate/luasrc/model/cbi/travelmate.lua b/package/luci/applications/luci-app-travelmate/luasrc/model/cbi/travelmate.lua index 9050ae9686..fa44d4b523 100644 --- a/package/luci/applications/luci-app-travelmate/luasrc/model/cbi/travelmate.lua +++ b/package/luci/applications/luci-app-travelmate/luasrc/model/cbi/travelmate.lua @@ -18,17 +18,17 @@ o = s:option(Flag, "trm_enabled", translate("Enable Travelmate")) o.rmempty = false o.default = 0 -o = s:option(Value, "trm_loop", translate("Loop timeout in seconds for wlan monitoring"), - translate("Default 30, range 5-60")) +o = s:option(Value, "trm_maxwait", translate("Max. timeout in seconds for wlan interface reload"), + translate("Default 20, range 10-60")) o.rmempty = false -o.default = 30 -o.datatype = "range(5,60)" +o.default = 20 +o.datatype = "range(10,60)" o = s:option(Value, "trm_maxretry", translate("Max. number of connection retries to an uplink"), - translate("Default 3, range 0-10. Set to 0 to allow unlimited retries")) + translate("Default 3, range 1-10")) o.rmempty = false o.default = 3 -o.datatype = "range(0,10)" +o.datatype = "range(1,10)" -- Extra options @@ -38,8 +38,8 @@ a = e:option(Flag, "trm_debug", translate("Debug logging")) a.rmempty = true a.default = a.disabled -a = e:option(Value, "trm_device", translate("Use only one radio, e.g. 'radio0'"), - translate("Default: empty = use all radios.")) +a = e:option(Value, "trm_iface", translate("Restrict reload trigger to certain interface(s)"), + translate("Space separated list of wwan interfaces that trigger reload action. To disable reload trigger set it to 'false'. Default: empty")) a.rmempty = true a.default = "" a.datatype = "uciname" diff --git a/package/luci/applications/luci-app-travelmate/po/ja/travelmate.po b/package/luci/applications/luci-app-travelmate/po/ja/travelmate.po index 986d7b32b6..de1aceed95 100644 --- a/package/luci/applications/luci-app-travelmate/po/ja/travelmate.po +++ b/package/luci/applications/luci-app-travelmate/po/ja/travelmate.po @@ -32,14 +32,11 @@ msgstr "トラベル ルータ機能を有効にする、Travelmate パッケー msgid "Debug logging" msgstr "デバッグ ログ" -msgid "Default 3, range 0-10. Set to 0 to allow unlimited retries" -msgstr "既定値 3、範囲 0 - 10。再試行回数を制限しない場合、0 に設定します。" +msgid "Default 20, range 10-60" +msgstr "既定値 20、範囲 10 - 60" -msgid "Default 30, range 5-60" -msgstr "既定値 30、範囲 5 - 60" - -msgid "Default: empty = use all radios." -msgstr "デフォルト:(空)= 全ての無線を使用" +msgid "Default 3, range 1-10" +msgstr "既定値 3、範囲 1 - 10" msgid "Disable this if you want to use iwinfo instead of iw" msgstr "iw の代わりに iwinfo を使用したい場合、この設定を無効にします。" @@ -56,17 +53,39 @@ msgstr "全般オプション" msgid "Link to detailed advice" msgstr "詳細な解説へのリンク" -msgid "Loop timeout in seconds for wlan monitoring" -msgstr "無線LAN モニターのループ タイムアウト(秒)" - msgid "Max. number of connection retries to an uplink" msgstr "確立までの接続試行回数" +msgid "Max. timeout in seconds for wlan interface reload" +msgstr "無線LANインターフェース リロード時の最大待機時間(秒)" + +msgid "Restrict reload trigger to certain interface(s)" +msgstr "リロード トリガを特定のインターフェースに限定する" + +msgid "" +"Space separated list of wwan interfaces that trigger reload action. To " +"disable reload trigger set it to 'false'. Default: empty" +msgstr "" +"リロード動作のトリガとなる、スペースで区切られたWWAN インターフェースのリスト" +"です。リロードのトリガを無効にするには、'false' を設定します。既定値:(空)" + msgid "Travelmate" msgstr "Travelmate" msgid "Use iw for scanning" msgstr "スキャンに iw を使用する" -msgid "Use only one radio, e.g. 'radio0'" -msgstr "単一の無線のみ使用する 例: 'radio0'" +#~ msgid "Default 3, range 0-10. Set to 0 to allow unlimited retries" +#~ msgstr "既定値 3、範囲 0 - 10。再試行回数を制限しない場合、0 に設定します。" + +#~ msgid "Default 30, range 5-60" +#~ msgstr "既定値 30、範囲 5 - 60" + +#~ msgid "Default: empty = use all radios." +#~ msgstr "デフォルト:(空)= 全ての無線を使用" + +#~ msgid "Loop timeout in seconds for wlan monitoring" +#~ msgstr "無線LAN モニターのループ タイムアウト(秒)" + +#~ msgid "Use only one radio, e.g. 'radio0'" +#~ msgstr "単一の無線のみ使用する 例: 'radio0'" diff --git a/package/luci/applications/luci-app-travelmate/po/pt-br/travelmate.po b/package/luci/applications/luci-app-travelmate/po/pt-br/travelmate.po new file mode 100644 index 0000000000..bcfc1cfa2f --- /dev/null +++ b/package/luci/applications/luci-app-travelmate/po/pt-br/travelmate.po @@ -0,0 +1,78 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: pt_BR\n" + +msgid "" +"Brief advice: Create a wwan interface, configure it to use dhcp and add it " +"to the wan zone in firewall. Create the wifi interfaces to be used ('client' " +"mode, assigned to wwan network, left as disabled). Travelmate will try to " +"connect to the known wifi client interfaces in the defined order." +msgstr "" +"Breve conselho: Crie uma interface wwan, configure-a para usar DHCP e " +"adicione-a à zona wan no firewall. Crie as interfaces wifi a serem usadas " +"(modo 'cliente', atribuído à rede wwan, deixado como desativado). O " +"Travelmate tentará se conectar às interfaces de cliente wifi conhecidas na " +"ordem definida." + +msgid "" +"Configuration of the Travelmate package to enable travel router " +"functionality." +msgstr "" +"Configuração do pacote Travelmate para permitir a funcionalidade de roteador " +"de viagem." + +msgid "Debug logging" +msgstr "Registros(log) para depuração" + +msgid "Default 20, range 10-60" +msgstr "Padrão 20, faixa 10-60" + +msgid "Default 3, range 1-10" +msgstr "Padrão 3, faixa 1-10" + +msgid "Disable this if you want to use iwinfo instead of iw" +msgstr "Desabilite isto se você quer usar o iwinfo ao invés do iw" + +msgid "Enable Travelmate" +msgstr "Habilitar o Travelmate" + +msgid "Extra options" +msgstr "Opções adicionais" + +msgid "Global options" +msgstr "Opções Globais" + +msgid "Link to detailed advice" +msgstr "Endereço para conselhos detalhados" + +msgid "Max. number of connection retries to an uplink" +msgstr "Máximo número de tentativas de conexão para um enlace" + +msgid "Max. timeout in seconds for wlan interface reload" +msgstr "Tempo limite máximo em segundos para recarregar a interface wlan" + +msgid "Restrict reload trigger to certain interface(s)" +msgstr "Restringir o gatilho de recarga para somente alguma(s) interface(s)" + +msgid "" +"Space separated list of wwan interfaces that trigger reload action. To " +"disable reload trigger set it to 'false'. Default: empty" +msgstr "" +"Lista separada por espaços de interfaces wwan que acionam a ação de recarga. " +"Para desabilitar o gatilho de recarga, defina-o como 'false'. Padrão: vazio" + +msgid "Travelmate" +msgstr "Travelmate" + +msgid "Use iw for scanning" +msgstr "Use o iw para escaneamento" diff --git a/package/luci/applications/luci-app-travelmate/po/templates/travelmate.pot b/package/luci/applications/luci-app-travelmate/po/templates/travelmate.pot index 533b3e2639..20628196b6 100644 --- a/package/luci/applications/luci-app-travelmate/po/templates/travelmate.pot +++ b/package/luci/applications/luci-app-travelmate/po/templates/travelmate.pot @@ -16,13 +16,10 @@ msgstr "" msgid "Debug logging" msgstr "" -msgid "Default 3, range 0-10. Set to 0 to allow unlimited retries" +msgid "Default 20, range 10-60" msgstr "" -msgid "Default 30, range 5-60" -msgstr "" - -msgid "Default: empty = use all radios." +msgid "Default 3, range 1-10" msgstr "" msgid "Disable this if you want to use iwinfo instead of iw" @@ -40,17 +37,22 @@ msgstr "" msgid "Link to detailed advice" msgstr "" -msgid "Loop timeout in seconds for wlan monitoring" +msgid "Max. number of connection retries to an uplink" msgstr "" -msgid "Max. number of connection retries to an uplink" +msgid "Max. timeout in seconds for wlan interface reload" msgstr "" -msgid "Travelmate" +msgid "Restrict reload trigger to certain interface(s)" msgstr "" -msgid "Use iw for scanning" +msgid "" +"Space separated list of wwan interfaces that trigger reload action. To " +"disable reload trigger set it to 'false'. Default: empty" msgstr "" -msgid "Use only one radio, e.g. 'radio0'" +msgid "Travelmate" +msgstr "" + +msgid "Use iw for scanning" msgstr "" diff --git a/package/luci/applications/luci-app-uhttpd/po/pt-br/uhttpd.po b/package/luci/applications/luci-app-uhttpd/po/pt-br/uhttpd.po new file mode 100644 index 0000000000..af68b9e140 --- /dev/null +++ b/package/luci/applications/luci-app-uhttpd/po/pt-br/uhttpd.po @@ -0,0 +1,208 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: pt_BR\n" + +msgid "" +"(/old/path=/new/path) or (just /old/path which becomes /cgi-prefix/old/path)" +msgstr "" +"(/old/path=/new/path) ou (just /old/path que se torna /cgi-prefix/old/path)" + +msgid "404 Error" +msgstr "Erro 404" + +msgid "A lightweight single-threaded HTTP(S) server" +msgstr "Um servidor HTTP(S) leve de únida thread." + +msgid "Advanced Settings" +msgstr "Opções Avançadas" + +msgid "Aliases" +msgstr "Pseudônimos (Aliases)" + +msgid "Base directory for files to be served" +msgstr "Diretório Base para publicar arquivos" + +msgid "Bind to specific interface:port (by specifying interface address" +msgstr "" +"Escute em uma interface:porta específica (especificando o endereço da " +"interface" + +msgid "CGI filetype handler" +msgstr "Interpretador de tipo de arquivo CGI" + +msgid "CGI is disabled if not present." +msgstr "O CGI estará desabilitado se não presente." + +msgid "Config file (e.g. for credentials for Basic Auth)" +msgstr "Arquivo de configuração (ex: credenciais para autenticação básica)" + +msgid "Connection reuse" +msgstr "Reutilizar conexão" + +msgid "Country" +msgstr "País" + +msgid "Disable JSON-RPC authorization via ubus session API" +msgstr "Desabilita a autorização JSON-RPC através da API de sessão ubus" + +msgid "Do not follow symlinks outside document root" +msgstr "Não siga ligações simbólicas (symlinks) para fora do documento raiz" + +msgid "Do not generate directory listings." +msgstr "Não gere listagens de diretórios" + +msgid "Document root" +msgstr "Documento Raiz" + +msgid "E.g specify with index.html and index.php when using PHP" +msgstr "Ex: use index.html e index.php quando usar PHP" + +msgid "Embedded Lua interpreter is disabled if not present." +msgstr "O interpretador Lua embutido será desabilitado se não presente." + +msgid "Enable JSON-RPC Cross-Origin Resource Support" +msgstr "Habilite o suporte para recursos JSON-RPC de origem cruzada" + +msgid "For settings primarily geared to serving more than the web UI" +msgstr "Para ajustes envolvidos com mais do que prover a interface web" + +msgid "Full Web Server Settings" +msgstr "Configurações Completas do Servidor Web" + +msgid "Full real path to handler for Lua scripts" +msgstr "Caminho completo para o interpretador de scripts Lua" + +msgid "General Settings" +msgstr "Configurações Gerais" + +msgid "HTTP listeners (address:port)" +msgstr "Escutas do HTTP (endereço:porta)" + +msgid "HTTPS Certificate (DER Encoded)" +msgstr "Certificado do HTTPS (codificado em formato PEM)" + +msgid "HTTPS Private Key (DER Encoded)" +msgstr "Chave Privada do HTTPS (codificado como DER)" + +msgid "HTTPS listener (address:port)" +msgstr "Escuta do HTTPS (endereço:porta)" + +msgid "Ignore private IPs on public interface" +msgstr "Ignore endereços IP privados na interface pública" + +msgid "Index page(s)" +msgstr "Página(s) Índice(s)" + +msgid "" +"Interpreter to associate with file endings ('suffix=handler', e.g. '.php=/" +"usr/bin/php-cgi')" +msgstr "" +"Interpretador para associar com extensões de arquivos " +"('extensão=interpretador', ex: '.php=/usr/bin/php-cgi')" + +msgid "Length of key in bits" +msgstr "Comprimento da chave em bits" + +msgid "Location" +msgstr "Localização" + +msgid "Maximum number of connections" +msgstr "Número máximo de requisições para script" + +msgid "Maximum number of script requests" +msgstr "Número máximo de requisições para script" + +msgid "Maximum wait time for Lua, CGI, or ubus execution" +msgstr "Tempo máximo de espera para execuções de Lua, CGI ou ubus" + +msgid "Maximum wait time for network activity" +msgstr "Tempo máximo de espera para atividade na rede" + +msgid "Override path for ubus socket" +msgstr "Sobrescrever o caminho do socket ubus" + +msgid "Path prefix for CGI scripts" +msgstr "Prefixo do caminho para scripts CGI" + +msgid "" +"Prevent access from private (RFC1918) IPs on an interface if it has an " +"public IP address" +msgstr "" +"Evite acesso de endereços privados (RFC1918) na interface que tem um " +"endereço IP público" + +msgid "Realm for Basic Auth" +msgstr "Reino para Autenticação Simples" + +msgid "Redirect all HTTP to HTTPS" +msgstr "Redirecionar todo tráfego HTTP para HTTPS" + +msgid "Remove configuration for certificate and key" +msgstr "Remove a configuração para o certificado e chave" + +msgid "Remove old certificate and key" +msgstr "Remove os certificados e chaves antigas" + +msgid "Server Hostname" +msgstr "Nome do Servidor" + +msgid "" +"Settings which are either rarely needed or which affect serving the WebUI" +msgstr "Ajustes que são raramente usadas ou que afetam a interface web" + +msgid "State" +msgstr "Estado" + +msgid "TCP Keepalive" +msgstr "Manter conexões TCP abertas (Keepalive)" + +msgid "This permanently deletes the cert, key, and configuration to use same." +msgstr "Isto apaga permanentemente o certificado, a chave e a configuração." + +msgid "Valid for # of Days" +msgstr "Valido por # dias" + +msgid "" +"Virtual URL or CGI script to display on status '404 Not Found'. Must begin " +"with '/'" +msgstr "" +"URL virtual ou script CGI para mostrar quando ocorrer erro '404 Não " +"Encontrado'. Deve começar com '/'" + +msgid "Virtual path prefix for Lua scripts" +msgstr "Prefixo do caminho virtual para scripts Lua" + +msgid "Virtual path prefix for ubus via JSON-RPC integration" +msgstr "Prefixo do caminho virtual para o ubus através da integração JSON-RPC" + +msgid "Will not use HTTP authentication if not present" +msgstr "Não usar autenticação HTTP se não presente" + +msgid "a.k.a CommonName" +msgstr "também conhecido como Nome Comum" + +msgid "uHTTPd" +msgstr "uHTTPd" + +msgid "uHTTPd Self-signed Certificate Parameters" +msgstr "Parâmetros do Certificado Auto-assinado do uHTTPd" + +msgid "" +"uHTTPd will generate a new self-signed certificate using the configuration " +"shown below." +msgstr "" +"o uHTTPd gerará um certificado auto-assinado usando a configuração mostrada " +"abaixo." + +msgid "ubus integration is disabled if not present" +msgstr "A integração com o ubus será desativada se não presente" diff --git a/package/luci/applications/luci-app-unbound/luasrc/model/cbi/unbound.lua b/package/luci/applications/luci-app-unbound/luasrc/model/cbi/unbound.lua index 6d876c2c83..847c98a3e8 100644 --- a/package/luci/applications/luci-app-unbound/luasrc/model/cbi/unbound.lua +++ b/package/luci/applications/luci-app-unbound/luasrc/model/cbi/unbound.lua @@ -5,26 +5,29 @@ m = Map("unbound", translate("Recursive DNS"), translate("Unbound is a validating, recursive, and caching DNS resolver.")) - -s = m:section(TypedSection, "unbound", translate("Unbound Settings")) -s.addremove = false -s.anonymous = true -s:tab("service", translate("Unbound Service")) -s:tab("resource", translate("Unbound Resources")) -s:tab("dnsmasq", translate("Dnsmasq Link")) +s1 = m:section(TypedSection, "unbound") +s1.addremove = false +s1.anonymous = true +s1:tab("service", translate("Basic Settings")) +s1:tab("advanced", translate("Advanced Settings")) +s1:tab("resource", translate("Resource Settings")) ---Enable Unbound +--LuCI or Not -e = s:taboption("service", Flag, "enabled", translate("Enable Unbound:"), +ena = s1:taboption("service", Flag, "enabled", translate("Enable Unbound:"), translate("Enable the initialization scripts for Unbound")) -e.rmempty = false +ena.rmempty = false -function e.cfgvalue(self, section) +mcf = s1:taboption("service", Flag, "manual_conf", translate("Manual Conf:"), + translate("Skip UCI and use /etc/unbound/unbound.conf")) +mcf.rmempty = false + +function ena.cfgvalue(self, section) return luci.sys.init.enabled("unbound") and self.enabled or self.disabled end -function e.write(self, section, value) +function ena.write(self, section, value) if value == "1" then luci.sys.init.enable("unbound") luci.sys.call("/etc/init.d/unbound start >/dev/null") @@ -36,72 +39,136 @@ function e.write(self, section, value) return Flag.write(self, section, value) end ---Service Tab - -mcf = s:taboption("service", Flag, "manual_conf", translate("Manual Conf:"), - translate("Skip UCI and use /etc/unbound/unbound.conf")) -mcf.rmempty = false +--Basic Tab -lsv = s:taboption("service", Flag, "localservice", translate("Local Service:"), +lsv = s1:taboption("service", Flag, "localservice", translate("Local Service:"), translate("Accept queries only from local subnets")) lsv.rmempty = false -qry = s:taboption("service", Flag, "query_minimize", translate("Query Minimize:"), - translate("Break down query components for small added privacy")) -qry.rmempty = false - -rlh = s:taboption("service", Flag, "rebind_localhost", translate("Block Localhost Rebind:"), +rlh = s1:taboption("service", Flag, "rebind_localhost", translate("Block Localhost Rebind:"), translate("Prevent upstream response of 127.0.0.0/8")) rlh.rmempty = false -rpv = s:taboption("service", Flag, "rebind_protection", translate("Block Private Rebind:"), +rpv = s1:taboption("service", Flag, "rebind_protection", translate("Block Private Rebind:"), translate("Prevent upstream response of RFC1918 ranges")) rpv.rmempty = false -vld = s:taboption("service", Flag, "validator", translate("Enable DNSSEC:"), +vld = s1:taboption("service", Flag, "validator", translate("Enable DNSSEC:"), translate("Enable the DNSSEC validator module")) vld.rmempty = false -nvd = s:taboption("service", Flag, "validator_ntp", translate("DNSSEC NTP Fix:"), +nvd = s1:taboption("service", Flag, "validator_ntp", translate("DNSSEC NTP Fix:"), translate("Break the loop where DNSSEC needs NTP and NTP needs DNS")) nvd.rmempty = false +nvd:depends({ validator = true }) -eds = s:taboption("service", Value, "edns_size", translate("EDNS Size:"), +eds = s1:taboption("service", Value, "edns_size", translate("EDNS Size:"), translate("Limit extended DNS packet size")) eds.datatype = "and(uinteger,min(512),max(4096))" eds.rmempty = false -prt = s:taboption("service", Value, "listen_port", translate("Listening Port:"), +prt = s1:taboption("service", Value, "listen_port", translate("Listening Port:"), translate("Choose Unbounds listening port")) prt.datatype = "port" prt.rmempty = false -tlm = s:taboption("service", Value, "ttl_min", translate("TTL Minimum:"), +tlm = s1:taboption("service", Value, "ttl_min", translate("TTL Minimum:"), translate("Prevent excessively short cache periods")) tlm.datatype = "and(uinteger,min(0),max(600))" tlm.rmempty = false -d64 = s:taboption("service", Flag, "dns64", translate("Enable DNS64:"), +--Advanced Tab + +ctl = s1:taboption("advanced", Flag, "unbound_control", translate("Unbound Control App:"), + translate("Enable unecrypted localhost access for unbound-control")) +ctl.rmempty = false + +dlk = s1:taboption("advanced", ListValue, "dhcp_link", translate("DHCP Link:"), + translate("Link to supported programs to load DHCP into DNS")) +dlk:value("none", translate("No Link")) +dlk:value("dnsmasq", "dnsmasq") +dlk:value("odhcpd", "odhcpd") +dlk.rmempty = false + +dom = s1:taboption("advanced", Value, "domain", translate("Local Domain:"), + translate("Domain suffix for this router and DHCP clients")) +dom.placeholder = "lan" +dom:depends({ dhcp_link = "none" }) +dom:depends({ dhcp_link = "odhcpd" }) + +dty = s1:taboption("advanced", ListValue, "domain_type", translate("Local Domain Type:"), + translate("How to treat queries of this local domain")) +dty:value("deny", translate("Ignored")) +dty:value("refuse", translate("Refused")) +dty:value("static", translate("Only Local")) +dty:value("transparent", translate("Also Forwarded")) +dty:depends({ dhcp_link = "none" }) +dty:depends({ dhcp_link = "odhcpd" }) + +lfq = s1:taboption("advanced", ListValue, "add_local_fqdn", translate("LAN DNS:"), + translate("How to enter the LAN or local network router in DNS")) +lfq:value("0", translate("No DNS")) +lfq:value("1", translate("Hostname, Primary Address")) +lfq:value("2", translate("Hostname, All Addresses")) +lfq:value("3", translate("Host FQDN, All Addresses")) +lfq:value("4", translate("Interface FQDN, All Addresses")) +lfq:depends({ dhcp_link = "none" }) +lfq:depends({ dhcp_link = "odhcpd" }) + +wfq = s1:taboption("advanced", ListValue, "add_wan_fqdn", translate("WAN DNS:"), + translate("Override the WAN side router entry in DNS")) +wfq:value("0", translate("Upstream")) +wfq:value("1", translate("Hostname, Primary Address")) +wfq:value("2", translate("Hostname, All Addresses")) +wfq:value("3", translate("Host FQDN, All Addresses")) +wfq:value("4", translate("Interface FQDN, All Addresses")) +wfq:depends({ dhcp_link = "none" }) +wfq:depends({ dhcp_link = "odhcpd" }) + +ctl = s1:taboption("advanced", Flag, "dhcp4_slaac6", translate("DHCPv4 to SLAAC:"), + translate("Use DHCPv4 MAC to discover IP6 hosts SLAAC (EUI64)")) +ctl.rmempty = false + +d64 = s1:taboption("advanced", Flag, "dns64", translate("Enable DNS64:"), translate("Enable the DNS64 module")) d64.rmempty = false -pfx = s:taboption("service", Value, "dns64_prefix", translate("DNS64 Prefix:"), +pfx = s1:taboption("advanced", Value, "dns64_prefix", translate("DNS64 Prefix:"), translate("Prefix for generated DNS64 addresses")) pfx.datatype = "ip6addr" pfx.placeholder = "64:ff9b::/96" pfx.optional = true -pfx:depends({ dns64 = "1" }) +pfx:depends({ dns64 = true }) + +qry = s1:taboption("advanced", Flag, "query_minimize", translate("Query Minimize:"), + translate("Break down query components for limited added privacy")) +qry.rmempty = false + +qrs = s1:taboption("advanced", Flag, "query_min_strict", translate("Strict Minimize:"), + translate("Strict version of 'query minimize' but it can break DNS")) +qrs.rmempty = false +qrs:depends({ query_minimize = true }) + +--TODO: dnsmasq needs to not reference resolve-file and get off port 53. --Resource Tuning Tab -rsn = s:taboption("resource", ListValue, "recursion", translate("Recursion Strength:"), +pro = s1:taboption("resource", ListValue, "protocol", translate("Recursion Protocol:"), + translate("Chose the protocol recursion queries leave on")) +pro:value("mixed", translate("IP4 and IP6")) +pro:value("ip6_prefer", translate("IP6 Preferred")) +pro:value("ip4_only", translate("IP4 Only")) +pro:value("ip6_only", translate("IP6 Only")) +pro.rmempty = false + +rsn = s1:taboption("resource", ListValue, "recursion", translate("Recursion Strength:"), translate("Recursion activity affects memory growth and CPU load")) rsn:value("aggressive", translate("Aggressive")) rsn:value("default", translate("Default")) rsn:value("passive", translate("Passive")) rsn.rmempty = false -rsc = s:taboption("resource", ListValue, "resource", translate("Memory Resource:"), +rsc = s1:taboption("resource", ListValue, "resource", translate("Memory Resource:"), translate("Use menu System/Processes to observe any memory growth")) rsc:value("large", translate("Large")) rsc:value("medium", translate("Medium")) @@ -109,27 +176,14 @@ rsc:value("small", translate("Small")) rsc:value("tiny", translate("Tiny")) rsc.rmempty = false -age = s:taboption("resource", Value, "root_age", translate("Root DSKEY Age:"), +ag2 = s1:taboption("resource", Value, "root_age", translate("Root DSKEY Age:"), translate("Limit days between RFC5011 to reduce flash writes")) -age.datatype = "and(uinteger,min(1),max(99))" -age:value("14", "14") -age:value("28", "28 ("..translate("default")..")") -age:value("45", "45") -age:value("90", "90") -age:value("99", "99 ("..translate("never")..")") - ---Dnsmasq Link Tab - -dld = s:taboption("dnsmasq", Flag, "dnsmasq_link_dns", translate("Link dnsmasq:"), - translate("Forward queries to dnsmasq for local clients")) -dld.rmempty = false - -dgn = s:taboption("dnsmasq", Flag, "dnsmsaq_gate_name", translate("Local Gateway Name:"), - translate("Also query dnsmasq for this hosts outbound gateway")) -dgn.rmempty = false - ---TODO: Read only repective dnsmasq options and inform user of link requirements. ---TODO: dnsmasq needs to not reference resolve-file and get off port 53. +ag2.datatype = "and(uinteger,min(1),max(99))" +ag2:value("14", "14") +ag2:value("28", "28 ("..translate("default")..")") +ag2:value("45", "45") +ag2:value("90", "90") +ag2:value("99", "99 ("..translate("never")..")") return m diff --git a/package/luci/applications/luci-app-unbound/root/etc/uci-defaults/60_luci-unbound b/package/luci/applications/luci-app-unbound/root/etc/uci-defaults/60_luci-unbound new file mode 100644 index 0000000000..cc714ac53e --- /dev/null +++ b/package/luci/applications/luci-app-unbound/root/etc/uci-defaults/60_luci-unbound @@ -0,0 +1,25 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@unbound[-1] + add ucitrack unbound + set ucitrack.@unbound[-1].init=unbound + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +[ ! -x /usr/sbin/unbound-control ] && exit 0 + +uci -q batch <<-EOF >/dev/null + set luci.unboundhosts=command + set luci.unboundhosts.name='Unbound Local Hosts' + set luci.unboundhosts.command='unbound-control -c /var/lib/unbound/unbound.conf list_local_data' + set luci.unboundzones=command + set luci.unboundzones.name='Unbound Local Zones' + set luci.unboundzones.command='unbound-control -c /var/lib/unbound/unbound.conf list_local_zones' + commit luci +EOF + +rm -f /tmp/luci-indexcache +exit 0 + diff --git a/package/luci/applications/luci-app-vpnbypass/po/pt-br/vpnbypass.po b/package/luci/applications/luci-app-vpnbypass/po/pt-br/vpnbypass.po new file mode 100644 index 0000000000..6eda027c40 --- /dev/null +++ b/package/luci/applications/luci-app-vpnbypass/po/pt-br/vpnbypass.po @@ -0,0 +1,55 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: pt_BR\n" + +msgid "Configuration of VPN Bypass Settings" +msgstr "Configurações do VPN Bypass" + +msgid "Domains to Bypass" +msgstr "Domínios para evitar a VPN" + +msgid "Domains which will be accessed directly (outside of the VPN tunnel)" +msgstr "Domínios que serão acessados diretamente (fora do túnel VPN)" + +msgid "Enable VPN Bypass" +msgstr "Habilitar o VPN Bypass" + +msgid "Local IP Subnets to Bypass" +msgstr "Subredes IP locais para evitar a VPN" + +msgid "Local IP ranges with direct internet access (outside of the VPN tunnel)" +msgstr "Faixa de endereços IP locais que terão acesso internet direto (fora do túnel VPN)" + +msgid "Local Ports to Bypass" +msgstr "Portas locais para evitar a VPN" + +msgid "Local ports to trigger VPN Bypass" +msgstr "Portas locais para disparar o VPN Bypass" + +msgid "Remote IP Subnets to Bypass" +msgstr "Subredes IP remotas para evitar a VPN" + +msgid "Remote IP ranges which will be accessed directly (outside of the VPN tunnel)" +msgstr "Faixa de endereços IP remotos que serão acessados diretamente (fora do túnel VPN)" + +msgid "Remote Ports to Bypass" +msgstr "Portas remotas para evitar a VPN" + +msgid "Remote ports to trigger VPN Bypass" +msgstr "Portas remotas para disparar o VPN Bypass" + +msgid "VPN Bypass" +msgstr "VPN Bypass" + +msgid "VPN Bypass Settings" +msgstr "Configurações do VPN Bypass" diff --git a/package/luci/applications/luci-app-watchcat/po/pt-br/watchcat.po b/package/luci/applications/luci-app-watchcat/po/pt-br/watchcat.po index fe97036379..e37066c3d9 100644 --- a/package/luci/applications/luci-app-watchcat/po/pt-br/watchcat.po +++ b/package/luci/applications/luci-app-watchcat/po/pt-br/watchcat.po @@ -1,15 +1,16 @@ msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"PO-Revision-Date: 2014-03-29 23:20+0200\n" -"Last-Translator: Luiz Angelo \n" +"Project-Id-Version: \n" +"PO-Revision-Date: 2017-02-20 18:10-0300\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" "Language-Team: none\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Pootle 2.0.6\n" +"X-Generator: Poedit 1.8.11\n" +"POT-Creation-Date: \n" msgid "Forced reboot delay" msgstr "Atraso para reinício forçado" @@ -51,15 +52,13 @@ msgstr "Período de ping" msgid "Watchcat" msgstr "Watchcat" -#, fuzzy msgid "" "Watchcat allows configuring a periodic reboot when the Internet connection " "has been lost for a certain period of time." msgstr "" -"Watchcat permite que se configure um período para reiniciar e/ou quando a " +"Watchcat permite a configuração de um período para reiniciar e/ou quando a " "conexão com à Internet foi perdida por um ser período de tempo." -#, fuzzy msgid "" "When rebooting the system, the watchcat will trigger a soft reboot. Entering " "a non zero value here will trigger a delayed hard reboot if the soft reboot " diff --git a/package/luci/applications/luci-app-wifischedule/po/pt-br/wifischedule.po b/package/luci/applications/luci-app-wifischedule/po/pt-br/wifischedule.po new file mode 100644 index 0000000000..19e31b54ca --- /dev/null +++ b/package/luci/applications/luci-app-wifischedule/po/pt-br/wifischedule.po @@ -0,0 +1,114 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: pt_BR\n" + +msgid "Activate wifi" +msgstr "Ativar a WiFi" + +msgid "Could not find required /usr/bin/wifi_schedule.sh or /sbin/wifi" +msgstr "" +"Não foi possível localizar os programas necessários '/usr/bin/wifi_schedule." +"sh' ou '/sbin/wifi'." + +msgid "Could not find required programm /usr/bin/iwinfo" +msgstr "Não foi possível localizar o programa necessário '/usr/bin/iwinfo'" + +msgid "Cron Jobs" +msgstr "Tarefas da Cron" + +msgid "Day(s) of Week" +msgstr "Dia(s) da semana" + +msgid "Defines a schedule when to turn on and off wifi." +msgstr "Define um agendamento para quando ligar ou desligar a WiFi." + +msgid "Determine Modules Automatically" +msgstr "Determinar os Módulos Automaticamente" + +msgid "Disable wifi gracefully" +msgstr "Desabilitar a WiFi amistosamente" + +msgid "Disabled wifi forced" +msgstr "WiFi foi desabilitada de forma forçada." + +msgid "Enable" +msgstr "Habilitar" + +msgid "Enable Wifi Schedule" +msgstr "Habilitar o agendamento da WiFi" + +msgid "Enable logging" +msgstr "Habilite os registros (log)" + +msgid "Force disabling wifi even if stations associated" +msgstr "Force a desativação da WiFi mesmo se existirem estações associadas " + +msgid "Friday" +msgstr "Sexta-feira" + +msgid "Global Settings" +msgstr "Configurações Globais" + +msgid "Monday" +msgstr "Segunda-Feira" + +msgid "Saturday" +msgstr "Sábado" + +msgid "Schedule" +msgstr "Agendamento" + +msgid "Schedule events" +msgstr "Eventos do agendamento" + +msgid "Start Time" +msgstr "Hora Inicial" + +msgid "Start WiFi" +msgstr "Iniciar WiFi" + +msgid "Stop Time" +msgstr "Hora Final" + +msgid "Stop WiFi" +msgstr "Parar WiFi" + +msgid "Sunday" +msgstr "Domingo" + +msgid "The value %s is invalid" +msgstr "O valor %s é inválido" + +msgid "Thursday" +msgstr "Quita-feira" + +msgid "Tuesday" +msgstr "Terça-feira" + +msgid "Unload Modules (experimental; saves more power)" +msgstr "Descarregar Módulos (experimental, poupa mais energia)" + +msgid "View Cron Jobs" +msgstr "Visualizar Tarefas da Cron" + +msgid "View Logfile" +msgstr "Visualizar o Arquivo de Registros (log)" + +msgid "Wednesday" +msgstr "Quarta-feira" + +msgid "Wifi Schedule" +msgstr "Agendamento da Wifi" + +msgid "Wifi Schedule Logfile" +msgstr "Arquivo de Registros (log) do Agendamento da Wifi" diff --git a/package/luci/applications/luci-app-wol/po/pt-br/wol.po b/package/luci/applications/luci-app-wol/po/pt-br/wol.po index 6a21a855b6..df66ad24b9 100644 --- a/package/luci/applications/luci-app-wol/po/pt-br/wol.po +++ b/package/luci/applications/luci-app-wol/po/pt-br/wol.po @@ -2,18 +2,18 @@ # msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-04-19 00:29+0200\n" -"PO-Revision-Date: 2011-10-11 20:31+0200\n" -"Last-Translator: Luiz Angelo \n" +"PO-Revision-Date: 2017-02-20 18:13-0300\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" "Language-Team: none\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Pootle 2.0.4\n" +"X-Generator: Poedit 1.8.11\n" msgid "Broadcast on all interfaces" msgstr "Broadcast em todas as interfaces" @@ -27,12 +27,11 @@ msgstr "Computador para acordar" msgid "Network interface to use" msgstr "Interfaces de rede para usar" -#, fuzzy msgid "" "Sometimes only one of the two tools works. If one fails, try the other one" msgstr "" -"Algumas vezes, somente uma das ferramentas funciona. Se uma delas falhar, " -"tente a outra" +"Algumas vezes, somente uma das duas ferramentas funciona. Se uma delas " +"falhar, tente a outra" msgid "Specifies the interface the WoL packet is sent on" msgstr "Especifica a interface para onde os pacotes de WoL serão enviados" @@ -54,3 +53,6 @@ msgstr "Acorda um computador" msgid "WoL program" msgstr "Programa WoL" + +#~ msgid "Send to broadcast address" +#~ msgstr "Enviar para o endereço de broadcast" diff --git a/package/luci/collections/luci-ssl-openssl/Makefile b/package/luci/collections/luci-ssl-openssl/Makefile index b5f4b091b1..d1e752e8b8 100644 --- a/package/luci/collections/luci-ssl-openssl/Makefile +++ b/package/luci/collections/luci-ssl-openssl/Makefile @@ -11,10 +11,10 @@ LUCI_BASENAME:=ssl-openssl LUCI_TITLE:=LuCI with HTTPS support (OpenSSL as SSL backend) LUCI_DESCRIPTION:=LuCI with OpenSSL as the SSL backend (libustream-openssl). \ - Note: px5g still requires libmbedtls (in LEDE) or libpolarssl (in Openwrt). \ - In LEDE it is also possible to replace px5g with openssl-util as uhttpd can \ - also generate keys with openssl commandline tools if px5g is not installed. -LUCI_DEPENDS:=+luci +libustream-openssl +px5g + OpenSSL cmd tools (openssl-util) are used by uhttpd for SSL key generation \ + instead of the default px5g. (If px5g is installed, uhttpd will prefer that.) + +LUCI_DEPENDS:=+luci +libustream-openssl +openssl-util include ../../luci.mk diff --git a/package/luci/collections/luci-ssl/Makefile b/package/luci/collections/luci-ssl/Makefile index ad2acf7874..8fb8ff4627 100644 --- a/package/luci/collections/luci-ssl/Makefile +++ b/package/luci/collections/luci-ssl/Makefile @@ -10,7 +10,7 @@ LUCI_TYPE:=col LUCI_BASENAME:=ssl LUCI_TITLE:=LuCI with HTTPS support (mbedTLS as SSL backend) -LUCI_DEPENDS:=+luci +libustream-mbedtls +px5g-mbedtls +LUCI_DEPENDS:=+luci +libustream-mbedtls +px5g include ../../luci.mk diff --git a/package/luci/contrib/package/freifunk-common/Makefile b/package/luci/contrib/package/freifunk-common/Makefile index c15f02dcf6..d9bbd994a1 100644 --- a/package/luci/contrib/package/freifunk-common/Makefile +++ b/package/luci/contrib/package/freifunk-common/Makefile @@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=freifunk-common -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) diff --git a/package/luci/luci.mk b/package/luci/luci.mk index 69aecaa250..137886f1b3 100644 --- a/package/luci/luci.mk +++ b/package/luci/luci.mk @@ -70,7 +70,8 @@ PKG_VERSION?=$(if $(DUMP),x,$(strip $(shell \ PKG_GITBRANCH?=$(if $(DUMP),x,$(strip $(shell \ variant="LuCI"; \ if git log -1 >/dev/null 2>/dev/null; then \ - branch="$$(git symbolic-ref --short -q HEAD 2>/dev/null)"; \ + branch="$$(git branch --remote --verbose --no-abbrev --contains 2>/dev/null | \ + sed -rne 's|^[^/]+/([^ ]+) [a-f0-9]{40} .+$$|\1|p' | head -n1)"; \ if [ "$$branch" != "master" ]; then \ variant="LuCI $$branch branch"; \ else \ diff --git a/package/luci/modules/luci-base/htdocs/luci-static/resources/cbi.js b/package/luci/modules/luci-base/htdocs/luci-static/resources/cbi.js index 5790e303dd..8e66cbc380 100644 --- a/package/luci/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/package/luci/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -118,6 +118,50 @@ var cbi_validators = { return false; }, + 'ipmask': function() + { + return cbi_validators.ipmask4.apply(this) || + cbi_validators.ipmask6.apply(this); + }, + + 'ipmask4': function() + { + var ip = this, mask = 32; + + if (ip.match(/^(\S+)\/(\S+)$/)) + { + ip = RegExp.$1; + mask = RegExp.$2; + } + + if (!isNaN(mask) && (mask < 0 || mask > 32)) + return false; + + if (isNaN(mask) && !cbi_validators.ip4addr.apply(mask)) + return false; + + return cbi_validators.ip4addr.apply(ip); + }, + + 'ipmask6': function() + { + var ip = this, mask = 128; + + if (ip.match(/^(\S+)\/(\S+)$/)) + { + ip = RegExp.$1; + mask = RegExp.$2; + } + + if (!isNaN(mask) && (mask < 0 || mask > 128)) + return false; + + if (isNaN(mask) && !cbi_validators.ip6addr.apply(mask)) + return false; + + return cbi_validators.ip6addr.apply(ip); + }, + 'port': function() { var p = Int(this); @@ -523,13 +567,6 @@ function cbi_init() { } } - nodes = document.querySelectorAll('[data-type]'); - - for (var i = 0, node; (node = nodes[i]) !== undefined; i++) { - cbi_validate_field(node, node.getAttribute('data-optional') === 'true', - node.getAttribute('data-type')); - } - nodes = document.querySelectorAll('[data-choices]'); for (var i = 0, node; (node = nodes[i]) !== undefined; i++) { @@ -562,6 +599,13 @@ function cbi_init() { cbi_dynlist_init(node, choices[2], choices[3], options); } + nodes = document.querySelectorAll('[data-type]'); + + for (var i = 0, node; (node = nodes[i]) !== undefined; i++) { + cbi_validate_field(node, node.getAttribute('data-optional') === 'true', + node.getAttribute('data-type')); + } + cbi_d_update(); } diff --git a/package/luci/modules/luci-base/luasrc/cbi/datatypes.lua b/package/luci/modules/luci-base/luasrc/cbi/datatypes.lua index 626ad91c75..036d6ff5e3 100644 --- a/package/luci/modules/luci-base/luasrc/cbi/datatypes.lua +++ b/package/luci/modules/luci-base/luasrc/cbi/datatypes.lua @@ -131,6 +131,48 @@ function ip6prefix(val) return ( val and val >= 0 and val <= 128 ) end +function ipmask(val) + return ipmask4(val) or ipmask6(val) +end + +function ipmask4(val) + local ip, mask = val:match("^([^/]+)/([^/]+)$") + local bits = tonumber(mask) + + if bits and (bits < 0 or bits > 32) then + return false + end + + if not bits and mask and not ip4addr(mask) then + return false + end + + return ip4addr(ip or val) +end + +function ipmask6(val) + local ip, mask = val:match("^([^/]+)/([^/]+)$") + local bits = tonumber(mask) + + if bits and (bits < 0 or bits > 128) then + return false + end + + if not bits and mask and not ip6addr(mask) then + return false + end + + return ip6addr(ip or val) +end + +function ip6hostid(val) + if val and val:match("^[a-fA-F0-9:]+$") and (#val > 2) then + return (ip6addr("2001:db8:0:0" .. val) or ip6addr("2001:db8:0:0:" .. val)) + end + + return false +end + function port(val) val = tonumber(val) return ( val and val >= 0 and val <= 65535 ) @@ -233,6 +275,28 @@ function wepkey(val) end end +function hexstring(val) + if val then + return (val:match("^[a-fA-F0-9]+$") ~= nil) + end + return false +end + +function hex(val, maxbytes) + maxbytes = tonumber(maxbytes) + if val and maxbytes ~= nil then + return ((val:match("^0x[a-fA-F0-9]+$") ~= nil) and (#val <= 2 + maxbytes * 2)) + end + return false +end + +function base64(val) + if val then + return (val:match("^[a-zA-Z0-9/+]+=?=?$") ~= nil) and (math.fmod(#val, 4) == 0) + end + return false +end + function string(val) return true -- Everything qualifies as valid string end @@ -378,29 +442,29 @@ function dateyyyymmdd(val) return false; end - local days_in_month = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } - - local function is_leap_year(year) - return (year % 4 == 0) and ((year % 100 ~= 0) or (year % 400 == 0)) - end - - function get_days_in_month(month, year) - if (month == 2) and is_leap_year(year) then - return 29 - else - return days_in_month[month] - end - end - if (year < 2015) then - return false - end - if ((month == 0) or (month > 12)) then - return false - end - if ((day == 0) or (day > get_days_in_month(month, year))) then - return false - end - return true + local days_in_month = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } + + local function is_leap_year(year) + return (year % 4 == 0) and ((year % 100 ~= 0) or (year % 400 == 0)) + end + + function get_days_in_month(month, year) + if (month == 2) and is_leap_year(year) then + return 29 + else + return days_in_month[month] + end + end + if (year < 2015) then + return false + end + if ((month == 0) or (month > 12)) then + return false + end + if ((day == 0) or (day > get_days_in_month(month, year))) then + return false + end + return true end return false end diff --git a/package/luci/modules/luci-base/luasrc/model/network.lua b/package/luci/modules/luci-base/luasrc/model/network.lua index 2d8336bf33..49d91b875a 100644 --- a/package/luci/modules/luci-base/luasrc/model/network.lua +++ b/package/luci/modules/luci-base/luasrc/model/network.lua @@ -950,6 +950,13 @@ function protocol.dns6addrs(self) return dns end +function protocol.ip6prefix(self) + local prefix = self:_ubus("ipv6-prefix") + if prefix and #prefix > 0 then + return "%s/%d" %{ prefix[1].address, prefix[1].mask } + end +end + function protocol.is_bridge(self) return (not self:is_virtual() and self:type() == "bridge") end diff --git a/package/luci/modules/luci-base/luasrc/view/cbi/mvalue.htm b/package/luci/modules/luci-base/luasrc/view/cbi/mvalue.htm index 246ef43aad..db17450d27 100644 --- a/package/luci/modules/luci-base/luasrc/view/cbi/mvalue.htm +++ b/package/luci/modules/luci-base/luasrc/view/cbi/mvalue.htm @@ -36,7 +36,7 @@ > <%=pcdata(self.vallist[i])%> - <% if i == self.size then write('
') end %> + <% if self.size and (i % self.size) == 0 then write('
') end %> <% end %> <% end %> diff --git a/package/luci/modules/luci-base/po/ca/base.po b/package/luci/modules/luci-base/po/ca/base.po index 044339bc0f..f72c2a634b 100644 --- a/package/luci/modules/luci-base/po/ca/base.po +++ b/package/luci/modules/luci-base/po/ca/base.po @@ -43,18 +43,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "Càrrega d'1 minut:" msgid "15 Minute Load:" msgstr "Càrrega de 15 minuts:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "Càrrega de 5 minuts:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -861,6 +888,9 @@ msgstr "Inhabilita el temporitzador HW-Beacon" msgid "Disabled" msgstr "Inhabilitat" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "Descarta les respostes RFC1918 des de dalt" @@ -1029,6 +1059,11 @@ msgstr "Activa/Desactiva" msgid "Enabled" msgstr "Habilitat" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "Habilita l'Spanning Tree Protocol a aquest pont" @@ -1075,6 +1110,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "" @@ -1325,6 +1366,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "Adreça IP" @@ -1418,6 +1462,9 @@ msgstr "" msgid "IPv6-Address" msgstr "Adreça IPv6" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6-en-IPv4 (RFC4213)" @@ -1684,6 +1731,22 @@ msgid "" "requests to" msgstr "" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1869,6 +1932,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "Manca l'extensió de protocol del protocol %q" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Mode" @@ -2122,6 +2188,9 @@ msgstr "Opció canviada" msgid "Option removed" msgstr "Opció treta" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2220,6 +2289,9 @@ msgstr "PID" msgid "PIN" msgstr "PIN" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "PPP" @@ -2349,6 +2421,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2414,6 +2489,12 @@ msgstr "" msgid "Quality" msgstr "Calidad" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2495,6 +2576,9 @@ msgstr "" msgid "Realtime Wireless" msgstr "" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "" @@ -2513,6 +2597,9 @@ msgstr "Rep" msgid "Receiver Antenna" msgstr "Antena receptora" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "Reconnex aquesta interfície" @@ -2564,6 +2651,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "Alguns ISP ho requereixen, per exemple el Charter amb DOCSIS 3" @@ -2579,6 +2669,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3296,6 +3391,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "Dispositiu USB" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "UUID" @@ -3397,6 +3495,11 @@ msgstr "Usat" msgid "Used Key Slot" msgstr "" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3657,6 +3760,9 @@ msgstr "fitxer DNS local" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3711,6 +3817,9 @@ msgstr "" msgid "tagged" msgstr "etiquetat" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "desconegut" diff --git a/package/luci/modules/luci-base/po/cs/base.po b/package/luci/modules/luci-base/po/cs/base.po index 8c850a26e8..3f6a4e10b9 100644 --- a/package/luci/modules/luci-base/po/cs/base.po +++ b/package/luci/modules/luci-base/po/cs/base.po @@ -41,18 +41,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "Zatížení za 1 minutu:" msgid "15 Minute Load:" msgstr "Zatížení za 15 minut:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "Zatížení za 5 minut:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -867,6 +894,9 @@ msgstr "Zakázat HW-Beacon časovač" msgid "Disabled" msgstr "Zakázáno" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "Vyřadit upstream RFC1918 odpovědi" @@ -1039,6 +1069,11 @@ msgstr "Povolit/Zakázat" msgid "Enabled" msgstr "Povoleno" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "Na tomto síťovém mostě povolit Spanning Tree Protocol" @@ -1087,6 +1122,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "Externí protokolovací server" @@ -1336,6 +1377,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "IP adresy" @@ -1429,6 +1473,9 @@ msgstr "" msgid "IPv6-Address" msgstr "IPv6 adresa" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6-in-IPv4 (RFC4213)" @@ -1699,6 +1746,22 @@ msgstr "" "Seznam DNS serverů, na které " "přeposílat požadavky" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1891,6 +1954,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "Chybějící rozšíření protokolu %q" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Mód" @@ -2143,6 +2209,9 @@ msgstr "Volba změněna" msgid "Option removed" msgstr "Volba odstraněna" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2243,6 +2312,9 @@ msgstr "PID" msgid "PIN" msgstr "PIN" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "PPP" @@ -2372,6 +2444,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2439,6 +2514,12 @@ msgstr "" msgid "Quality" msgstr "Kvalita" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2533,6 +2614,9 @@ msgstr "Provoz v reálném čase" msgid "Realtime Wireless" msgstr "Wireless v reálném čase" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "Opětovné nastavení ochrany" @@ -2551,6 +2635,9 @@ msgstr "Přijmout" msgid "Receiver Antenna" msgstr "Přijímací anténa" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "Přepojit toto rozhraní" @@ -2602,6 +2689,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + # Charter je poskytovate msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "Vyžadováno u některých ISP, např. Charter s DocSIS 3" @@ -2618,6 +2708,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3362,6 +3457,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "USB zařízení" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "UUID" @@ -3469,6 +3567,11 @@ msgstr "Použit" msgid "Used Key Slot" msgstr "" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3726,6 +3829,9 @@ msgstr "místní DNS soubor" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3780,6 +3886,9 @@ msgstr "" msgid "tagged" msgstr "označený" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "neznámý" diff --git a/package/luci/modules/luci-base/po/de/base.po b/package/luci/modules/luci-base/po/de/base.po index e44d8bb234..ea2d7c917e 100644 --- a/package/luci/modules/luci-base/po/de/base.po +++ b/package/luci/modules/luci-base/po/de/base.po @@ -43,18 +43,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "Systemlast (1 Minute):" msgid "15 Minute Load:" msgstr "Systemlast (15 Minuten):" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "Systemlast (5 Minuten):" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -862,6 +889,9 @@ msgstr "Deaktiviere Hardware-Beacon Zeitgeber" msgid "Disabled" msgstr "Deaktiviert" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "Eingehende RFC1918-Antworten verwerfen" @@ -1034,6 +1064,11 @@ msgstr "Aktivieren/Deaktivieren" msgid "Enabled" msgstr "Aktiviert" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "Aktiviert das Spanning Tree Protokoll auf dieser Netzwerkbrücke" @@ -1083,6 +1118,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "Externer Protokollserver IP" @@ -1335,6 +1376,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "IP-Adresse" @@ -1428,6 +1472,9 @@ msgstr "" msgid "IPv6-Address" msgstr "IPv6-Adresse" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6-in-IPv4 (RFC4213)" @@ -1699,6 +1746,22 @@ msgstr "" "Liste von DNS-Servern an welche " "Requests weitergeleitet werden" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1894,6 +1957,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "Erweiterung für Protokoll %q fehlt" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Modus" @@ -2148,6 +2214,9 @@ msgstr "Option geändert" msgid "Option removed" msgstr "Option entfernt" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2248,6 +2317,9 @@ msgstr "PID" msgid "PIN" msgstr "PIN" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "PPP" @@ -2377,6 +2449,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2444,6 +2519,12 @@ msgstr "" msgid "Quality" msgstr "Qualität" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2539,6 +2620,9 @@ msgstr "Echtzeitverkehr" msgid "Realtime Wireless" msgstr "Echtzeit-WLAN-Signal" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "DNS-Rebind-Schutz" @@ -2557,6 +2641,9 @@ msgstr "Empfangen" msgid "Receiver Antenna" msgstr "Empfangsantenne" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "Diese Schnittstelle neu verbinden" @@ -2608,6 +2695,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "" "Wird von bestimmten Internet-Providern benötigt, z.B. Charter mit DOCSIS 3" @@ -2624,6 +2714,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3385,6 +3480,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "USB-Gerät" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "UUID" @@ -3493,6 +3591,11 @@ msgstr "Belegt" msgid "Used Key Slot" msgstr "Benutzer Schlüsselindex" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3750,6 +3853,9 @@ msgstr "Lokale DNS-Datei" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3804,6 +3910,9 @@ msgstr "" msgid "tagged" msgstr "tagged" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "unbekannt" diff --git a/package/luci/modules/luci-base/po/el/base.po b/package/luci/modules/luci-base/po/el/base.po index a196f5b08e..8b11a99f08 100644 --- a/package/luci/modules/luci-base/po/el/base.po +++ b/package/luci/modules/luci-base/po/el/base.po @@ -43,18 +43,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "Φορτίο 1 λεπτού:" msgid "15 Minute Load:" msgstr "Φορτίο 15 λεπτών:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "Φορτίο 5 λεπτών:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -876,6 +903,9 @@ msgstr "Απενεργοποίηση χρονιστή HW-Beacon" msgid "Disabled" msgstr "Απενεργοποιημένο" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "Αγνόησε τις απαντήσεις ανοδικής ροής RFC1918" @@ -1051,6 +1081,11 @@ msgstr "Ενεργοποίηση/Απενεργοποίηση" msgid "Enabled" msgstr "Ενεργοποιημένο" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "" @@ -1100,6 +1135,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "Εξωτερικός εξυπηρετητής καταγραφής συστήματος" @@ -1349,6 +1390,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "Διεύθυνση IP" @@ -1442,6 +1486,9 @@ msgstr "" msgid "IPv6-Address" msgstr "" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6-in-IPv4 (RFC4213)" @@ -1712,6 +1759,22 @@ msgid "" "requests to" msgstr "" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1898,6 +1961,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Λειτουργία" @@ -2152,6 +2218,9 @@ msgstr "Η επιλογή άλλαξε" msgid "Option removed" msgstr "Η επιλογή αφαιρέθηκε" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2250,6 +2319,9 @@ msgstr "PID" msgid "PIN" msgstr "PIN" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "PPP" @@ -2379,6 +2451,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2445,6 +2520,12 @@ msgstr "" msgid "Quality" msgstr "" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2526,6 +2607,9 @@ msgstr "Κίνηση πραγματικού χρόνου" msgid "Realtime Wireless" msgstr "" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "" @@ -2544,6 +2628,9 @@ msgstr "Λήψη" msgid "Receiver Antenna" msgstr "Κεραία Λήψης" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "Επανασύνδεση της διεπαφής" @@ -2595,6 +2682,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "" @@ -2610,6 +2700,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3321,6 +3416,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "Συσκευή USB" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "UUID" @@ -3422,6 +3520,11 @@ msgstr "Σε χρήση" msgid "Used Key Slot" msgstr "Χρησιμοποιούμενη Υποδοχή Κλειδιού" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3679,6 +3782,9 @@ msgstr "τοπικό αρχείο DNS" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3733,6 +3839,9 @@ msgstr "" msgid "tagged" msgstr "" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "" diff --git a/package/luci/modules/luci-base/po/en/base.po b/package/luci/modules/luci-base/po/en/base.po index 125314d83b..e11c0faac9 100644 --- a/package/luci/modules/luci-base/po/en/base.po +++ b/package/luci/modules/luci-base/po/en/base.po @@ -43,18 +43,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "1 Minute Load:" msgid "15 Minute Load:" msgstr "15 Minute Load:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "5 Minute Load:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -862,6 +889,9 @@ msgstr "Disable HW-Beacon timer" msgid "Disabled" msgstr "Disabled" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "" @@ -1030,6 +1060,11 @@ msgstr "Enable/Disable" msgid "Enabled" msgstr "Enabled" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "Enables the Spanning Tree Protocol on this bridge" @@ -1076,6 +1111,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "" @@ -1323,6 +1364,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "IP address" @@ -1416,6 +1460,9 @@ msgstr "" msgid "IPv6-Address" msgstr "" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "" @@ -1681,6 +1728,22 @@ msgid "" "requests to" msgstr "" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1866,6 +1929,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Mode" @@ -2119,6 +2185,9 @@ msgstr "" msgid "Option removed" msgstr "" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2217,6 +2286,9 @@ msgstr "PID" msgid "PIN" msgstr "" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "" @@ -2346,6 +2418,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2411,6 +2486,12 @@ msgstr "" msgid "Quality" msgstr "" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2492,6 +2573,9 @@ msgstr "" msgid "Realtime Wireless" msgstr "" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "" @@ -2510,6 +2594,9 @@ msgstr "Receive" msgid "Receiver Antenna" msgstr "Receiver Antenna" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "" @@ -2561,6 +2648,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "" @@ -2576,6 +2666,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3278,6 +3373,9 @@ msgstr "" msgid "USB Device" msgstr "" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "" @@ -3379,6 +3477,11 @@ msgstr "Used" msgid "Used Key Slot" msgstr "" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3635,6 +3738,9 @@ msgstr "local DNS file" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3689,6 +3795,9 @@ msgstr "" msgid "tagged" msgstr "" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "" diff --git a/package/luci/modules/luci-base/po/es/base.po b/package/luci/modules/luci-base/po/es/base.po index da786b69d6..bfc0305a2e 100644 --- a/package/luci/modules/luci-base/po/es/base.po +++ b/package/luci/modules/luci-base/po/es/base.po @@ -43,18 +43,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "Carga a 1 minuto:" msgid "15 Minute Load:" msgstr "Carga a 15 minutos:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "Carga a 5 minutos:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "" "BSSID" @@ -873,6 +900,9 @@ msgstr "Desactivar el temporizador de baliza hardware" msgid "Disabled" msgstr "Desactivar" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "Descartar respuestas RFC1918 salientes" @@ -1045,6 +1075,11 @@ msgstr "Activar/Desactivar" msgid "Enabled" msgstr "Activado" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "Activa el protocol STP en este puente" @@ -1094,6 +1129,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "Servidor externo de registro del sistema" @@ -1345,6 +1386,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "Dirección IP" @@ -1438,6 +1482,9 @@ msgstr "" msgid "IPv6-Address" msgstr "Dirección IPv6" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6-en-IPv4 (RFC4213)" @@ -1713,6 +1760,22 @@ msgstr "" "Lista de servidores DNS a los que " "enviar solicitudes" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1905,6 +1968,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "Extensión de protocolo faltante para %q" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Modo" @@ -2157,6 +2223,9 @@ msgstr "Opción cambiada" msgid "Option removed" msgstr "Opción eliminada" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2257,6 +2326,9 @@ msgstr "PID" msgid "PIN" msgstr "PIN" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "PPP" @@ -2386,6 +2458,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2453,6 +2528,12 @@ msgstr "" msgid "Quality" msgstr "Calidad" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2546,6 +2627,9 @@ msgstr "Tráfico en tiempo real" msgid "Realtime Wireless" msgstr "Red inalámbrica en tiempo real" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "Protección contra reasociación" @@ -2564,6 +2648,9 @@ msgstr "Recibir" msgid "Receiver Antenna" msgstr "Antena Receptora" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "Reconectar esta interfaz" @@ -2615,6 +2702,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "Necesario para ciertos ISPs, por ejemplo Charter con DOCSIS 3" @@ -2630,6 +2720,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3387,6 +3482,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "Dispositivo USB" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "UUID" @@ -3495,6 +3593,11 @@ msgstr "Usado" msgid "Used Key Slot" msgstr "Espacio de clave usado" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3754,6 +3857,9 @@ msgstr "Archvo DNS local" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3808,6 +3914,9 @@ msgstr "" msgid "tagged" msgstr "marcado" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "desconocido" diff --git a/package/luci/modules/luci-base/po/fr/base.po b/package/luci/modules/luci-base/po/fr/base.po index cce8ee20ad..8e610fb864 100644 --- a/package/luci/modules/luci-base/po/fr/base.po +++ b/package/luci/modules/luci-base/po/fr/base.po @@ -43,18 +43,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "Charge sur 1 minute :" msgid "15 Minute Load:" msgstr "Charge sur 15 minutes :" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "Charge sur 5 minutes :" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -880,6 +907,9 @@ msgstr "Désactiver l'émission périodique de balises wifi (« HW-Beacon »)" msgid "Disabled" msgstr "Désactivé" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "Jeter les réponses en RFC1918 amont" @@ -1055,6 +1085,11 @@ msgstr "Activer/Désactiver" msgid "Enabled" msgstr "Activé" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "" "Activer le protocole STP sur " @@ -1106,6 +1141,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "Serveur distant de journaux système" @@ -1357,6 +1398,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "Adresse IP" @@ -1450,6 +1494,9 @@ msgstr "" msgid "IPv6-Address" msgstr "Adresse IPv6" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6 dans IPv4 (RFC 4213)" @@ -1724,6 +1771,22 @@ msgstr "" "Liste des serveurs auquels sont transmis les requêtes DNS" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1919,6 +1982,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "Extention de protocole manquante pour le proto %q" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Mode" @@ -2170,6 +2236,9 @@ msgstr "Option modifiée" msgid "Option removed" msgstr "Option retirée" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2270,6 +2339,9 @@ msgstr "PID" msgid "PIN" msgstr "code PIN" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "PPP" @@ -2399,6 +2471,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2466,6 +2541,12 @@ msgstr "" msgid "Quality" msgstr "Qualitée" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2559,6 +2640,9 @@ msgstr "Trafic temps-réel" msgid "Realtime Wireless" msgstr "Qualité de réception actuelle" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "Protection contre l'attaque « rebind »" @@ -2577,6 +2661,9 @@ msgstr "Reçoit" msgid "Receiver Antenna" msgstr "Antenne émettrice" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "Reconnecter cet interface" @@ -2628,6 +2715,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "Nécessaire avec certains FAIs, par ex. : Charter avec DOCSIS 3" @@ -2643,6 +2733,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3405,6 +3500,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "Périphérique USB" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "UUID" @@ -3514,6 +3612,11 @@ msgstr "Utilisé" msgid "Used Key Slot" msgstr "Clé utilisée" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3772,6 +3875,9 @@ msgstr "fichier de résolution local" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3826,6 +3932,9 @@ msgstr "" msgid "tagged" msgstr "marqué" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "inconnu" diff --git a/package/luci/modules/luci-base/po/he/base.po b/package/luci/modules/luci-base/po/he/base.po index 0b11005ca0..70a1238e53 100644 --- a/package/luci/modules/luci-base/po/he/base.po +++ b/package/luci/modules/luci-base/po/he/base.po @@ -41,18 +41,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "עומס במשך דקה:" msgid "15 Minute Load:" msgstr "עומס במשך רבע שעה:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "עומס במשך 5 דקות:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "" @@ -854,6 +881,9 @@ msgstr "" msgid "Disabled" msgstr "" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "" @@ -1015,6 +1045,11 @@ msgstr "" msgid "Enabled" msgstr "אפשר" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "" @@ -1061,6 +1096,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "" @@ -1306,6 +1347,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "" @@ -1399,6 +1443,9 @@ msgstr "" msgid "IPv6-Address" msgstr "" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "" @@ -1656,6 +1703,22 @@ msgid "" "requests to" msgstr "" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1841,6 +1904,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "" @@ -2086,6 +2152,9 @@ msgstr "" msgid "Option removed" msgstr "" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2184,6 +2253,9 @@ msgstr "" msgid "PIN" msgstr "" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "" @@ -2313,6 +2385,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2378,6 +2453,12 @@ msgstr "" msgid "Quality" msgstr "" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2460,6 +2541,9 @@ msgstr "" msgid "Realtime Wireless" msgstr "" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "" @@ -2478,6 +2562,9 @@ msgstr "" msgid "Receiver Antenna" msgstr "" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "" @@ -2529,6 +2616,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "" @@ -2544,6 +2634,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3236,6 +3331,9 @@ msgstr "" msgid "USB Device" msgstr "" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "" @@ -3337,6 +3435,11 @@ msgstr "" msgid "Used Key Slot" msgstr "" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3586,6 +3689,9 @@ msgstr "" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3640,6 +3746,9 @@ msgstr "" msgid "tagged" msgstr "מתויג" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "" diff --git a/package/luci/modules/luci-base/po/hu/base.po b/package/luci/modules/luci-base/po/hu/base.po index 2b85df15aa..700efd964d 100644 --- a/package/luci/modules/luci-base/po/hu/base.po +++ b/package/luci/modules/luci-base/po/hu/base.po @@ -41,18 +41,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "Terhelés (utolsó 1 perc):" msgid "15 Minute Load:" msgstr "Terhelés (utolsó 15 perc):" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "Terhelés (utolsó 5 perc):" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -874,6 +901,9 @@ msgstr "Hardveres beacon időzítő letiltása" msgid "Disabled" msgstr "Letiltva" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "Beérkező RFC1918 DHCP válaszok elvetése. " @@ -1048,6 +1078,11 @@ msgstr "Engedélyezés/Letiltás" msgid "Enabled" msgstr "Engedélyezve" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "A Spanning Tree prokoll engedélyezése erre a hídra" @@ -1095,6 +1130,12 @@ msgstr "A bérelt címek lejárati ideje, a minimális érték 2 perc." msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "Külső rendszernapló kiszolgáló" @@ -1346,6 +1387,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "IP cím" @@ -1439,6 +1483,9 @@ msgstr "" msgid "IPv6-Address" msgstr "IPv6-cím" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6 IPv4-ben (RFC4213)" @@ -1713,6 +1760,22 @@ msgstr "" "DNS szerverek listája, ahová a " "kérések továbbításra kerülnek" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1908,6 +1971,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "Hiányzó protokoll kiterjesztés a %q progokoll számára" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Mód" @@ -2160,6 +2226,9 @@ msgstr "Beállítás módosítva" msgid "Option removed" msgstr "Beállítás eltávolítva" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2260,6 +2329,9 @@ msgstr "PID" msgid "PIN" msgstr "PIN" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "PPP" @@ -2389,6 +2461,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2456,6 +2531,12 @@ msgstr "" msgid "Quality" msgstr "Minőség" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2550,6 +2631,9 @@ msgstr "Valósidejű forgalom" msgid "Realtime Wireless" msgstr "Valósidejű vezetéknélküli adatok" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "Rebind elleni védelem" @@ -2568,6 +2652,9 @@ msgstr "Fogadás" msgid "Receiver Antenna" msgstr "Vevő antenna" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "Csatlakoztassa újra az interfészt" @@ -2619,6 +2706,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "" "Szükséges bizonyos internetszolgáltatók esetén, pl. Charter 'DOCSIS 3'-al" @@ -2635,6 +2725,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3393,6 +3488,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "USB eszköz" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "UUID" @@ -3501,6 +3599,11 @@ msgstr "Használt" msgid "Used Key Slot" msgstr "Használt kulcsindex" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3760,6 +3863,9 @@ msgstr "helyi DNS fájl" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3814,6 +3920,9 @@ msgstr "" msgid "tagged" msgstr "cimkézett" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "ismeretlen" diff --git a/package/luci/modules/luci-base/po/it/base.po b/package/luci/modules/luci-base/po/it/base.po index 2f5350dd78..06ae794f85 100644 --- a/package/luci/modules/luci-base/po/it/base.po +++ b/package/luci/modules/luci-base/po/it/base.po @@ -43,18 +43,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "Carico in 1 minuto:" msgid "15 Minute Load:" msgstr "Carico in 15 minut:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "Carico in 5 minuti:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "" "BSSID" @@ -878,6 +905,9 @@ msgstr "Disabilita Timer Beacon HW" msgid "Disabled" msgstr "Disabilitato" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "Ignora risposte RFC1918 upstream" @@ -1049,6 +1079,11 @@ msgstr "Abilita/Disabilita" msgid "Enabled" msgstr "Abilitato" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "Abilita il protocollo di Spanning Tree su questo bridge" @@ -1097,6 +1132,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "Server Log di Sistema esterno" @@ -1349,6 +1390,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "Indirizzo IP" @@ -1442,6 +1486,9 @@ msgstr "" msgid "IPv6-Address" msgstr "Indirizzo-IPv6" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6-in-IPv4 (RFC4213)" @@ -1715,6 +1762,22 @@ msgstr "" "Elenco di Server DNSa cui " "inoltrare le richieste in" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1906,6 +1969,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Modalità" @@ -2158,6 +2224,9 @@ msgstr "Opzione cambiata" msgid "Option removed" msgstr "Opzione cancellata" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2256,6 +2325,9 @@ msgstr "PID" msgid "PIN" msgstr "" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "" @@ -2385,6 +2457,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2450,6 +2525,12 @@ msgstr "" msgid "Quality" msgstr "" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2534,6 +2615,9 @@ msgstr "Traffico in tempo reale" msgid "Realtime Wireless" msgstr "" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "" @@ -2552,6 +2636,9 @@ msgstr "Ricezione" msgid "Receiver Antenna" msgstr "Antenna ricevente" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "Ricollega questa interfaccia" @@ -2603,6 +2690,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "" @@ -2618,6 +2708,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3344,6 +3439,9 @@ msgstr "" msgid "USB Device" msgstr "" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "" @@ -3452,6 +3550,11 @@ msgstr "Usato" msgid "Used Key Slot" msgstr "Slot Chiave Usata" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3713,6 +3816,9 @@ msgstr "File DNS locale" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3767,6 +3873,9 @@ msgstr "" msgid "tagged" msgstr "etichettato" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "sconosciuto" diff --git a/package/luci/modules/luci-base/po/ja/base.po b/package/luci/modules/luci-base/po/ja/base.po index ed72412540..96e52b013f 100644 --- a/package/luci/modules/luci-base/po/ja/base.po +++ b/package/luci/modules/luci-base/po/ja/base.po @@ -43,18 +43,45 @@ msgstr "-- デバイスで設定 --" msgid "-- match by label --" msgstr "-- ラベルで設定 --" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "過去1分の負荷:" msgid "15 Minute Load:" msgstr "過去15分の負荷:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "過去5分の負荷:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -873,6 +900,9 @@ msgstr "HWビーコンタイマーを無効にする" msgid "Disabled" msgstr "無効" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "RFC1918の応答を破棄します" @@ -1045,6 +1075,11 @@ msgstr "有効/無効" msgid "Enabled" msgstr "有効" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "スパニングツリー・プロトコルを有効にする" @@ -1094,6 +1129,12 @@ msgstr "" msgid "External" msgstr "外部" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "外部システムログ・サーバー" @@ -1344,6 +1385,9 @@ msgstr "ハイブリッド" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "IPアドレス" @@ -1437,6 +1481,9 @@ msgstr "" msgid "IPv6-Address" msgstr "IPv6-アドレス" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6-in-IPv4 (RFC4213)" @@ -1705,6 +1752,22 @@ msgstr "" "問い合わせを転送するDNS サーバーの" "リストを設定します" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "認証用 SSH暗号キー ファイルのリスト" @@ -1898,6 +1961,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "プロトコル %qのプロトコル拡張が見つかりません" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "モード" @@ -2151,6 +2217,9 @@ msgstr "変更されるオプション" msgid "Option removed" msgstr "削除されるオプション" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2251,6 +2320,9 @@ msgstr "PID" msgid "PIN" msgstr "PIN" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "PPP" @@ -2380,6 +2452,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "事前共有鍵" @@ -2447,6 +2522,12 @@ msgstr "" msgid "Quality" msgstr "クオリティ" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2542,6 +2623,9 @@ msgstr "リアルタイム・トラフィック" msgid "Realtime Wireless" msgstr "リアルタイム・無線LAN" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "DNSリバインディング・プロテクション" @@ -2560,6 +2644,9 @@ msgstr "受信" msgid "Receiver Antenna" msgstr "受信アンテナ" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "インターフェースの再接続" @@ -2611,6 +2698,9 @@ msgstr "" msgid "Require TLS" msgstr "TLSが必要" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "DOCSIS 3.0を使用するいくつかのISPでは必要になります" @@ -2626,6 +2716,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3368,6 +3463,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "USBデバイス" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "UUID" @@ -3477,6 +3575,11 @@ msgstr "使用" msgid "Used Key Slot" msgstr "使用するキースロット" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3735,6 +3838,9 @@ msgstr "ローカル DNSファイル" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3789,6 +3895,9 @@ msgstr "ステートレス + ステートフル" msgid "tagged" msgstr "tagged" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "不明" diff --git a/package/luci/modules/luci-base/po/ko/base.po b/package/luci/modules/luci-base/po/ko/base.po index 9a1a815785..59372bd976 100644 --- a/package/luci/modules/luci-base/po/ko/base.po +++ b/package/luci/modules/luci-base/po/ko/base.po @@ -43,18 +43,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "1 분 부하:" msgid "15 Minute Load:" msgstr "15 분 부하:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "5 분 부하:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "" @@ -862,6 +889,9 @@ msgstr "" msgid "Disabled" msgstr "" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "" @@ -1028,6 +1058,11 @@ msgstr "활성/비활성" msgid "Enabled" msgstr "활성화됨" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "이 bridge 에 Spanning Tree Protocol 활성화합니다" @@ -1074,6 +1109,12 @@ msgstr "임대한 주소의 유효 시간. 최소값은 2 분 (2m msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "외부 system log 서버" @@ -1244,7 +1285,7 @@ msgid "Global network options" msgstr "" msgid "Go to password configuration..." -msgstr "" +msgstr "암호 설정 하기" msgid "Go to relevant configuration page" msgstr "" @@ -1322,6 +1363,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "IP 주소" @@ -1415,6 +1459,9 @@ msgstr "" msgid "IPv6-Address" msgstr "IPv6-주소" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "" @@ -1673,6 +1720,22 @@ msgid "" "requests to" msgstr "" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1859,6 +1922,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "" @@ -2000,7 +2066,7 @@ msgid "No package lists available" msgstr "" msgid "No password set!" -msgstr "" +msgstr "암호 설정을 해주세요!" msgid "No rules in this chain" msgstr "" @@ -2110,6 +2176,9 @@ msgstr "변경된 option" msgid "Option removed" msgstr "삭제된 option" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2210,6 +2279,9 @@ msgstr "" msgid "PIN" msgstr "" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "" @@ -2339,6 +2411,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2404,6 +2479,12 @@ msgstr "" msgid "Quality" msgstr "" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2487,6 +2568,9 @@ msgstr "실시간 트래픽" msgid "Realtime Wireless" msgstr "" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "" @@ -2505,6 +2589,9 @@ msgstr "" msgid "Receiver Antenna" msgstr "" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "이 인터페이스를 재연결합니다" @@ -2556,6 +2643,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "특정 ISP 들에 요구됨. 예: Charter (DOCSIS 3 기반)" @@ -2571,6 +2661,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -2734,7 +2829,7 @@ msgid "Service Type" msgstr "" msgid "Services" -msgstr "Services" +msgstr "서비스" msgid "Set up Time Synchronization" msgstr "" @@ -3120,6 +3215,8 @@ msgid "" "There is no password set on this router. Please configure a root password to " "protect the web interface and enable SSH." msgstr "" +"이 공유기에 암호 설정이 되지 않았습니다. 웹 UI 와 SSH 부분을 보호하기 위해서 " +"꼭 root 암호를 설정해 주세요." msgid "This IPv4 address of the relay" msgstr "" @@ -3278,6 +3375,9 @@ msgstr "" msgid "USB Device" msgstr "" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "" @@ -3387,6 +3487,11 @@ msgstr "" msgid "Used Key Slot" msgstr "" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3642,6 +3747,9 @@ msgstr "local DNS 파일" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3696,6 +3804,9 @@ msgstr "" msgid "tagged" msgstr "" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "" diff --git a/package/luci/modules/luci-base/po/ms/base.po b/package/luci/modules/luci-base/po/ms/base.po index 8ba922f87f..517d237d91 100644 --- a/package/luci/modules/luci-base/po/ms/base.po +++ b/package/luci/modules/luci-base/po/ms/base.po @@ -43,18 +43,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "" msgid "15 Minute Load:" msgstr "" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -835,6 +862,9 @@ msgstr "Mematikan pemasa HW-Beacon" msgid "Disabled" msgstr "" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "" @@ -1000,6 +1030,11 @@ msgstr "" msgid "Enabled" msgstr "" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "Aktifkan spanning Tree Protokol di jambatan ini" @@ -1046,6 +1081,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "" @@ -1293,6 +1334,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "Alamat IP" @@ -1386,6 +1430,9 @@ msgstr "" msgid "IPv6-Address" msgstr "" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "" @@ -1652,6 +1699,22 @@ msgid "" "requests to" msgstr "" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1839,6 +1902,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Mode" @@ -2091,6 +2157,9 @@ msgstr "" msgid "Option removed" msgstr "" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2189,6 +2258,9 @@ msgstr "PID" msgid "PIN" msgstr "" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "" @@ -2318,6 +2390,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2383,6 +2458,12 @@ msgstr "" msgid "Quality" msgstr "" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2463,6 +2544,9 @@ msgstr "" msgid "Realtime Wireless" msgstr "" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "" @@ -2481,6 +2565,9 @@ msgstr "Menerima" msgid "Receiver Antenna" msgstr "Antena Penerima" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "" @@ -2532,6 +2619,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "" @@ -2547,6 +2637,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3254,6 +3349,9 @@ msgstr "" msgid "USB Device" msgstr "" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "" @@ -3355,6 +3453,11 @@ msgstr "Diguna" msgid "Used Key Slot" msgstr "" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3606,6 +3709,9 @@ msgstr "Fail DNS tempatan" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3660,6 +3766,9 @@ msgstr "" msgid "tagged" msgstr "" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "" diff --git a/package/luci/modules/luci-base/po/no/base.po b/package/luci/modules/luci-base/po/no/base.po index f9dad0a4e6..d17e4aadd9 100644 --- a/package/luci/modules/luci-base/po/no/base.po +++ b/package/luci/modules/luci-base/po/no/base.po @@ -38,18 +38,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "1 minutts belastning:" msgid "15 Minute Load:" msgstr "15 minutters belastning:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "5 minutters belastning:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -863,6 +890,9 @@ msgstr "Deaktiver HW-Beacon timer" msgid "Disabled" msgstr "Deaktivert" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "Forkast oppstrøms RFC1918 svar" @@ -1035,6 +1065,11 @@ msgstr "Aktiver/Deaktiver" msgid "Enabled" msgstr "Aktivert" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "Aktiverer Spanning Tree Protocol på denne broen" @@ -1082,6 +1117,12 @@ msgstr "Utløpstid på leide adresser, minimum er 2 minutter (2m)." msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "Ekstern systemlogg server" @@ -1332,6 +1373,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "IP adresse" @@ -1425,6 +1469,9 @@ msgstr "" msgid "IPv6-Address" msgstr "IPv6-Adresse" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6-i-IPv4 (RFC4213)" @@ -1691,6 +1738,22 @@ msgstr "" "Liste med DNS servere som " "forespørsler blir videresendt til" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1882,6 +1945,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "Mangler protokoll utvidelse for proto %q" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Modus" @@ -2135,6 +2201,9 @@ msgstr "Innstilling endret" msgid "Option removed" msgstr "Innstilling fjernet" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2235,6 +2304,9 @@ msgstr "PID" msgid "PIN" msgstr "PIN" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "PPP" @@ -2364,6 +2436,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2431,6 +2506,12 @@ msgstr "" msgid "Quality" msgstr "Kvalitet" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2524,6 +2605,9 @@ msgstr "Trafikk Sanntid" msgid "Realtime Wireless" msgstr "Trådløst i sanntid" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "Binde beskyttelse" @@ -2542,6 +2626,9 @@ msgstr "Motta" msgid "Receiver Antenna" msgstr "Mottak antenne" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "Koble til igjen" @@ -2593,6 +2680,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "Er nødvendig for noen nettleverandører, f.eks Charter med DOCSIS 3" @@ -2608,6 +2698,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3359,6 +3454,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "USB Enhet" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "UUID" @@ -3467,6 +3565,11 @@ msgstr "Brukt" msgid "Used Key Slot" msgstr "Brukte Nøkler" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3726,6 +3829,9 @@ msgstr "lokal DNS-fil" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3780,6 +3886,9 @@ msgstr "" msgid "tagged" msgstr "tagget" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "ukjent" diff --git a/package/luci/modules/luci-base/po/pl/base.po b/package/luci/modules/luci-base/po/pl/base.po index a78584cbbc..8b0368bdeb 100644 --- a/package/luci/modules/luci-base/po/pl/base.po +++ b/package/luci/modules/luci-base/po/pl/base.po @@ -44,18 +44,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "Obciążenie 1 min.:" msgid "15 Minute Load:" msgstr "Obciążenie 15 min.:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "Obciążenie 5 min.:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -885,6 +912,9 @@ msgstr "Wyłącz zegar HW-Beacon" msgid "Disabled" msgstr "Wyłączony" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "Odrzuć wychodzące odpowiedzi RFC1918" @@ -1062,6 +1092,11 @@ msgstr "Wlącz/Wyłącz" msgid "Enabled" msgstr "Włączony" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "" "Włącz protokół STP na tym " @@ -1113,6 +1148,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "Zewnętrzny serwer dla loga systemowego" @@ -1369,6 +1410,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "Adres IP" @@ -1462,6 +1506,9 @@ msgstr "" msgid "IPv6-Address" msgstr "Adres IPv6" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6-w-IPv4 (RFC4213)" @@ -1736,6 +1783,22 @@ msgstr "" "Lista serwerów DNS do których będą " "przekazywane zapytania" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1928,6 +1991,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "Brakujące rozszerzenie protokołu dla protokołu %q" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Tryb" @@ -2180,6 +2246,9 @@ msgstr "Wartość zmieniona" msgid "Option removed" msgstr "Usunięto wartość" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2280,6 +2349,9 @@ msgstr "PID" msgid "PIN" msgstr "PIN" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "PPP" @@ -2411,6 +2483,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2479,6 +2554,12 @@ msgstr "" msgid "Quality" msgstr "Jakość" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2573,6 +2654,9 @@ msgstr "Ruch w czasie rzeczywistym" msgid "Realtime Wireless" msgstr "WiFi w czasie rzeczywistym" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "Przypisz ochronę" @@ -2591,6 +2675,9 @@ msgstr "Odebrane" msgid "Receiver Antenna" msgstr "Antena odbiorcza" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "Połącz ponownie ten interfejs" @@ -2642,6 +2729,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "Wymagany dla niektórych dostawców internetu, np. Charter z DOCSIS 3" @@ -2657,6 +2747,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3422,6 +3517,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "Urządzenie USB" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "UUID" @@ -3531,6 +3629,11 @@ msgstr "Użyte" msgid "Used Key Slot" msgstr "Użyte gniazdo klucza" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3791,6 +3894,9 @@ msgstr "lokalny plik DNS" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3846,6 +3952,9 @@ msgstr "" msgid "tagged" msgstr "tagowane" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "nieznane" diff --git a/package/luci/modules/luci-base/po/pt-br/base.po b/package/luci/modules/luci-base/po/pt-br/base.po index 0bcd6398d5..6315f7727d 100644 --- a/package/luci/modules/luci-base/po/pt-br/base.po +++ b/package/luci/modules/luci-base/po/pt-br/base.po @@ -1,20 +1,20 @@ msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-06-10 03:41+0200\n" -"PO-Revision-Date: 2014-03-29 23:31+0200\n" -"Last-Translator: Luiz Angelo \n" -"Language-Team: LANGUAGE \n" +"PO-Revision-Date: 2017-02-22 20:30-0300\n" +"Last-Translator: Luiz Angelo Daros de Luca \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Pootle 2.0.6\n" +"X-Generator: Poedit 1.8.11\n" +"Language-Team: \n" msgid "%s is untagged in multiple VLANs!" -msgstr "" +msgstr "%s está sem etiqueta em múltiplas VLANs!" msgid "(%d minute window, %d second interval)" msgstr "(janela de %d minutos, intervalo de %d segundos)" @@ -38,10 +38,15 @@ msgid "-- custom --" msgstr "-- personalizado --" msgid "-- match by device --" -msgstr "" +msgstr "-- casar por dispositivo --" msgid "-- match by label --" +msgstr "-- casar por rótulo --" + +msgid "-- match by uuid --" msgstr "" +"-- casar por UUID --" msgid "1 Minute Load:" msgstr "Carga 1 Minuto:" @@ -49,12 +54,38 @@ msgstr "Carga 1 Minuto:" msgid "15 Minute Load:" msgstr "Carga 15 Minutos:" +msgid "4-character hexadecimal ID" +msgstr "Identificador hexadecimal de 4 caracteres" + msgid "464XLAT (CLAT)" -msgstr "" +msgstr "464XLAT (CLAT)" msgid "5 Minute Load:" msgstr "Carga 5 Minutos:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" +"Identificador de 6 octetos como uma cadeia hexadecimal - sem dois pontos" + +msgid "802.11r Fast Transition" +msgstr "802.11r Fast Transition" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "Tempo de expiração máximo da consulta da Associação SA do 802.11w" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" +"Tempo de expiração de tentativa de consulta da Associação SA do 802.11w" + +msgid "802.11w Management Frame Protection" +msgstr "Proteção do Quadro de Gerenciamento do 802.11w" + +msgid "802.11w maximum timeout" +msgstr "Estouro de tempo máximo do 802.11w" + +msgid "802.11w retry timeout" +msgstr "Estouro de tempo da nova tentativa do 802.11w" + msgid "BSSID" msgstr "" "BSSID" @@ -100,6 +131,8 @@ msgstr "Roteador IPv6" msgid "IPv6-Suffix (hex)" msgstr "" +"IPv6-Suffix (hex)" msgid "LED Configuration" msgstr "Configuração do LED" @@ -131,19 +164,23 @@ msgid "%s - %s" msgstr "%s - %s" msgid "A43C + J43 + A43" -msgstr "" +msgstr "A43C + J43 + A43" msgid "A43C + J43 + A43 + V43" -msgstr "" +msgstr "A43C + J43 + A43 + V43" msgid "ADSL" msgstr "" +"ADSL" msgid "AICCU (SIXXS)" msgstr "" +"AICCU (SIXXS)" msgid "ANSI T1.413" -msgstr "" +msgstr "ANSI T1.413" msgid "APN" msgstr "APN" @@ -157,16 +194,20 @@ msgstr "" "abbr>" msgid "ATM (Asynchronous Transfer Mode)" -msgstr "" +msgstr "ATM (Asynchronous Transfer Mode)" msgid "ATM Bridges" msgstr "Ponte ATM" msgid "ATM Virtual Channel Identifier (VCI)" -msgstr "Identificador de Canal Virtual ATM (VCI)" +msgstr "" +"Identificador de Canal Virtual ATM (VCI)" msgid "ATM Virtual Path Identifier (VPI)" -msgstr "Identificador de Caminho Virtual ATM (VPI)" +msgstr "" +"Identificador de Caminho Virtual ATM (VPI)" msgid "" "ATM bridges expose encapsulated ethernet in AAL5 connections as virtual " @@ -181,10 +222,10 @@ msgid "ATM device number" msgstr "Número do dispositivo ATM" msgid "ATU-C System Vendor ID" -msgstr "" +msgstr "Identificador de" msgid "AYIYA" -msgstr "" +msgstr "AYIYA" msgid "Access Concentrator" msgstr "Concentrador de Acesso" @@ -234,7 +275,7 @@ msgid "Additional Hosts files" msgstr "Arquivos adicionais de equipamentos conhecidos (hosts)" msgid "Additional servers file" -msgstr "" +msgstr "Arquivo de servidores adicionais" msgid "Address" msgstr "Endereço" @@ -250,6 +291,8 @@ msgstr "Opções Avançadas" msgid "Aggregate Transmit Power(ACTATP)" msgstr "" +"Potência de Transmissão Agregada (ACTATP)" msgid "Alert" msgstr "Alerta" @@ -258,9 +301,11 @@ msgid "" "Allocate IP addresses sequentially, starting from the lowest available " "address" msgstr "" +"Alocar endereços IP sequencialmente, iniciando a partir do endereço mais " +"baixo disponível" msgid "Allocate IP sequentially" -msgstr "" +msgstr "Alocar endereços IP sequencialmente" msgid "Allow SSH password authentication" msgstr "" @@ -293,78 +338,81 @@ msgstr "" "exemplo, para os serviços RBL" msgid "Allowed IPs" -msgstr "" +msgstr "Endereços IP autorizados" msgid "" "Also see
Tunneling Comparison on SIXXS" msgstr "" +"Veja também a Comparação de Tunelamentos em SIXXS" msgid "Always announce default router" -msgstr "" +msgstr "Sempre anuncie o roteador padrão" msgid "Annex" -msgstr "" +msgstr "Anexo" msgid "Annex A + L + M (all)" -msgstr "" +msgstr "Anexos A + L + M (todo)" msgid "Annex A G.992.1" -msgstr "" +msgstr "Anexo A G.992.1" msgid "Annex A G.992.2" -msgstr "" +msgstr "Anexo A G.992.2" msgid "Annex A G.992.3" -msgstr "" +msgstr "Anexo A G.992.3" msgid "Annex A G.992.5" -msgstr "" +msgstr "Anexo A G.992.5" msgid "Annex B (all)" -msgstr "" +msgstr "Anexo B (todo)" msgid "Annex B G.992.1" -msgstr "" +msgstr "Anexo B G.992.1" msgid "Annex B G.992.3" -msgstr "" +msgstr "Anexo B G.992.3" msgid "Annex B G.992.5" -msgstr "" +msgstr "Anexo B G.992.5" msgid "Annex J (all)" -msgstr "" +msgstr "Anexo J (todo)" msgid "Annex L G.992.3 POTS 1" -msgstr "" +msgstr "Anexo L G.992.3 POTS 1" msgid "Annex M (all)" -msgstr "" +msgstr "Anexo M (todo)" msgid "Annex M G.992.3" -msgstr "" +msgstr "Anexo M G.992.3" msgid "Annex M G.992.5" -msgstr "" +msgstr "Anexo M G.992.5" msgid "Announce as default router even if no public prefix is available." msgstr "" +"Anuncie-se como rotador padrão mesmo se não existir um prefixo público." msgid "Announced DNS domains" -msgstr "" +msgstr "Domínios DNS anunciados" msgid "Announced DNS servers" -msgstr "" +msgstr "Servidores DNS anunciados" msgid "Anonymous Identity" -msgstr "" +msgstr "Identidade Anônima" msgid "Anonymous Mount" -msgstr "" +msgstr "Montagem Anônima" msgid "Anonymous Swap" -msgstr "" +msgstr "Espaço de Troca (swap) Anônimo" msgid "Antenna 1" msgstr "Antena 1" @@ -387,6 +435,8 @@ msgstr "Aplicar as alterações" msgid "" "Assign a part of given length of every public IPv6-prefix to this interface" msgstr "" +"Atribua uma parte do comprimento de cada prefixo IPv6 público para esta " +"interface" msgid "Assign interfaces..." msgstr "atribuir as interfaces" @@ -394,6 +444,8 @@ msgstr "atribuir as interfaces" msgid "" "Assign prefix parts using this hexadecimal subprefix ID for this interface." msgstr "" +"Atribua partes do prefixo usando este identificador hexadecimal do " +"subprefixo para esta interface" msgid "Associated Stations" msgstr "Estações associadas" @@ -402,16 +454,16 @@ msgid "Atheros 802.11%s Wireless Controller" msgstr "Controlador Wireless Atheros 802.11%s" msgid "Auth Group" -msgstr "" +msgstr "Grupo de Autenticação" msgid "AuthGroup" -msgstr "" +msgstr "Grupo de Autenticação" msgid "Authentication" msgstr "Autenticação" msgid "Authentication Type" -msgstr "" +msgstr "Tipo de Autenticação" msgid "Authoritative" msgstr "Autoritário" @@ -423,25 +475,29 @@ msgid "Auto Refresh" msgstr "Atualização Automática" msgid "Automatic" -msgstr "" +msgstr "Automático" msgid "Automatic Homenet (HNCP)" msgstr "" +"Rede Doméstica Automática (HNCP)" msgid "Automatically check filesystem for errors before mounting" msgstr "" +"Execute automaticamente a verificação do sistema de arquivos antes da " +"montagem do dispositivo" msgid "Automatically mount filesystems on hotplug" -msgstr "" +msgstr "Monte automaticamente o espaço de troca (swap) ao conectar" msgid "Automatically mount swap on hotplug" -msgstr "" +msgstr "Monte automaticamente o espaço de troca (swap) ao conectar" msgid "Automount Filesystem" -msgstr "" +msgstr "Montagem Automática de Sistema de Arquivo" msgid "Automount Swap" -msgstr "" +msgstr "Montagem Automática do Espaço de Troca (swap) " msgid "Available" msgstr "Disponível" @@ -453,13 +509,13 @@ msgid "Average:" msgstr "Média:" msgid "B43 + B43C" -msgstr "" +msgstr "B43 + B43C" msgid "B43 + B43C + V43" -msgstr "" +msgstr "B43 + B43C + V43" msgid "BR / DMR / AFTR" -msgstr "" +msgstr "BR / DMR / AFTR" msgid "BSSID" msgstr "BSSID" @@ -495,10 +551,10 @@ msgid "Bad address specified!" msgstr "Endereço especificado está incorreto!" msgid "Band" -msgstr "" +msgstr "Banda" msgid "Behind NAT" -msgstr "" +msgstr "Atrás da NAT" msgid "" "Below is the determined list of files to backup. It consists of changed " @@ -510,13 +566,15 @@ msgstr "" "padrões para a cópia de segurança definidos pelo usuário." msgid "Bind interface" -msgstr "" +msgstr "Interface Vinculada" msgid "Bind only to specific interfaces rather than wildcard address." msgstr "" +"Vincule somente para as explicitamenteinterfaces ao invés do endereço " +"coringa." msgid "Bind the tunnel to this interface (optional)." -msgstr "" +msgstr "Vincule o túnel a esta interface (opcional)" msgid "Bitrate" msgstr "Taxa de bits" @@ -549,12 +607,15 @@ msgid "" "Build/distribution specific feed definitions. This file will NOT be " "preserved in any sysupgrade." msgstr "" +"Fonte de pacotes específico da compilação/distribuição. Esta NÃO será " +"preservada em qualquer atualização do sistema." msgid "Buttons" msgstr "Botões" msgid "CA certificate; if empty it will be saved after the first connection." msgstr "" +"Certificado da CA; se em branco, será salvo depois da primeira conexão." msgid "CPU usage (%)" msgstr "Uso da CPU (%)" @@ -563,7 +624,7 @@ msgid "Cancel" msgstr "Cancelar" msgid "Category" -msgstr "" +msgstr "Categoria" msgid "Chain" msgstr "Cadeia" @@ -585,9 +646,10 @@ msgstr "Verificar" msgid "Check fileystems before mount" msgstr "" +"Execute a verificação do sistema de arquivos antes da montagem do dispositivo" msgid "Check this option to delete the existing networks from this radio." -msgstr "" +msgstr "Marque esta opção para remover as redes existentes neste rádio." msgid "Checksum" msgstr "Soma de verificação" @@ -614,7 +676,7 @@ msgid "Cipher" msgstr "Cifra" msgid "Cisco UDP encapsulation" -msgstr "" +msgstr "Encapsulamento UDP da Cisco" msgid "" "Click \"Generate archive\" to download a tar archive of the current " @@ -676,7 +738,7 @@ msgid "Connection Limit" msgstr "Limite de conexão" msgid "Connection to server fails when TLS cannot be used" -msgstr "" +msgstr "A conexão para este servidor falhará quando o TLS não puder ser usado" msgid "Connections" msgstr "Conexões" @@ -712,15 +774,17 @@ msgid "Custom Interface" msgstr "Interface Personalizada" msgid "Custom delegated IPv6-prefix" -msgstr "" +msgstr "Prefixo IPv6 delegado personalizado" msgid "" "Custom feed definitions, e.g. private feeds. This file can be preserved in a " "sysupgrade." msgstr "" +"Definições de fonte de pacotes personalizadas, ex: fontes privadas. Este " +"arquivo será preservado em uma atualização do sistema." msgid "Custom feeds" -msgstr "" +msgstr "Fontes de pacotes customizadas" msgid "" "Customizes the behaviour of the device DNS-Requests without " @@ -961,7 +1028,7 @@ msgstr "" "integrado" msgid "Dual-Stack Lite (RFC6333)" -msgstr "" +msgstr "Duas Pilhas Leve (RFC6333)" msgid "Dynamic DHCP" msgstr "" @@ -979,7 +1046,7 @@ msgstr "" "somente os clientes com atribuições estáticas serão servidos. " msgid "EA-bits length" -msgstr "" +msgstr "Comprimento dos bits EA" msgid "EAP-Method" msgstr "Método EAP" @@ -991,6 +1058,8 @@ msgid "" "Edit the raw configuration data above to fix any error and hit \"Save\" to " "reload the page." msgstr "" +"Edite os dados de configuração brutos abaixo para arrumar qualquer erro e " +"clique em \"Salvar\" para recarregar a página." msgid "Edit this interface" msgstr "Editar esta interface" @@ -1011,7 +1080,7 @@ msgid "Enable HE.net dynamic endpoint update" msgstr "Ativar a atualização de ponto final dinâmico HE.net" msgid "Enable IPv6 negotiation" -msgstr "" +msgstr "Ativar a negociação de IPv6" msgid "Enable IPv6 negotiation on the PPP link" msgstr "Ativar a negociação de IPv6 no enlace PPP" @@ -1023,7 +1092,7 @@ msgid "Enable NTP client" msgstr "Ativar o cliente NTP" msgid "Enable Single DES" -msgstr "" +msgstr "Habilitar DES Simples" msgid "Enable TFTP server" msgstr "Ativar servidor TFTP" @@ -1032,19 +1101,19 @@ msgid "Enable VLAN functionality" msgstr "Ativar funcionalidade de VLAN" msgid "Enable WPS pushbutton, requires WPA(2)-PSK" -msgstr "" +msgstr "Habilite o botão WPS. requer WPA(2)-PSK" msgid "Enable learning and aging" msgstr "Ativar o aprendizado e obsolescência" msgid "Enable mirroring of incoming packets" -msgstr "" +msgstr "Habilitar espelhamento dos pacotes entrantes" msgid "Enable mirroring of outgoing packets" -msgstr "" +msgstr "Habilitar espelhamento dos pacotes saintes" msgid "Enable the DF (Don't Fragment) flag of the encapsulating packets." -msgstr "" +msgstr "Habilita o campo DF (Não Fragmentar) dos pacotes encapsulados." msgid "Enable this mount" msgstr "Ativar esta montagem" @@ -1058,6 +1127,13 @@ msgstr "Ativar/Desativar" msgid "Enabled" msgstr "Ativado" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" +"Ativa a troca rápida entre pontos de acesso que pertencem ao mesmo Domínio " +"de Mobilidade" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "Ativa o protocolo STP nesta ponte" @@ -1068,10 +1144,10 @@ msgid "Encryption" msgstr "Cifragem" msgid "Endpoint Host" -msgstr "" +msgstr "Equipamento do ponto final" msgid "Endpoint Port" -msgstr "" +msgstr "Porta do ponto final" msgid "Erasing..." msgstr "Apagando..." @@ -1080,7 +1156,7 @@ msgid "Error" msgstr "Erro" msgid "Errored seconds (ES)" -msgstr "" +msgstr "Segundos com erro (ES)" msgid "Ethernet Adapter" msgstr "Adaptador Ethernet" @@ -1089,7 +1165,7 @@ msgid "Ethernet Switch" msgstr "Switch Ethernet" msgid "Exclude interfaces" -msgstr "" +msgstr "Excluir interfaces" msgid "Expand hosts" msgstr "Expandir arquivos de equipamentos conhecidos (hosts)" @@ -1097,7 +1173,6 @@ msgstr "Expandir arquivos de equipamentos conhecidos (hosts)" msgid "Expires" msgstr "Expira" -#, fuzzy msgid "" "Expiry time of leased addresses, minimum is 2 minutes (2m)." msgstr "" @@ -1105,7 +1180,13 @@ msgstr "" "code>)." msgid "External" -msgstr "" +msgstr "Externo" + +msgid "External R0 Key Holder List" +msgstr "Lista dos Detentor de Chave R0 Externa" + +msgid "External R1 Key Holder List" +msgstr "Lista dos Detentor de Chave R1 Externa" msgid "External system log server" msgstr "Servidor externo de registros do sistema (syslog)" @@ -1114,10 +1195,10 @@ msgid "External system log server port" msgstr "Porta do servidor externo de registro do sistema (syslog)" msgid "External system log server protocol" -msgstr "" +msgstr "Protocolo do servidor externo de registro do sistema (syslog)" msgid "Extra SSH command options" -msgstr "" +msgstr "Opções adicionais do comando SSH" msgid "Fast Frames" msgstr "Quadros Rápidos" @@ -1144,6 +1225,9 @@ msgid "" "Find all currently attached filesystems and swap and replace configuration " "with defaults based on what was detected" msgstr "" +"Encontre todos os sistemas de arquivos e espaços de troca (swap) atualmente " +"conectados e substitua a configuração com valores padrão baseados no que foi " +"detectado" msgid "Find and join network" msgstr "Procurar e conectar à rede" @@ -1164,7 +1248,7 @@ msgid "Firewall Status" msgstr "Estado do Firewall" msgid "Firmware File" -msgstr "" +msgstr "Arquivo da Firmware" msgid "Firmware Version" msgstr "Versão do Firmware" @@ -1203,16 +1287,18 @@ msgid "Force TKIP and CCMP (AES)" msgstr "Forçar TKIP e CCMP (AES)" msgid "Force use of NAT-T" -msgstr "" +msgstr "Force o uso do NAT-T" msgid "Form token mismatch" -msgstr "" +msgstr "Chave eletrônica do formulário não casa" msgid "Forward DHCP traffic" msgstr "Encaminhar tráfego DHCP" msgid "Forward Error Correction Seconds (FECS)" msgstr "" +"Segundos a frente de correção de erros ( FECS)" msgid "Forward broadcast traffic" msgstr "Encaminhar tráfego broadcast" @@ -1236,6 +1322,8 @@ msgid "" "Further information about WireGuard interfaces and peers at wireguard.io." msgstr "" +"Mais informações sobre interfaces e parceiros WireGuard em wireguard.io." msgid "GHz" msgstr "GHz" @@ -1256,10 +1344,10 @@ msgid "General Setup" msgstr "Configurações Gerais" msgid "General options for opkg" -msgstr "" +msgstr "Opções gerais para o opkg" msgid "Generate Config" -msgstr "" +msgstr "Gerar Configuração" msgid "Generate archive" msgstr "Gerar arquivo" @@ -1271,10 +1359,10 @@ msgid "Given password confirmation did not match, password not changed!" msgstr "A senha de confirmação informada não casa. Senha não alterada!" msgid "Global Settings" -msgstr "" +msgstr "Configurações Globais" msgid "Global network options" -msgstr "" +msgstr "Opções de rede globais" msgid "Go to password configuration..." msgstr "Ir para a configuração de senha..." @@ -1283,19 +1371,21 @@ msgid "Go to relevant configuration page" msgstr "Ir para a página de configuração pertinente" msgid "Group Password" -msgstr "" +msgstr "Senha do Grupo" msgid "Guest" -msgstr "" +msgstr "Convidado\t" msgid "HE.net password" msgstr "Senha HE.net" msgid "HE.net username" -msgstr "" +msgstr "Usuário do HE.net" msgid "HT mode (802.11n)" msgstr "" +"Modo HT " +"(802.11n)" # Não sei que contexto isto está sendo usado msgid "Handler" @@ -1306,9 +1396,11 @@ msgstr "Suspender" msgid "Header Error Code Errors (HEC)" msgstr "" +"Erros de Código de Erro de Cabeçalho (HEC)" msgid "Heartbeat" -msgstr "" +msgstr "Pulso de vida" msgid "" "Here you can configure the basic aspects of your device like its hostname or " @@ -1333,7 +1425,7 @@ msgstr "" "\">ESSID" msgid "Host" -msgstr "" +msgstr "Equipamento" msgid "Host entries" msgstr "Entradas de Equipamentos" @@ -1356,10 +1448,15 @@ msgid "Hostnames" msgstr "Nome dos equipamentos" msgid "Hybrid" -msgstr "" +msgstr "Híbrido" msgid "IKE DH Group" msgstr "" +"Grupo DH do IKE" + +msgid "IP Addresses" +msgstr "Endereços IP" msgid "IP address" msgstr "Endereço IP" @@ -1380,7 +1477,7 @@ msgid "IPv4 and IPv6" msgstr "IPv4 e IPv6" msgid "IPv4 assignment length" -msgstr "" +msgstr "Tamanho da atribuição IPv4" msgid "IPv4 broadcast" msgstr "Broadcast IPv4" @@ -1395,7 +1492,7 @@ msgid "IPv4 only" msgstr "Somente IPv4" msgid "IPv4 prefix" -msgstr "" +msgstr "Prefixo IPv4" msgid "IPv4 prefix length" msgstr "Tamanho do prefixo IPv4" @@ -1404,7 +1501,7 @@ msgid "IPv4-Address" msgstr "Endereço IPv4" msgid "IPv4-in-IPv4 (RFC2003)" -msgstr "" +msgstr "IPv4-in-IPv4 (RFC2003)" msgid "IPv6" msgstr "IPv6" @@ -1413,13 +1510,15 @@ msgid "IPv6 Firewall" msgstr "Firewall para IPv6" msgid "IPv6 Neighbours" -msgstr "" +msgstr "Vizinhos IPv6" msgid "IPv6 Settings" -msgstr "" +msgstr "Configurações IPv6" msgid "IPv6 ULA-Prefix" msgstr "" +"Prefixo ULA " +"IPv6" msgid "IPv6 WAN Status" msgstr "Estado IPv6 da WAN" @@ -1428,13 +1527,13 @@ msgid "IPv6 address" msgstr "Endereço IPv6" msgid "IPv6 address delegated to the local tunnel endpoint (optional)" -msgstr "" +msgstr "Endereços IPv6 delegados para o ponta local do túnel (opcional)" msgid "IPv6 assignment hint" -msgstr "" +msgstr "Sugestão de atribuição IPv6" msgid "IPv6 assignment length" -msgstr "" +msgstr "Tamanho da atribuição IPv6" msgid "IPv6 gateway" msgstr "Roteador padrão do IPv6" @@ -1449,11 +1548,14 @@ msgid "IPv6 prefix length" msgstr "Tamanho Prefixo IPv6" msgid "IPv6 routed prefix" -msgstr "" +msgstr "Prefixo roteável IPv6" msgid "IPv6-Address" msgstr "Endereço IPv6" +msgid "IPv6-PD" +msgstr "IPv6-PD" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6-in-IPv4 (RFC4213)" @@ -1467,10 +1569,10 @@ msgid "Identity" msgstr "Identidade PEAP" msgid "If checked, 1DES is enaled" -msgstr "" +msgstr "Se marcado, a cifragem 1DES será habilitada" msgid "If checked, encryption is disabled" -msgstr "" +msgstr "Se marcado, a cifragem estará desabilitada" msgid "" "If specified, mount the device by its UUID instead of a fixed device node" @@ -1526,6 +1628,8 @@ msgid "" "In order to prevent unauthorized access to the system, your request has been " "blocked. Click \"Continue »\" below to return to the previous page." msgstr "" +"Para prevenir acesso não autorizado neste sistema, sua requisição foi " +"bloqueada. Clique abaixo em \"Continuar »\" para retornar à página anterior." msgid "Inactivity timeout" msgstr "Tempo limite de inatividade" @@ -1546,7 +1650,7 @@ msgid "Install" msgstr "Instalar" msgid "Install iputils-traceroute6 for IPv6 traceroute" -msgstr "" +msgstr "Instale iputils-traceroute6 para rastrear rotas IPv6" msgid "Install package %q" msgstr "Instalar pacote %q" @@ -1573,7 +1677,7 @@ msgid "Interface is shutting down..." msgstr "A interface está desligando..." msgid "Interface name" -msgstr "" +msgstr "Nome da Interface" msgid "Interface not present or not connected yet." msgstr "A interface não está presente ou não está conectada ainda." @@ -1588,7 +1692,7 @@ msgid "Interfaces" msgstr "Interfaces" msgid "Internal" -msgstr "" +msgstr "Interno" msgid "Internal Server Error" msgstr "erro no servidor interno" @@ -1609,7 +1713,6 @@ msgstr "" msgid "Invalid username and/or password! Please try again." msgstr "Usuário e/ou senha inválida! Por favor, tente novamente." -#, fuzzy msgid "" "It appears that you are trying to flash an image that does not fit into the " "flash memory, please verify the image file!" @@ -1627,7 +1730,7 @@ msgid "Join Network: Wireless Scan" msgstr "Conectar à Rede: Busca por Rede Sem Fio" msgid "Joining Network: %q" -msgstr "" +msgstr "Juntando-se à rede %q" msgid "Keep settings" msgstr "Manter configurações" @@ -1672,13 +1775,13 @@ msgid "Language and Style" msgstr "Idioma e Estilo" msgid "Latency" -msgstr "" +msgstr "Latência" msgid "Leaf" -msgstr "" +msgstr "Folha" msgid "Lease time" -msgstr "" +msgstr "Tempo de concessão" msgid "Lease validity time" msgstr "Tempo de validade da atribuição" @@ -1706,21 +1809,23 @@ msgstr "Limite" msgid "Limit DNS service to subnets interfaces on which we are serving DNS." msgstr "" +"Limite o serviço DNS para subredes das interfaces nas quais estamos servindo " +"DNS." msgid "Limit listening to these interfaces, and loopback." -msgstr "" +msgstr "Escute somente nestas interfaces e na interface local (loopback) " msgid "Line Attenuation (LATN)" -msgstr "" +msgstr "Atenuação de Linha (LATN)" msgid "Line Mode" -msgstr "" +msgstr "Modo da Linha" msgid "Line State" -msgstr "" +msgstr "Estado da Linha" msgid "Line Uptime" -msgstr "" +msgstr "Tempo de Atividade da Linha" msgid "Link On" msgstr "Enlace Ativo" @@ -1732,8 +1837,34 @@ msgstr "" "Lista dos servidores DNS para " "encaminhar as requisições" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" +"Lista dos R0KHs no mesmo Domínio de Mobilidade.
Formato: Endereço " +"MAC, Identificador NAS, chave de 128 bits como cadeia hexadecimal.
" +"Esta lista é usada para mapear o Identificador R0KH (Identificador NAS) para " +"um endereço MAC de destino ao solicitar a chave PMK-R1 a partir do R0KH que " +"o STA usado durante a Associação de Domínio de Mobilidade Inicial." + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" +"Lista dos R1KHs no mesmo Domínio de Mobilidade.
Formato: Endereço " +"MAC, R1KH-ID como 6 octetos com dois pontos, chave de 128 bits como cadeia " +"hexadecimal.
Esta lista é usada para mapear o identificador R1KH para " +"um endereço MAC de destino ao enviar a chave PMK-R1 a partir do R0KH. Esta é " +"também a lista de R1KHs autorizados no MD que podem solicitar chaves PMK-R1." + msgid "List of SSH key files for auth" -msgstr "" +msgstr "Lista de arquivos de chaves SSH para autenticação" msgid "List of domains to allow RFC1918 responses for" msgstr "" @@ -1746,10 +1877,10 @@ msgstr "" "fornecem resultados errados para consultas a domínios inexistentes (NX)" msgid "Listen Interfaces" -msgstr "" +msgstr "Interfaces de Escuta" msgid "Listen Port" -msgstr "" +msgstr "Porta de Escuta" msgid "Listen only on the given interface or, if unspecified, on all" msgstr "" @@ -1768,7 +1899,7 @@ msgid "Loading" msgstr "Carregando" msgid "Local IP address to assign" -msgstr "" +msgstr "Endereço IP local para atribuir" msgid "Local IPv4 address" msgstr "Endereço IPv4 local" @@ -1777,7 +1908,7 @@ msgid "Local IPv6 address" msgstr "Endereço IPv6 local" msgid "Local Service Only" -msgstr "" +msgstr "Somente Serviço Local" msgid "Local Startup" msgstr "Iniciação Local" @@ -1788,7 +1919,6 @@ msgstr "Hora Local" msgid "Local domain" msgstr "Domínio Local" -#, fuzzy msgid "" "Local domain specification. Names matching this domain are never forwarded " "and are resolved from DHCP or hosts files only" @@ -1816,7 +1946,7 @@ msgid "Localise queries" msgstr "Localizar consultas" msgid "Locked to channel %s used by: %s" -msgstr "" +msgstr "Travado no canal %s usado por: %s" msgid "Log output level" msgstr "Nível de detalhamento de saída dos registros" @@ -1835,6 +1965,8 @@ msgstr "Sair" msgid "Loss of Signal Seconds (LOSS)" msgstr "" +"Segundos de Perda de Sinal (LOSS)" msgid "Lowest leased address as offset from the network address." msgstr "O endereço mais baixo concedido como deslocamento do endereço da rede." @@ -1852,13 +1984,13 @@ msgid "MAC-List" msgstr "Lista de MAC" msgid "MAP / LW4over6" -msgstr "" +msgstr "MAP / LW4over6" msgid "MB/s" msgstr "MB/s" msgid "MD5" -msgstr "" +msgstr "MD5" msgid "MHz" msgstr "MHz" @@ -1872,12 +2004,16 @@ msgid "" "Make sure to clone the root filesystem using something like the commands " "below:" msgstr "" +"Certifique-se que clonou o sistema de arquivos raiz com algo como o comando " +"abaixo:" msgid "Manual" -msgstr "" +msgstr "Manual" msgid "Max. Attainable Data Rate (ATTNDR)" msgstr "" +"Taxa de Dados Atingível Máxima (ATTNDR)" msgid "Maximum Rate" msgstr "Taxa Máxima" @@ -1902,6 +2038,8 @@ msgid "" "Maximum length of the name is 15 characters including the automatic protocol/" "bridge prefix (br-, 6in4-, pppoe- etc.)" msgstr "" +"Comprimento máximo do nome é de 15 caracteres, incluindo o prefixo " +"automático do protocolo/ponte (br-, 6in4- pppoe-, etc.)" msgid "Maximum number of leased addresses." msgstr "Número máximo de endereços atribuídos." @@ -1925,19 +2063,22 @@ msgid "Minimum hold time" msgstr "Tempo mínimo de espera" msgid "Mirror monitor port" -msgstr "" +msgstr "Porta de monitoramento do espelho" msgid "Mirror source port" -msgstr "" +msgstr "Porta de origem do espelho" msgid "Missing protocol extension for proto %q" msgstr "Extensão para o protocolo %q está ausente" +msgid "Mobility Domain" +msgstr "Domínio da Mobilidade" + msgid "Mode" msgstr "Modo" msgid "Model" -msgstr "" +msgstr "Modelo" msgid "Modem device" msgstr "Dispositivo do Modem" @@ -1971,7 +2112,7 @@ msgstr "" "anexado ao sistema de arquivos" msgid "Mount filesystems not specifically configured" -msgstr "" +msgstr "Monte sistemas de arquivos não especificamente configurados" msgid "Mount options" msgstr "Opções de montagem" @@ -1980,7 +2121,7 @@ msgid "Mount point" msgstr "Ponto de montagem" msgid "Mount swap not specifically configured" -msgstr "" +msgstr "Montar espalho de troca (swap) não especificamente configurado" msgid "Mounted file systems" msgstr "Sistemas de arquivos montados" @@ -2001,22 +2142,22 @@ msgid "NAS ID" msgstr "NAS ID" msgid "NAT-T Mode" -msgstr "" +msgstr "Modo NAT-T" msgid "NAT64 Prefix" -msgstr "" +msgstr "Prefixo NAT64" msgid "NDP-Proxy" -msgstr "" +msgstr "Proxy NDP" msgid "NT Domain" -msgstr "" +msgstr "Domínio NT" msgid "NTP server candidates" msgstr "Candidatos a servidor NTP" msgid "NTP sync time-out" -msgstr "" +msgstr "Tempo limite da sincronia do NTP" msgid "Name" msgstr "Nome" @@ -2052,7 +2193,7 @@ msgid "No DHCP Server configured for this interface" msgstr "Nenhum Servidor DHCP configurado para esta interface" msgid "No NAT-T" -msgstr "" +msgstr "Sem NAT-T" msgid "No chains in this table" msgstr "Nenhuma cadeira nesta tabela" @@ -2088,16 +2229,18 @@ msgid "Noise" msgstr "Ruído" msgid "Noise Margin (SNR)" -msgstr "" +msgstr "Margem de Ruído (SNR)" msgid "Noise:" msgstr "Ruído:" msgid "Non Pre-emtive CRC errors (CRC_P)" msgstr "" +"Erros CRC Não PreemptivosCRC_P" msgid "Non-wildcard" -msgstr "" +msgstr "Sem caracter curinga" msgid "None" msgstr "Nenhum" @@ -2118,7 +2261,7 @@ msgid "Note: Configuration files will be erased." msgstr "Nota: Os arquivos de configuração serão apagados." msgid "Note: interface name length" -msgstr "" +msgstr "Aviso: tamanho do nome da interface" msgid "Notice" msgstr "Aviso" @@ -2133,10 +2276,10 @@ msgid "OPKG-Configuration" msgstr "Configuração-OPKG" msgid "Obfuscated Group Password" -msgstr "" +msgstr "Senha Ofuscada do Grupo" msgid "Obfuscated Password" -msgstr "" +msgstr "Senha Ofuscada" msgid "Off-State Delay" msgstr "Atraso no estado de desligado" @@ -2167,7 +2310,7 @@ msgid "One or more fields contain invalid values!" msgstr "Um ou mais campos contém valores inválidos!" msgid "One or more invalid/required values on tab" -msgstr "" +msgstr "Um ou mais valores inválidos/obrigatórios na aba" msgid "One or more required fields have no value!" msgstr "Um ou mais campos obrigatórios não tem valor!" @@ -2176,10 +2319,10 @@ msgid "Open list..." msgstr "Abrir lista..." msgid "OpenConnect (CISCO AnyConnect)" -msgstr "" +msgstr "OpenConnect (CISCO AnyConnect)" msgid "Operating frequency" -msgstr "" +msgstr "Frequência de Operação" msgid "Option changed" msgstr "Opção alterada" @@ -2187,41 +2330,52 @@ msgstr "Opção alterada" msgid "Option removed" msgstr "Opção removida" +msgid "Optional" +msgstr "Opcional" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" +"Opcional, especifique para sobrescrever o servidor padrão (tic.sixxs.net)" msgid "Optional, use when the SIXXS account has more than one tunnel" -msgstr "" +msgstr "Opcional, para usar quando a conta SIXXS tem mais de um túnel" msgid "Optional." -msgstr "" +msgstr "Opcional." msgid "" "Optional. Adds in an additional layer of symmetric-key cryptography for post-" "quantum resistance." msgstr "" +"Opcional. Adiciona uma camada extra de cifragem simétrica para resistência " +"pós quântica." msgid "Optional. Create routes for Allowed IPs for this peer." -msgstr "" +msgstr "Opcional. Cria rotas para endereços IP Autorizados para este parceiro." msgid "" "Optional. Host of peer. Names are resolved prior to bringing up the " "interface." msgstr "" +"Opcional. Equipamento do parceiro. Nomes serão resolvido antes de levantar a " +"interface." msgid "Optional. Maximum Transmission Unit of tunnel interface." -msgstr "" +msgstr "Opcional. Unidade Máxima de Transmissão da interface do túnel." msgid "Optional. Port of peer." -msgstr "" +msgstr "Opcional. Porta do parceiro." msgid "" "Optional. Seconds between keep alive messages. Default is 0 (disabled). " "Recommended value if this device is behind a NAT is 25." msgstr "" +"Opcional. Segundos entre mensagens para manutenção da conexão. O padrão é 0 " +"(desabilitado). O valor recomendado caso este dispositivo esteja atrás de " +"uma NAT é 25." msgid "Optional. UDP port used for outgoing and incoming packets." -msgstr "" +msgstr "opcional. Porta UDP usada para pacotes saintes ou entrantes." msgid "Options" msgstr "Opções" @@ -2239,22 +2393,24 @@ msgid "Outdoor Channels" msgstr "Canais para externo" msgid "Output Interface" -msgstr "" +msgstr "Interface de Saída" msgid "Override MAC address" msgstr "Sobrescrever o endereço MAC" msgid "Override MTU" -msgstr "Sobrescrever o MTU" +msgstr "" +"Sobrescrever o MTU" msgid "Override TOS" -msgstr "" +msgstr "Sobrescrever o TOS" msgid "Override TTL" -msgstr "" +msgstr "Sobrescrever o TTL" msgid "Override default interface name" -msgstr "" +msgstr "Sobrescrever o nome da nova interface" msgid "Override the gateway in DHCP responses" msgstr "Sobrescrever o roteador padrão nas respostas do DHCP" @@ -2288,6 +2444,9 @@ msgstr "PID" msgid "PIN" msgstr "PIN" +msgid "PMK R1 Push" +msgstr "PMK R1 Push" + msgid "PPP" msgstr "PPP" @@ -2301,19 +2460,19 @@ msgid "PPPoE" msgstr "PPPoE" msgid "PPPoSSH" -msgstr "" +msgstr "PPPoSSH" msgid "PPtP" msgstr "PPtP" msgid "PSID offset" -msgstr "" +msgstr "Deslocamento PSID" msgid "PSID-bits length" -msgstr "" +msgstr "Comprimento dos bits PSID" msgid "PTM/EFM (Packet Transfer Mode)" -msgstr "" +msgstr "PTM/EFM (Modo de Transferência de Pacotes)" msgid "Package libiwinfo required!" msgstr "O pacote libiwinfo é necessário!" @@ -2340,7 +2499,7 @@ msgid "Password of Private Key" msgstr "Senha da Chave Privada" msgid "Password of inner Private Key" -msgstr "" +msgstr "Senha da Chave Privada interna" msgid "Password successfully changed!" msgstr "A senha foi alterada com sucesso!" @@ -2358,25 +2517,25 @@ msgid "Path to executable which handles the button event" msgstr "Caminho para o executável que trata o evento do botão" msgid "Path to inner CA-Certificate" -msgstr "" +msgstr "Caminho para os certificados CA interno" msgid "Path to inner Client-Certificate" -msgstr "" +msgstr "Caminho para o Certificado do Cliente interno" msgid "Path to inner Private Key" -msgstr "" +msgstr "Caminho para a Chave Privada interna" msgid "Peak:" msgstr "Pico:" msgid "Peer IP address to assign" -msgstr "" +msgstr "Endereço IP do parceiro para atribuir" msgid "Peers" -msgstr "" +msgstr "Parceiros" msgid "Perfect Forward Secrecy" -msgstr "" +msgstr "Sigilo Encaminhado Perfeito" msgid "Perform reboot" msgstr "Reiniciar o sistema" @@ -2385,7 +2544,7 @@ msgid "Perform reset" msgstr "Zerar configuração" msgid "Persistent Keep Alive" -msgstr "" +msgstr "Manutenção da Conexão Persistente" msgid "Phy Rate:" msgstr "Taxa física:" @@ -2412,13 +2571,17 @@ msgid "Port status:" msgstr "Status da porta" msgid "Power Management Mode" -msgstr "" +msgstr "Modo de Gerenciamento de Energia" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +"Erros CRC PreemptivosCRCP_P" + +msgid "Prefix Delegated" +msgstr "Prefixo Delegado" msgid "Preshared Key" -msgstr "" +msgstr "Chave Compartilhada" msgid "" "Presume peer to be dead after given amount of LCP echo failures, use 0 to " @@ -2428,7 +2591,7 @@ msgstr "" "echo do LCP. Use 0 para ignorar as falhas" msgid "Prevent listening on these interfaces." -msgstr "" +msgstr "Evite escutar nestas Interfaces." msgid "Prevents client-to-client communication" msgstr "Impede a comunicação de cliente para cliente" @@ -2437,7 +2600,7 @@ msgid "Prism2/2.5/3 802.11b Wireless Controller" msgstr "Prism2/2.5/3 802.11b Wireless Controlador" msgid "Private Key" -msgstr "" +msgstr "Chave Privada" msgid "Proceed" msgstr "Proceder" @@ -2446,7 +2609,7 @@ msgid "Processes" msgstr "Processos" msgid "Profile" -msgstr "" +msgstr "Perfil" msgid "Prot." msgstr "Protocolo" @@ -2473,19 +2636,27 @@ msgid "Pseudo Ad-Hoc (ahdemo)" msgstr "Ad-Hoc falso (ahdemo)" msgid "Public Key" -msgstr "" +msgstr "Chave Pública" msgid "Public prefix routed to this device for distribution to clients." msgstr "" +"Prefixo público roteado para este dispositivo para distribuição a seus " +"clientes." msgid "QMI Cellular" -msgstr "" +msgstr "Celular QMI" msgid "Quality" msgstr "Qualidade" +msgid "R0 Key Lifetime" +msgstr "Validade da Chave R0" + +msgid "R1 Key Holder" +msgstr "Detentor da Chave R1" + msgid "RFC3947 NAT-T mode" -msgstr "" +msgstr "Modo NAT-T (RFC3947)" msgid "RTS/CTS Threshold" msgstr "Limiar RTS/CTS" @@ -2544,7 +2715,6 @@ msgstr "" msgid "Really reset all changes?" msgstr "Realmente limpar todas as mudanças?" -#, fuzzy msgid "" "Really shut down network?\\nYou might lose access to this device if you are " "connected via this interface." @@ -2579,6 +2749,9 @@ msgstr "Tráfego em Tempo Real" msgid "Realtime Wireless" msgstr "Rede sem fio em Tempo Real" +msgid "Reassociation Deadline" +msgstr "Limite para Reassociação" + msgid "Rebind protection" msgstr "Proteção contra \"Rebind\"" @@ -2597,6 +2770,9 @@ msgstr "Receber" msgid "Receiver Antenna" msgstr "Antena de Recepção" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "Recomendado. Endereços IP da interface do WireGuard." + msgid "Reconnect this interface" msgstr "Reconectar esta interface" @@ -2625,7 +2801,7 @@ msgid "Remote IPv4 address" msgstr "Endereço IPv4 remoto" msgid "Remote IPv4 address or FQDN" -msgstr "" +msgstr "Endereço IPv4 remoto ou FQDN" msgid "Remove" msgstr "Remover" @@ -2640,33 +2816,47 @@ msgid "Replace wireless configuration" msgstr "Substituir a configuração da rede sem fio" msgid "Request IPv6-address" -msgstr "" +msgstr "Solicita endereço IPv6" msgid "Request IPv6-prefix of length" -msgstr "" +msgstr "Solicita prefixo IPv6 de tamanho" msgid "Require TLS" -msgstr "" +msgstr "Requer TLS" + +msgid "Required" +msgstr "Necessário" msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" -msgstr "Requerido para alguns provedores de internet, ex. Charter com DOCSIS 3" +msgstr "" +"Obrigatório para alguns provedores de internet, ex. Charter com DOCSIS 3" msgid "Required. Base64-encoded private key for this interface." -msgstr "" +msgstr "Obrigatório. Chave privada codificada em Base64 para esta interface." msgid "" "Required. IP addresses and prefixes that this peer is allowed to use inside " "the tunnel. Usually the peer's tunnel IP addresses and the networks the peer " "routes through the tunnel." msgstr "" +"Obrigatório. Endereços IP e prefixos que este parceiro está autorizado a " +"usar dentro do túnel. Normalmente é o endereço IP do parceiro no túnel e as " +"redes que o parceiro roteia através do túnel." msgid "Required. Public key of peer." -msgstr "" +msgstr "Obrigatório. Chave pública do parceiro." + +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "Obrigatório. Chave Pública do parceiro." msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" msgstr "" +"Exige o suporte DNSSEC do servidor superior; verifica se resposta não " +"assinadas realmente vẽm de domínios não assinados." msgid "Reset" msgstr "Limpar" @@ -2705,19 +2895,19 @@ msgid "Root directory for files served via TFTP" msgstr "Diretório raiz para arquivos disponibilizados pelo TFTP" msgid "Root preparation" -msgstr "" +msgstr "Prepação da raiz (/)" msgid "Route Allowed IPs" -msgstr "" +msgstr "Roteie Andereços IP Autorizados" msgid "Route type" -msgstr "" +msgstr "Tipo de rota" msgid "Routed IPv6 prefix for downstream interfaces" -msgstr "" +msgstr "Prefixo roteável IPv6 para interfaces internas" msgid "Router Advertisement-Service" -msgstr "" +msgstr "Serviço de Anúncio de Roteador" msgid "Router Password" msgstr "Senha do Roteador" @@ -2740,30 +2930,32 @@ msgid "Run filesystem check" msgstr "Execute a verificação do sistema de arquivos " msgid "SHA256" -msgstr "" +msgstr "SHA256" msgid "" "SIXXS supports TIC only, for static tunnels using IP protocol 41 (RFC4213) " "use 6in4 instead" msgstr "" +"O SIXXS suporta somente TIC. Use o 6in4 para túneis estáticos usando o " +"protocolo IP 41 (RFC4213)" msgid "SIXXS-handle[/Tunnel-ID]" -msgstr "" +msgstr "Identificador do SIXXS[/Identificador do Túnel]" msgid "SNR" -msgstr "" +msgstr "SNR" msgid "SSH Access" msgstr "Acesso SSH" msgid "SSH server address" -msgstr "" +msgstr "Endereço do servidor SSH" msgid "SSH server port" -msgstr "" +msgstr "Porta do servidor SSH" msgid "SSH username" -msgstr "" +msgstr "Usuário do SSH" msgid "SSH-Keys" msgstr "Chaves SSH" @@ -2812,15 +3004,17 @@ msgid "Server Settings" msgstr "Configurações do Servidor" msgid "Server password" -msgstr "" +msgstr "Senha do servidor" msgid "" "Server password, enter the specific password of the tunnel when the username " "contains the tunnel ID" msgstr "" +"Senha do servidor. Informe a senha para este túnel quando o nome do usuário " +"contiver o identificador do túnel" msgid "Server username" -msgstr "" +msgstr "Usuário do servidor" msgid "Service Name" msgstr "Nome do Serviço" @@ -2831,7 +3025,6 @@ msgstr "Tipo do Serviço" msgid "Services" msgstr "Serviços" -#, fuzzy msgid "Set up Time Synchronization" msgstr "Configurar a Sincronização do Horário" @@ -2840,9 +3033,11 @@ msgstr "Configurar Servidor DHCP" msgid "Severely Errored Seconds (SES)" msgstr "" +"Segundos com erro severos (SES)" msgid "Short GI" -msgstr "" +msgstr "Intervalo de guarda curto" msgid "Show current backup file list" msgstr "Mostra a lista atual de arquivos para a cópia de segurança" @@ -2857,7 +3052,7 @@ msgid "Signal" msgstr "Sinal" msgid "Signal Attenuation (SATN)" -msgstr "" +msgstr "Atenuação do Sinal (SATN)" msgid "Signal:" msgstr "Sinal:" @@ -2866,7 +3061,7 @@ msgid "Size" msgstr "Tamanho" msgid "Size (.ipk)" -msgstr "" +msgstr "Tamanho (.ipk)" msgid "Skip" msgstr "Pular" @@ -2884,7 +3079,7 @@ msgid "Software" msgstr "Software" msgid "Software VLAN" -msgstr "" +msgstr "VLAN em Software" msgid "Some fields are invalid, cannot save values!" msgstr "Alguns campos estão inválidos e os valores não podem ser salvos!" @@ -2911,7 +3106,7 @@ msgid "Source" msgstr "Origem" msgid "Source routing" -msgstr "" +msgstr "Roteamento pela origem" msgid "Specifies the button state to handle" msgstr "Especifica o estado do botão para ser tratado" @@ -2937,17 +3132,21 @@ msgstr "" "equipamento está morto" msgid "Specify a TOS (Type of Service)." -msgstr "" +msgstr "Especifique um Tipo de Serviço (TOS)" msgid "" "Specify a TTL (Time to Live) for the encapsulating packet other than the " "default (64)." msgstr "" +"Especifica o tempo de vida (TTL) para os " +"pacotes encapsulados ao invés do padrão (64)." msgid "" "Specify an MTU (Maximum Transmission Unit) other than the default (1280 " "bytes)." msgstr "" +"Especifica a unidade máxima de transmissão (MTU) ao invés do valor padrão (1280 bytes)" msgid "Specify the secret encryption key here." msgstr "Especifique a chave de cifragem secreta aqui." @@ -3002,13 +3201,13 @@ msgid "Submit" msgstr "Enviar" msgid "Suppress logging" -msgstr "" +msgstr "Suprimir registros (log)" msgid "Suppress logging of the routine operation of these protocols" -msgstr "" +msgstr "Suprimir registros (log) de operações rotineiras destes protocolos" msgid "Swap" -msgstr "" +msgstr "Espaço de Troca (swap)" msgid "Swap Entry" msgstr "Entrada do espaço de troca (Swap)" @@ -3025,9 +3224,11 @@ msgstr "Switch %q (%s)" msgid "" "Switch %q has an unknown topology - the VLAN settings might not be accurate." msgstr "" +"O Switch %q tem uma topologia desconhecida - as configurações de VLAN podem " +"não ser precisas." msgid "Switch VLAN" -msgstr "" +msgstr "Switch VLAN" msgid "Switch protocol" msgstr "Trocar o protocolo" @@ -3072,12 +3273,11 @@ msgid "Target" msgstr "Destino" msgid "Target network" -msgstr "" +msgstr "Rede de destino" msgid "Terminate" msgstr "Terminar" -#, fuzzy msgid "" "The Device Configuration section covers physical settings of the " "radio hardware such as channel, transmit power or antenna selection which " @@ -3103,10 +3303,12 @@ msgid "" "The HE.net endpoint update configuration changed, you must now use the plain " "username instead of the user ID!" msgstr "" +"A configuração da atualização de pontas HE.net mudou. Você deve agora usar o " +"nome do usuário ao invés do identificador do usuário!" msgid "" "The IPv4 address or the fully-qualified domain name of the remote tunnel end." -msgstr "" +msgstr "O endereço IPv4 ou o nome completo (FQDN) da ponta remota do túnel." msgid "" "The IPv6 prefix assigned to the provider, usually ends with ::" @@ -3122,13 +3324,14 @@ msgstr "" msgid "The configuration file could not be loaded due to the following error:" msgstr "" +"O arquivo de configuração não pode ser carregado devido ao seguinte erro:" msgid "" "The device file of the memory or partition (e.g." " /dev/sda1)" msgstr "" -"O arquivo do dispositivo de armazenamento ou da partição (ex. /dev/sda1)" +"O arquivo do dispositivo de armazenamento ou da partição (ex: /dev/" +"sda1)" msgid "" "The filesystem that was used to format the memory ( DO NOT POWER OFF THE DEVICE!
Wait a " "few minutes before you try to reconnect. It might be necessary to renew the " @@ -3226,6 +3427,8 @@ msgid "" "The tunnel end-point is behind NAT, defaults to disabled and only applies to " "AYIYA" msgstr "" +"O final do túnel está atrás de um NAT. Por padrão será desabilitado e " +"somente se aplica a AYIYA" msgid "" "The uploaded image file does not contain a supported format. Make sure that " @@ -3268,6 +3471,9 @@ msgid "" "'server=1.2.3.4' fordomain-specific or full upstream DNS servers." msgstr "" +"Este arquivo deve conter linhas como 'server=/domain/1.2.3.4' ou " +"'server=1.2.3.4' para servidores DNS por domínio ou completos." msgid "" "This is a list of shell glob patterns for matching files and directories to " @@ -3283,6 +3489,8 @@ msgid "" "This is either the \"Update Key\" configured for the tunnel or the account " "password if no update key has been configured" msgstr "" +"Isto é a \"Update Key\" configurada para o túnel ou a senha da cpnta se não " +"tem uma \"Update Keu\" configurada" msgid "" "This is the content of /etc/rc.local. Insert your own commands here (in " @@ -3306,11 +3514,13 @@ msgstr "" "\">DHCP
na rede local" msgid "This is the plain username for logging into the account" -msgstr "" +msgstr "Este é o nome do usuário em para se autenticar na sua conta" msgid "" "This is the prefix routed to you by the tunnel broker for use by clients" msgstr "" +"Este é o prefixo roteado pelo agente do tunel para você usar com seus " +"clientes" msgid "This is the system crontab in which scheduled tasks can be defined." msgstr "Este é o sistema de agendamento de tarefas." @@ -3354,7 +3564,7 @@ msgstr "" "de segurança anterior." msgid "Tone" -msgstr "" +msgstr "Tom" msgid "Total Available" msgstr "Total Disponível" @@ -3393,16 +3603,16 @@ msgid "Tunnel Interface" msgstr "Interface de Tunelamento" msgid "Tunnel Link" -msgstr "" +msgstr "Enlace do túnel" msgid "Tunnel broker protocol" -msgstr "" +msgstr "Protocolo do agente do túnel" msgid "Tunnel setup server" -msgstr "" +msgstr "Servidor de configuração do túnel" msgid "Tunnel type" -msgstr "" +msgstr "Tipo de túnel" msgid "Turbo Mode" msgstr "Modo Turbo" @@ -3425,6 +3635,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "Dispositivo USB" +msgid "USB Ports" +msgstr "Portas USB" + msgid "UUID" msgstr "UUID" @@ -3433,6 +3646,8 @@ msgstr "Não é possível a expedição" msgid "Unavailable Seconds (UAS)" msgstr "" +"Segundos de indisponibilidade (UAS)" msgid "Unknown" msgstr "Desconhecido" @@ -3444,7 +3659,7 @@ msgid "Unmanaged" msgstr "Não gerenciado" msgid "Unmount" -msgstr "" +msgstr "Desmontar" msgid "Unsaved Changes" msgstr "Alterações Não Salvas" @@ -3486,22 +3701,24 @@ msgid "Use ISO/IEC 3166 alpha2 country codes." msgstr "Usar códigos de países ISO/IEC 3166 alpha2." msgid "Use MTU on tunnel interface" -msgstr "Use MTU na interface do túnel" +msgstr "" +"Use o MTU na interface do túnel" msgid "Use TTL on tunnel interface" msgstr "Use TTL na interface do túnel" msgid "Use as external overlay (/overlay)" -msgstr "" +msgstr "Use como uma sobreposição externa (/overlay)" msgid "Use as root filesystem (/)" -msgstr "" +msgstr "Usar como o sistema de arquivos raiz (/)" msgid "Use broadcast flag" msgstr "Use a marcação de broadcast" msgid "Use builtin IPv6-management" -msgstr "" +msgstr "Use o gerenciamento do IPv6 embarcado" msgid "Use custom DNS servers" msgstr "Use servidores DNS personalizados" @@ -3534,11 +3751,18 @@ msgstr "Usado" msgid "Used Key Slot" msgstr "Posição da Chave Usada" -msgid "User certificate (PEM encoded)" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." msgstr "" +"Usado para dois diferentes propósitos: identificador do RADIUS NAS e do " +"802.11r R0KH. Não necessário com o WPA(2)-PSK normal." + +msgid "User certificate (PEM encoded)" +msgstr "Certificado do usuário (codificado em formato PEM)" msgid "User key (PEM encoded)" -msgstr "" +msgstr "Chave do usuário (codificada em formato PEM)" msgid "Username" msgstr "Usuário" @@ -3547,7 +3771,7 @@ msgid "VC-Mux" msgstr "VC-Mux" msgid "VDSL" -msgstr "" +msgstr "VDSL" msgid "VLANs on %q" msgstr "VLANs em %q" @@ -3556,34 +3780,34 @@ msgid "VLANs on %q (%s)" msgstr "VLANs em %q (%s)" msgid "VPN Local address" -msgstr "" +msgstr "Endereço Local da VPN" msgid "VPN Local port" -msgstr "" +msgstr "Porta Local da VPN" msgid "VPN Server" msgstr "Servidor VPN" msgid "VPN Server port" -msgstr "" +msgstr "Porta do Servidor VPN" msgid "VPN Server's certificate SHA1 hash" -msgstr "" +msgstr "Resumo digital SHA1 do certificado do servidor VPN" msgid "VPNC (CISCO 3000 (and others) VPN)" -msgstr "" +msgstr "VPNC (VPN do CISCO 3000 (e outros))" msgid "Vendor" -msgstr "" +msgstr "Fabricante" msgid "Vendor Class to send when requesting DHCP" msgstr "Classe do fabricante para enviar quando requisitar o DHCP" msgid "Verbose" -msgstr "" +msgstr "Detalhado" msgid "Verbose logging by aiccu daemon" -msgstr "" +msgstr "Habilite registros detalhados do serviço AICCU" msgid "Verify" msgstr "Verificar" @@ -3619,6 +3843,8 @@ msgstr "" msgid "" "Wait for NTP sync that many seconds, seting to 0 disables waiting (optional)" msgstr "" +"Espere esta quantidade de segundos pela sincronia do NTP. Definindo como 0 " +"desabilita a espera (opcional)" msgid "Waiting for changes to be applied..." msgstr "Esperando a aplicação das mudanças..." @@ -3627,25 +3853,25 @@ msgid "Waiting for command to complete..." msgstr "Esperando o término do comando..." msgid "Waiting for device..." -msgstr "" +msgstr "Esperando pelo dispositivo..." msgid "Warning" msgstr "Atenção" msgid "Warning: There are unsaved changes that will get lost on reboot!" -msgstr "" +msgstr "Atenção: Existem mudanças não salvas que serão perdidas ao reiniciar!" msgid "Whether to create an IPv6 default route over the tunnel" -msgstr "" +msgstr "Se deve criar uma rota padrão IPv6 sobre o túnel" msgid "Whether to route only packets from delegated prefixes" -msgstr "" +msgstr "Se deve rotear somente pacotes de prefixos delegados" msgid "Width" -msgstr "" +msgstr "Largura" msgid "WireGuard VPN" -msgstr "" +msgstr "VPN WireGuard" msgid "Wireless" msgstr "Rede sem fio" @@ -3684,7 +3910,7 @@ msgid "Write received DNS requests to syslog" msgstr "Escreva as requisições DNS para o servidor de registro (syslog)" msgid "Write system log to file" -msgstr "" +msgstr "Escrever registo do sistema (log) no arquivo" msgid "XR Support" msgstr "Suporte a XR" @@ -3711,6 +3937,9 @@ msgid "" "upgrade it to at least version 7 or use another browser like Firefox, Opera " "or Safari." msgstr "" +"Seu Internet Explorer é muito velho para mostrar esta página corretamente. " +"Por favor, atualiza para, ao menos, a versão 7 ou use outro navegador como o " +"Firefox, Opera ou Safari." msgid "any" msgstr "qualquer" @@ -3718,9 +3947,8 @@ msgstr "qualquer" msgid "auto" msgstr "automático" -#, fuzzy msgid "automatic" -msgstr "estático" +msgstr "automático" msgid "baseT" msgstr "baseT" @@ -3744,7 +3972,7 @@ msgid "disable" msgstr "desativar" msgid "disabled" -msgstr "" +msgstr "desabilitado" msgid "expired" msgstr "expirado" @@ -3772,7 +4000,7 @@ msgid "hidden" msgstr "ocultar" msgid "hybrid mode" -msgstr "" +msgstr "Modo Híbrido" msgid "if target is a network" msgstr "se o destino for uma rede" @@ -3794,10 +4022,13 @@ msgstr "" "Arquivo local de DNS" msgid "minimum 1280, maximum 1480" -msgstr "" +msgstr "mínimo 1280, máximo 1480" + +msgid "minutes" +msgstr "minutos" msgid "navigation Navigation" -msgstr "" +msgstr "navegação Navegação" # Is this yes/no or no like in no one? msgid "no" @@ -3810,7 +4041,7 @@ msgid "none" msgstr "nenhum" msgid "not present" -msgstr "" +msgstr "não presente " msgid "off" msgstr "desligado" @@ -3822,35 +4053,38 @@ msgid "open" msgstr "aberto" msgid "overlay" -msgstr "" +msgstr "sobreposição" msgid "relay mode" -msgstr "" +msgstr "modo retransmissor" msgid "routed" msgstr "roteado" msgid "server mode" -msgstr "" +msgstr "modo servidor" msgid "skiplink1 Skip to navigation" -msgstr "" +msgstr "skiplink1 Pular para a navegação" msgid "skiplink2 Skip to content" -msgstr "" +msgstr "skiplink2 Pular para o conteúdo" msgid "stateful-only" -msgstr "" +msgstr "somente com estado" msgid "stateless" -msgstr "" +msgstr "sem estado" msgid "stateless + stateful" -msgstr "" +msgstr "sem estado + com estado" msgid "tagged" msgstr "etiquetado" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "unidades de tempo (TUs / 1.024 ms) [1000-65535]" + msgid "unknown" msgstr "desconhecido" @@ -3872,6 +4106,9 @@ msgstr "sim" msgid "« Back" msgstr "« Voltar" +#~ msgid "Required. Base64-encoded public key of peer." +#~ msgstr "Necessário. Chave Pública do parceiro codificada como Base64." + #~ msgid "An additional network will be created if you leave this unchecked." #~ msgstr "Uma rede adicional será criada se você deixar isto desmarcado." diff --git a/package/luci/modules/luci-base/po/pt/base.po b/package/luci/modules/luci-base/po/pt/base.po index d8790dc1ff..389b077a32 100644 --- a/package/luci/modules/luci-base/po/pt/base.po +++ b/package/luci/modules/luci-base/po/pt/base.po @@ -43,18 +43,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "Carga de 1 Minuto:" msgid "15 Minute Load:" msgstr "Carga de 15 minutos:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "Carga 5 Minutos:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "" "BSSID" @@ -877,6 +904,9 @@ msgstr "Desativar temporizador de HW-Beacon" msgid "Disabled" msgstr "Desativado" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "Descartar respostas RFC1918 a montante" @@ -1051,6 +1081,11 @@ msgstr "Ativar/Desativar" msgid "Enabled" msgstr "Ativado" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "Ativa o Spanning Tree nesta bridge" @@ -1100,6 +1135,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "Servidor externo de logs de sistema" @@ -1353,6 +1394,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "Endereço IP" @@ -1446,6 +1490,9 @@ msgstr "" msgid "IPv6-Address" msgstr "Endereço-IPv6" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6-em-IPv4 (RFC4213)" @@ -1715,6 +1762,22 @@ msgstr "" "Lista de servidores DNS para " "onde encaminhar os pedidos" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1906,6 +1969,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "Falta a extensão de protocolo para o protocolo %q" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Modo" @@ -2159,6 +2225,9 @@ msgstr "Opção alterada" msgid "Option removed" msgstr "Opção removida" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2257,6 +2326,9 @@ msgstr "PID" msgid "PIN" msgstr "PIN" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "PPP" @@ -2386,6 +2458,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2451,6 +2526,12 @@ msgstr "" msgid "Quality" msgstr "Qualidade" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2543,6 +2624,9 @@ msgstr "Tráfego em Tempo Real" msgid "Realtime Wireless" msgstr "Wireless em Tempo Real" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "Religar protecção" @@ -2561,6 +2645,9 @@ msgstr "Receber" msgid "Receiver Antenna" msgstr "Antena de Recepção" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "Reconetar esta interface" @@ -2612,6 +2699,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "Necessário para certos ISPs, p.ex. Charter with DOCSIS 3" @@ -2627,6 +2717,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3360,6 +3455,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "Dispositivo USB" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "UUID" @@ -3461,6 +3559,11 @@ msgstr "Usado" msgid "Used Key Slot" msgstr "" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3723,6 +3826,9 @@ msgstr "" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3777,6 +3883,9 @@ msgstr "" msgid "tagged" msgstr "" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "desconhecido" diff --git a/package/luci/modules/luci-base/po/ro/base.po b/package/luci/modules/luci-base/po/ro/base.po index 4135c796a8..365574b174 100644 --- a/package/luci/modules/luci-base/po/ro/base.po +++ b/package/luci/modules/luci-base/po/ro/base.po @@ -42,18 +42,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "Incarcarea in ultimul minut" msgid "15 Minute Load:" msgstr "Incarcarea in ultimele 15 minute" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "Incarcarea in ultimele 5 minute" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -847,6 +874,9 @@ msgstr "" msgid "Disabled" msgstr "Dezactivat" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "" @@ -1006,6 +1036,11 @@ msgstr "Activeaza/Dezactiveaza" msgid "Enabled" msgstr "Activat" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "" @@ -1052,6 +1087,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "Server de log-uri extern" @@ -1300,6 +1341,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "Adresa IP" @@ -1393,6 +1437,9 @@ msgstr "" msgid "IPv6-Address" msgstr "" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "" @@ -1653,6 +1700,22 @@ msgid "" "requests to" msgstr "" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1838,6 +1901,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Mod" @@ -2083,6 +2149,9 @@ msgstr "Optiunea schimbata" msgid "Option removed" msgstr "Optiunea eliminata" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2181,6 +2250,9 @@ msgstr "PID" msgid "PIN" msgstr "" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "" @@ -2310,6 +2382,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2375,6 +2450,12 @@ msgstr "" msgid "Quality" msgstr "Calitate" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2456,6 +2537,9 @@ msgstr "Traficul in timp real" msgid "Realtime Wireless" msgstr "" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "" @@ -2474,6 +2558,9 @@ msgstr "" msgid "Receiver Antenna" msgstr "Antena receptorului" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "Reconecteaza aceasta interfata" @@ -2525,6 +2612,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "" @@ -2540,6 +2630,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3227,6 +3322,9 @@ msgstr "" msgid "USB Device" msgstr "Dispozitiv USB" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "UUID" @@ -3328,6 +3426,11 @@ msgstr "Folosit" msgid "Used Key Slot" msgstr "Slot de cheie folosit" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3579,6 +3682,9 @@ msgstr "" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3633,6 +3739,9 @@ msgstr "" msgid "tagged" msgstr "etichetat" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "necunoscut" diff --git a/package/luci/modules/luci-base/po/ru/base.po b/package/luci/modules/luci-base/po/ru/base.po index e7045884be..d11fbc2cde 100644 --- a/package/luci/modules/luci-base/po/ru/base.po +++ b/package/luci/modules/luci-base/po/ru/base.po @@ -45,18 +45,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "Загрузка за 1 минуту:" msgid "15 Minute Load:" msgstr "Загрузка за 15 минут:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "Загрузка за 5 минут:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -876,6 +903,9 @@ msgstr "Отключить таймер HW-Beacon" msgid "Disabled" msgstr "Отключено" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "Отбрасывать ответы RFC1918" @@ -1052,6 +1082,11 @@ msgstr "Включить/выключить" msgid "Enabled" msgstr "Включено" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "Включает Spanning Tree Protocol на этом мосту" @@ -1101,6 +1136,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "Сервер системного журнала" @@ -1352,6 +1393,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "IP-адрес" @@ -1445,6 +1489,9 @@ msgstr "" msgid "IPv6-Address" msgstr "IPv6-адрес" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6 в IPv4 (RFC4213)" @@ -1719,6 +1766,22 @@ msgstr "" "Список DNS-серверов для " "перенаправления запросов" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1911,6 +1974,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "Отсутствует расширение протокола %q" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Режим" @@ -2165,6 +2231,9 @@ msgstr "Опция изменена" msgid "Option removed" msgstr "Опция удалена" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2265,6 +2334,9 @@ msgstr "PID" msgid "PIN" msgstr "PIN" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "PPP" @@ -2394,6 +2466,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2461,6 +2536,12 @@ msgstr "" msgid "Quality" msgstr "Качество" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2553,6 +2634,9 @@ msgstr "Трафик в реальном времени" msgid "Realtime Wireless" msgstr "Беспроводная сеть в реальном времени" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "Защита от DNS Rebinding" @@ -2571,6 +2655,9 @@ msgstr "Приём" msgid "Receiver Antenna" msgstr "Приёмная антенна" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "Переподключить этот интерфейс" @@ -2623,6 +2710,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "Требуется для некоторых интернет-провайдеров" @@ -2638,6 +2728,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3394,6 +3489,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "USB-устройство" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "UUID" @@ -3502,6 +3600,11 @@ msgstr "Использовано" msgid "Used Key Slot" msgstr "Используемый слот ключа" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3764,6 +3867,9 @@ msgstr "локальный BSSID" msgstr "" @@ -828,6 +855,9 @@ msgstr "" msgid "Disabled" msgstr "" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "" @@ -987,6 +1017,11 @@ msgstr "" msgid "Enabled" msgstr "" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "" @@ -1033,6 +1068,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "" @@ -1278,6 +1319,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "" @@ -1371,6 +1415,9 @@ msgstr "" msgid "IPv6-Address" msgstr "" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "" @@ -1628,6 +1675,22 @@ msgid "" "requests to" msgstr "" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1813,6 +1876,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "" @@ -2058,6 +2124,9 @@ msgstr "" msgid "Option removed" msgstr "" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2156,6 +2225,9 @@ msgstr "" msgid "PIN" msgstr "" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "" @@ -2285,6 +2357,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2350,6 +2425,12 @@ msgstr "" msgid "Quality" msgstr "" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2429,6 +2510,9 @@ msgstr "" msgid "Realtime Wireless" msgstr "" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "" @@ -2447,6 +2531,9 @@ msgstr "" msgid "Receiver Antenna" msgstr "" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "" @@ -2498,6 +2585,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "" @@ -2513,6 +2603,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3197,6 +3292,9 @@ msgstr "" msgid "USB Device" msgstr "" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "" @@ -3298,6 +3396,11 @@ msgstr "" msgid "Used Key Slot" msgstr "" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3547,6 +3650,9 @@ msgstr "" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3601,6 +3707,9 @@ msgstr "" msgid "tagged" msgstr "" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "" diff --git a/package/luci/modules/luci-base/po/sv/base.po b/package/luci/modules/luci-base/po/sv/base.po index 4e228082e2..e7e437fe5c 100644 --- a/package/luci/modules/luci-base/po/sv/base.po +++ b/package/luci/modules/luci-base/po/sv/base.po @@ -41,18 +41,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "Belastning senaste minuten:" msgid "15 Minute Load:" msgstr "Belastning senaste 15 minutrarna:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "Belastning senaste 5 minutrarna:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -834,6 +861,9 @@ msgstr "" msgid "Disabled" msgstr "" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "" @@ -993,6 +1023,11 @@ msgstr "" msgid "Enabled" msgstr "" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "" @@ -1039,6 +1074,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "" @@ -1284,6 +1325,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "" @@ -1377,6 +1421,9 @@ msgstr "" msgid "IPv6-Address" msgstr "" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "" @@ -1634,6 +1681,22 @@ msgid "" "requests to" msgstr "" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1819,6 +1882,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "" @@ -2064,6 +2130,9 @@ msgstr "" msgid "Option removed" msgstr "" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2162,6 +2231,9 @@ msgstr "" msgid "PIN" msgstr "" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "" @@ -2291,6 +2363,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2356,6 +2431,12 @@ msgstr "" msgid "Quality" msgstr "" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2435,6 +2516,9 @@ msgstr "" msgid "Realtime Wireless" msgstr "" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "" @@ -2453,6 +2537,9 @@ msgstr "" msgid "Receiver Antenna" msgstr "" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "" @@ -2504,6 +2591,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "" @@ -2519,6 +2609,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3203,6 +3298,9 @@ msgstr "" msgid "USB Device" msgstr "" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "" @@ -3304,6 +3402,11 @@ msgstr "" msgid "Used Key Slot" msgstr "" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3553,6 +3656,9 @@ msgstr "" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3607,6 +3713,9 @@ msgstr "" msgid "tagged" msgstr "" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "" diff --git a/package/luci/modules/luci-base/po/templates/base.pot b/package/luci/modules/luci-base/po/templates/base.pot index 5a77cd2938..cc47c2c6f2 100644 --- a/package/luci/modules/luci-base/po/templates/base.pot +++ b/package/luci/modules/luci-base/po/templates/base.pot @@ -31,18 +31,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "" msgid "15 Minute Load:" msgstr "" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "" @@ -821,6 +848,9 @@ msgstr "" msgid "Disabled" msgstr "" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "" @@ -980,6 +1010,11 @@ msgstr "" msgid "Enabled" msgstr "" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "" @@ -1026,6 +1061,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "" @@ -1271,6 +1312,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "" @@ -1364,6 +1408,9 @@ msgstr "" msgid "IPv6-Address" msgstr "" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "" @@ -1621,6 +1668,22 @@ msgid "" "requests to" msgstr "" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1806,6 +1869,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "" @@ -2051,6 +2117,9 @@ msgstr "" msgid "Option removed" msgstr "" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2149,6 +2218,9 @@ msgstr "" msgid "PIN" msgstr "" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "" @@ -2278,6 +2350,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2343,6 +2418,12 @@ msgstr "" msgid "Quality" msgstr "" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2422,6 +2503,9 @@ msgstr "" msgid "Realtime Wireless" msgstr "" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "" @@ -2440,6 +2524,9 @@ msgstr "" msgid "Receiver Antenna" msgstr "" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "" @@ -2491,6 +2578,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "" @@ -2506,6 +2596,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3190,6 +3285,9 @@ msgstr "" msgid "USB Device" msgstr "" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "" @@ -3291,6 +3389,11 @@ msgstr "" msgid "Used Key Slot" msgstr "" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3540,6 +3643,9 @@ msgstr "" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3594,6 +3700,9 @@ msgstr "" msgid "tagged" msgstr "" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "" diff --git a/package/luci/modules/luci-base/po/tr/base.po b/package/luci/modules/luci-base/po/tr/base.po index 7f0ea7e166..09312734a2 100644 --- a/package/luci/modules/luci-base/po/tr/base.po +++ b/package/luci/modules/luci-base/po/tr/base.po @@ -41,18 +41,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "1 Dakikalık Yük:" msgid "15 Minute Load:" msgstr "15 Dakikalık Yük:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "5 Dakikalık Yük:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr " BSSID " @@ -841,6 +868,9 @@ msgstr "" msgid "Disabled" msgstr "" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "" @@ -1000,6 +1030,11 @@ msgstr "" msgid "Enabled" msgstr "" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "" @@ -1046,6 +1081,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "" @@ -1291,6 +1332,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "" @@ -1384,6 +1428,9 @@ msgstr "" msgid "IPv6-Address" msgstr "" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "" @@ -1641,6 +1688,22 @@ msgid "" "requests to" msgstr "" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1826,6 +1889,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "" @@ -2071,6 +2137,9 @@ msgstr "" msgid "Option removed" msgstr "" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2169,6 +2238,9 @@ msgstr "" msgid "PIN" msgstr "" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "" @@ -2298,6 +2370,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2363,6 +2438,12 @@ msgstr "" msgid "Quality" msgstr "" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2442,6 +2523,9 @@ msgstr "" msgid "Realtime Wireless" msgstr "" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "" @@ -2460,6 +2544,9 @@ msgstr "" msgid "Receiver Antenna" msgstr "" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "" @@ -2511,6 +2598,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "" @@ -2526,6 +2616,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3210,6 +3305,9 @@ msgstr "" msgid "USB Device" msgstr "" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "" @@ -3311,6 +3409,11 @@ msgstr "" msgid "Used Key Slot" msgstr "" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3562,6 +3665,9 @@ msgstr "yerel DNS dosyası" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3616,6 +3722,9 @@ msgstr "" msgid "tagged" msgstr "etiketlendi" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "" diff --git a/package/luci/modules/luci-base/po/uk/base.po b/package/luci/modules/luci-base/po/uk/base.po index 29b1514e27..5abf039e85 100644 --- a/package/luci/modules/luci-base/po/uk/base.po +++ b/package/luci/modules/luci-base/po/uk/base.po @@ -42,18 +42,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "Навантаження за 1 хвилину:" msgid "15 Minute Load:" msgstr "Навантаження за 15 хвилин:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "Навантаження за 5 хвилин:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "" "STP на цьому мосту" @@ -1109,6 +1144,12 @@ msgstr "Термін оренди адрес, мінімум 2 хвилини (< msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "Зовнішній сервер системного журналу" @@ -1360,6 +1401,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "IP-адреса" @@ -1453,6 +1497,9 @@ msgstr "" msgid "IPv6-Address" msgstr "IPv6-адреса" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6 у IPv4 (RFC4213)" @@ -1726,6 +1773,22 @@ msgstr "" "Список DNS-серверів, до яких " "пересилати запити" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1920,6 +1983,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "Відсутні розширення для протоколу %q" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Режим" @@ -2173,6 +2239,9 @@ msgstr "Опція змінена" msgid "Option removed" msgstr "Опція видалена" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2276,6 +2345,9 @@ msgstr "" ">PIN" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "PPP" @@ -2405,6 +2477,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2472,6 +2547,12 @@ msgstr "" msgid "Quality" msgstr "Якість" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2567,6 +2648,9 @@ msgstr "Трафік у реальному часі" msgid "Realtime Wireless" msgstr "Бездротові мережі у реальному часі" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "Захист від переприв'язки" @@ -2585,6 +2669,9 @@ msgstr "Прийом" msgid "Receiver Antenna" msgstr "Антена приймача" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "Перепідключити цей інтерфейс" @@ -2636,6 +2723,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "Потрібно для деяких провайдерів, наприклад, Charter із DOCSIS 3" @@ -2651,6 +2741,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3410,6 +3505,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "USB-пристрій" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "UUID" @@ -3518,6 +3616,11 @@ msgstr "Використано" msgid "Used Key Slot" msgstr "Використовується слот ключа" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3779,6 +3882,9 @@ msgstr "" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3833,6 +3939,9 @@ msgstr "" msgid "tagged" msgstr "з позначкою" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "невідомий" diff --git a/package/luci/modules/luci-base/po/vi/base.po b/package/luci/modules/luci-base/po/vi/base.po index 0cc83bf5a1..162bd30664 100644 --- a/package/luci/modules/luci-base/po/vi/base.po +++ b/package/luci/modules/luci-base/po/vi/base.po @@ -43,18 +43,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "" msgid "15 Minute Load:" msgstr "" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -837,6 +864,9 @@ msgstr "Vô hiệu hóa bộ chỉnh giờ HW-Beacon" msgid "Disabled" msgstr "" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "" @@ -1005,6 +1035,11 @@ msgstr "Cho kích hoạt/ Vô hiệu hóa" msgid "Enabled" msgstr "" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "Kích hoạt Spanning Tree Protocol trên cầu nối này" @@ -1051,6 +1086,12 @@ msgstr "" msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "" @@ -1298,6 +1339,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "Địa chỉ IP" @@ -1391,6 +1435,9 @@ msgstr "" msgid "IPv6-Address" msgstr "" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "" @@ -1656,6 +1703,22 @@ msgid "" "requests to" msgstr "" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1841,6 +1904,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "Chế độ" @@ -2094,6 +2160,9 @@ msgstr "" msgid "Option removed" msgstr "" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2192,6 +2261,9 @@ msgstr "PID" msgid "PIN" msgstr "" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "" @@ -2321,6 +2393,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2386,6 +2461,12 @@ msgstr "" msgid "Quality" msgstr "" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2467,6 +2548,9 @@ msgstr "" msgid "Realtime Wireless" msgstr "" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "" @@ -2485,6 +2569,9 @@ msgstr "Receive" msgid "Receiver Antenna" msgstr "Máy thu Antenna" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "" @@ -2536,6 +2623,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "" @@ -2551,6 +2641,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3252,6 +3347,9 @@ msgstr "" msgid "USB Device" msgstr "" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "" @@ -3353,6 +3451,11 @@ msgstr "Đã sử dụng" msgid "Used Key Slot" msgstr "" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3609,6 +3712,9 @@ msgstr "Tập tin DNS địa phương" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3663,6 +3769,9 @@ msgstr "" msgid "tagged" msgstr "" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "" diff --git a/package/luci/modules/luci-base/po/zh-cn/base.po b/package/luci/modules/luci-base/po/zh-cn/base.po index 7c00f8ff88..dca93f0a19 100644 --- a/package/luci/modules/luci-base/po/zh-cn/base.po +++ b/package/luci/modules/luci-base/po/zh-cn/base.po @@ -43,18 +43,45 @@ msgstr "-- 根据设备匹配 --" msgid "-- match by label --" msgstr "-- 根据标签匹配 --" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "1分钟负载:" msgid "15 Minute Load:" msgstr "15分钟负载:" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "464XLAT (CLAT)" msgid "5 Minute Load:" msgstr "5分钟负载:" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -844,6 +871,9 @@ msgstr "停用HW-Beacon计时器" msgid "Disabled" msgstr "禁用" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "丢弃RFC1918上行响应数据" @@ -1005,6 +1035,11 @@ msgstr "启用/禁用" msgid "Enabled" msgstr "启用" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "在此桥接上启用生成协议树" @@ -1051,6 +1086,12 @@ msgstr "租用地址的到期时间,最短2分钟(2m)。" msgid "External" msgstr "远程" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "远程日志服务器" @@ -1300,6 +1341,9 @@ msgstr "混合" msgid "IKE DH Group" msgstr "IKE DH组" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "IP地址" @@ -1393,6 +1437,9 @@ msgstr "IPv6路由前缀" msgid "IPv6-Address" msgstr "IPv6-地址" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6-in-IPv4 (RFC4213)" @@ -1652,6 +1699,22 @@ msgid "" "requests to" msgstr "将指定的域名DNS解析转发到指定的DNS服务器(按照示例填写)" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "用于认证的SSH密钥文件列表" @@ -1838,6 +1901,9 @@ msgstr "数据包镜像源端口" msgid "Missing protocol extension for proto %q" msgstr "缺少协议 %q 的协议扩展" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "模式" @@ -2083,6 +2149,9 @@ msgstr "修改的选项" msgid "Option removed" msgstr "移除的选项" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "可选,设置这个选项会覆盖默认设定的服务器(tic.sixxs.net)" @@ -2183,6 +2252,9 @@ msgstr "PID" msgid "PIN" msgstr "PIN" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "PPP" @@ -2312,6 +2384,9 @@ msgstr "电源管理模式" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "抢占式CRC错误(CRCP_P)" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "预共享密钥" @@ -2377,6 +2452,12 @@ msgstr "QMI蜂窝" msgid "Quality" msgstr "质量" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "RFC3947 NAT-T模式" @@ -2465,6 +2546,9 @@ msgstr "实时流量" msgid "Realtime Wireless" msgstr "实时无线" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "重绑定保护" @@ -2483,6 +2567,9 @@ msgstr "接收" msgid "Receiver Antenna" msgstr "接收天线" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "重连此接口" @@ -2534,6 +2621,9 @@ msgstr "请求指定长度的IPv6前缀" msgid "Require TLS" msgstr "必须使用TLS" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "某些ISP需要,例如:同轴线网络DOCSIS 3" @@ -2551,6 +2641,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "必须,Peer的公钥。" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3257,6 +3352,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "USB设备" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "UUID" @@ -3360,6 +3458,11 @@ msgstr "已用" msgid "Used Key Slot" msgstr "启用密码组" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "客户证书(PEM加密的)" @@ -3615,6 +3718,9 @@ msgstr "本地DNS解析文件" msgid "minimum 1280, maximum 1480" msgstr "最小值1280,最大值1480" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "导航" @@ -3669,6 +3775,9 @@ msgstr "有状态和无状态的" msgid "tagged" msgstr "关联" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "未知" diff --git a/package/luci/modules/luci-base/po/zh-tw/base.po b/package/luci/modules/luci-base/po/zh-tw/base.po index 15ffafc2b4..8f759b8d5f 100644 --- a/package/luci/modules/luci-base/po/zh-tw/base.po +++ b/package/luci/modules/luci-base/po/zh-tw/base.po @@ -41,18 +41,45 @@ msgstr "" msgid "-- match by label --" msgstr "" +msgid "-- match by uuid --" +msgstr "" + msgid "1 Minute Load:" msgstr "1分鐘負載" msgid "15 Minute Load:" msgstr "15分鐘負載" +msgid "4-character hexadecimal ID" +msgstr "" + msgid "464XLAT (CLAT)" msgstr "" msgid "5 Minute Load:" msgstr "5分鐘負載" +msgid "6-octet identifier as a hex string - no colons" +msgstr "" + +msgid "802.11r Fast Transition" +msgstr "" + +msgid "802.11w Association SA Query maximum timeout" +msgstr "" + +msgid "802.11w Association SA Query retry timeout" +msgstr "" + +msgid "802.11w Management Frame Protection" +msgstr "" + +msgid "802.11w maximum timeout" +msgstr "" + +msgid "802.11w retry timeout" +msgstr "" + msgid "BSSID" msgstr "BSSID" @@ -851,6 +878,9 @@ msgstr "關閉硬體燈號計時器" msgid "Disabled" msgstr "關閉" +msgid "Disabled (default)" +msgstr "" + msgid "Discard upstream RFC1918 responses" msgstr "丟棄上游RFC1918 虛擬IP網路的回應" @@ -1017,6 +1047,11 @@ msgstr "啟用/關閉" msgid "Enabled" msgstr "啟用" +msgid "" +"Enables fast roaming among access points that belong to the same Mobility " +"Domain" +msgstr "" + msgid "Enables the Spanning Tree Protocol on this bridge" msgstr "在橋接器上啟用802.1d Spanning Tree協定" @@ -1064,6 +1099,12 @@ msgstr "釋放位址的過期週期,最少兩分鐘 (2m)." msgid "External" msgstr "" +msgid "External R0 Key Holder List" +msgstr "" + +msgid "External R1 Key Holder List" +msgstr "" + msgid "External system log server" msgstr "外部系統日誌伺服器" @@ -1309,6 +1350,9 @@ msgstr "" msgid "IKE DH Group" msgstr "" +msgid "IP Addresses" +msgstr "" + msgid "IP address" msgstr "IP位址" @@ -1402,6 +1446,9 @@ msgstr "" msgid "IPv6-Address" msgstr "IPv6-位址" +msgid "IPv6-PD" +msgstr "" + msgid "IPv6-in-IPv4 (RFC4213)" msgstr "IPv6包覆在IPv4內(RFC4213)" @@ -1664,6 +1711,22 @@ msgid "" "requests to" msgstr "列出 DNS 伺服器以便轉發請求" +msgid "" +"List of R0KHs in the same Mobility Domain.
Format: MAC-address,NAS-" +"Identifier,128-bit key as hex string.
This list is used to map R0KH-ID " +"(NAS Identifier) to a destination MAC address when requesting PMK-R1 key " +"from the R0KH that the STA used during the Initial Mobility Domain " +"Association." +msgstr "" + +msgid "" +"List of R1KHs in the same Mobility Domain.
Format: MAC-address,R1KH-ID " +"as 6 octets with colons,128-bit key as hex string.
This list is used " +"to map R1KH-ID to a destination MAC address when sending PMK-R1 key from the " +"R0KH. This is also the list of authorized R1KHs in the MD that can request " +"PMK-R1 keys." +msgstr "" + msgid "List of SSH key files for auth" msgstr "" @@ -1850,6 +1913,9 @@ msgstr "" msgid "Missing protocol extension for proto %q" msgstr "協定 %q 漏失的延伸協定" +msgid "Mobility Domain" +msgstr "" + msgid "Mode" msgstr "模式" @@ -2099,6 +2165,9 @@ msgstr "選項已變更" msgid "Option removed" msgstr "選項已移除" +msgid "Optional" +msgstr "" + msgid "Optional, specify to override default server (tic.sixxs.net)" msgstr "" @@ -2197,6 +2266,9 @@ msgstr "PID碼" msgid "PIN" msgstr "PIN碼" +msgid "PMK R1 Push" +msgstr "" + msgid "PPP" msgstr "PPP協定" @@ -2326,6 +2398,9 @@ msgstr "" msgid "Pre-emtive CRC errors (CRCP_P)" msgstr "" +msgid "Prefix Delegated" +msgstr "" + msgid "Preshared Key" msgstr "" @@ -2391,6 +2466,12 @@ msgstr "" msgid "Quality" msgstr "品質" +msgid "R0 Key Lifetime" +msgstr "" + +msgid "R1 Key Holder" +msgstr "" + msgid "RFC3947 NAT-T mode" msgstr "" @@ -2481,6 +2562,9 @@ msgstr "即時流量" msgid "Realtime Wireless" msgstr "即時無線網路" +msgid "Reassociation Deadline" +msgstr "" + msgid "Rebind protection" msgstr "重新綁護" @@ -2499,6 +2583,9 @@ msgstr "接收" msgid "Receiver Antenna" msgstr "接收天線" +msgid "Recommended. IP addresses of the WireGuard interface." +msgstr "" + msgid "Reconnect this interface" msgstr "重新連接這個介面" @@ -2550,6 +2637,9 @@ msgstr "" msgid "Require TLS" msgstr "" +msgid "Required" +msgstr "" + msgid "Required for certain ISPs, e.g. Charter with DOCSIS 3" msgstr "對特定的ISP需要,例如.DOCSIS 3 加速有線電視寬頻網路" @@ -2565,6 +2655,11 @@ msgstr "" msgid "Required. Public key of peer." msgstr "" +msgid "" +"Requires the 'full' version of wpad/hostapd and support from the wifi driver " +"
(as of Feb 2017: ath9k and ath10k, in LEDE also mwlwifi and mt76)" +msgstr "" + msgid "" "Requires upstream supports DNSSEC; verify unsigned domain responses really " "come from unsigned domains" @@ -3284,6 +3379,9 @@ msgstr "UMTS/GPRS/EV-DO" msgid "USB Device" msgstr "USB設備" +msgid "USB Ports" +msgstr "" + msgid "UUID" msgstr "設備通用唯一識別碼UUID" @@ -3390,6 +3488,11 @@ msgstr "已使用" msgid "Used Key Slot" msgstr "已使用的關鍵插槽" +msgid "" +"Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID. Not " +"needed with normal WPA(2)-PSK." +msgstr "" + msgid "User certificate (PEM encoded)" msgstr "" @@ -3645,6 +3748,9 @@ msgstr "本地DNS 檔案" msgid "minimum 1280, maximum 1480" msgstr "" +msgid "minutes" +msgstr "" + msgid "navigation Navigation" msgstr "" @@ -3699,6 +3805,9 @@ msgstr "" msgid "tagged" msgstr "標籤" +msgid "time units (TUs / 1.024 ms) [1000-65535]" +msgstr "" + msgid "unknown" msgstr "未知" diff --git a/package/luci/modules/luci-base/src/mkversion.sh b/package/luci/modules/luci-base/src/mkversion.sh index 229bee4952..e2d02c1c74 100755 --- a/package/luci/modules/luci-base/src/mkversion.sh +++ b/package/luci/modules/luci-base/src/mkversion.sh @@ -15,7 +15,7 @@ if pcall(dofile, "/etc/openwrt_release") and _G.DISTRIB_DESCRIPTION then end end else - distname = "libreCMC" + distname = "OpenWrt" distversion = "Development Snapshot" end diff --git a/package/luci/modules/luci-mod-admin-full/luasrc/controller/admin/network.lua b/package/luci/modules/luci-mod-admin-full/luasrc/controller/admin/network.lua index 3b5f3eb8de..2cb2108b9f 100644 --- a/package/luci/modules/luci-mod-admin-full/luasrc/controller/admin/network.lua +++ b/package/luci/modules/luci-mod-admin-full/luasrc/controller/admin/network.lua @@ -238,6 +238,7 @@ function iface_status(ifaces) ipaddrs = net:ipaddrs(), ip6addrs = net:ip6addrs(), dnsaddrs = net:dnsaddrs(), + ip6prefix = net:ip6prefix(), name = device:shortname(), type = device:type(), ifname = device:name(), diff --git a/package/luci/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua b/package/luci/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua index 24db1e4ff5..ad575e0d26 100644 --- a/package/luci/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua +++ b/package/luci/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua @@ -24,8 +24,10 @@ function index() entry({"admin", "status", "realtime", "bandwidth"}, template("admin_status/bandwidth"), _("Traffic"), 2).leaf = true entry({"admin", "status", "realtime", "bandwidth_status"}, call("action_bandwidth")).leaf = true - entry({"admin", "status", "realtime", "wireless"}, template("admin_status/wireless"), _("Wireless"), 3).leaf = true - entry({"admin", "status", "realtime", "wireless_status"}, call("action_wireless")).leaf = true + if nixio.fs.access("/etc/config/wireless") then + entry({"admin", "status", "realtime", "wireless"}, template("admin_status/wireless"), _("Wireless"), 3).leaf = true + entry({"admin", "status", "realtime", "wireless_status"}, call("action_wireless")).leaf = true + end entry({"admin", "status", "realtime", "connections"}, template("admin_status/connections"), _("Connections"), 4).leaf = true entry({"admin", "status", "realtime", "connections_status"}, call("action_connections")).leaf = true diff --git a/package/luci/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua b/package/luci/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua index cf8cfb5d2d..5478afa3e6 100644 --- a/package/luci/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua +++ b/package/luci/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua @@ -52,6 +52,7 @@ function action_clock_status() luci.sys.call("date -s '%04d-%02d-%02d %02d:%02d:%02d'" %{ date.year, date.month, date.day, date.hour, date.min, date.sec }) + luci.sys.call("/etc/init.d/sysfixtime restart") end end diff --git a/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua b/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua index 2dff4ddc81..222b362731 100644 --- a/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua +++ b/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua @@ -42,6 +42,9 @@ end -- wireless toggle was requested, commit and reload page function m.parse(map) + local new_cc = m:formvalue("cbid.wireless.%s.country" % wdev:name()) + local old_cc = m:get(wdev:name(), "country") + if m:formvalue("cbid.wireless.%s.__toggle" % wdev:name()) then if wdev:get("disabled") == "1" or wnet:get("disabled") == "1" then wnet:set("disabled", nil) @@ -56,7 +59,14 @@ function m.parse(map) luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless", arg[1])) return end + Map.parse(map) + + if m:get(wdev:name(), "type") == "mac80211" and new_cc and new_cc ~= old_cc then + luci.sys.call("iw reg set %q" % new_cc) + luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless", arg[1])) + return + end end m.title = luci.util.pcdata(wnet:get_i18n()) @@ -94,7 +104,7 @@ local function txpower_current(pwr, list) end end end - return (list[#list] and list[#list].driver_dbm) or pwr or 0 + return pwr or "" end local iw = luci.sys.wifi.getiwinfo(arg[1]) @@ -191,7 +201,7 @@ end ------------------- MAC80211 Device ------------------ if hwtype == "mac80211" then - if #tx_power_list > 1 then + if #tx_power_list > 0 then tp = s:taboption("general", ListValue, "txpower", translate("Transmit Power"), "dBm") tp.rmempty = true @@ -200,6 +210,7 @@ if hwtype == "mac80211" then return txpower_current(Value.cfgvalue(...), tx_power_list) end + tp:value("", translate("auto")) for _, p in ipairs(tx_power_list) do tp:value(p.driver_dbm, "%i dBm (%i mW)" %{ p.display_dbm, p.display_mw }) @@ -251,6 +262,7 @@ if hwtype == "atheros" then return txpower_current(Value.cfgvalue(...), tx_power_list) end + tp:value("", translate("auto")) for _, p in ipairs(tx_power_list) do tp:value(p.driver_dbm, "%i dBm (%i mW)" %{ p.display_dbm, p.display_mw }) @@ -308,6 +320,7 @@ if hwtype == "broadcom" then return txpower_current(Value.cfgvalue(...), tx_power_list) end + tp:value("", translate("auto")) for _, p in ipairs(tx_power_list) do tp:value(p.driver_dbm, "%i dBm (%i mW)" %{ p.display_dbm, p.display_mw }) @@ -887,13 +900,91 @@ end if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then - nasid = s:taboption("encryption", Value, "nasid", translate("NAS ID")) + + -- Probe 802.11r support (and EAP support as a proxy for Openwrt) + local has_80211r = (os.execute("hostapd -v11r 2>/dev/null || hostapd -veap 2>/dev/null") == 0) + + ieee80211r = s:taboption("encryption", Flag, "ieee80211r", + translate("802.11r Fast Transition"), + translate("Enables fast roaming among access points that belong " .. + "to the same Mobility Domain")) + ieee80211r:depends({mode="ap", encryption="wpa"}) + ieee80211r:depends({mode="ap", encryption="wpa2"}) + ieee80211r:depends({mode="ap-wds", encryption="wpa"}) + ieee80211r:depends({mode="ap-wds", encryption="wpa2"}) + if has_80211r then + ieee80211r:depends({mode="ap", encryption="psk"}) + ieee80211r:depends({mode="ap", encryption="psk2"}) + ieee80211r:depends({mode="ap", encryption="psk-mixed"}) + end + ieee80211r.rmempty = true + + nasid = s:taboption("encryption", Value, "nasid", translate("NAS ID"), + translate("Used for two different purposes: RADIUS NAS ID and " .. + "802.11r R0KH-ID. Not needed with normal WPA(2)-PSK.")) nasid:depends({mode="ap", encryption="wpa"}) nasid:depends({mode="ap", encryption="wpa2"}) nasid:depends({mode="ap-wds", encryption="wpa"}) nasid:depends({mode="ap-wds", encryption="wpa2"}) + nasid:depends({ieee80211r="1"}) nasid.rmempty = true + mobility_domain = s:taboption("encryption", Value, "mobility_domain", + translate("Mobility Domain"), + translate("4-character hexadecimal ID")) + mobility_domain:depends({ieee80211r="1"}) + mobility_domain.placeholder = "4f57" + mobility_domain.datatype = "and(hexstring,rangelength(4,4))" + mobility_domain.rmempty = true + + r0_key_lifetime = s:taboption("encryption", Value, "r0_key_lifetime", + translate("R0 Key Lifetime"), translate("minutes")) + r0_key_lifetime:depends({ieee80211r="1"}) + r0_key_lifetime.placeholder = "10000" + r0_key_lifetime.datatype = "uinteger" + r0_key_lifetime.rmempty = true + + r1_key_holder = s:taboption("encryption", Value, "r1_key_holder", + translate("R1 Key Holder"), + translate("6-octet identifier as a hex string - no colons")) + r1_key_holder:depends({ieee80211r="1"}) + r1_key_holder.placeholder = "00004f577274" + r1_key_holder.datatype = "and(hexstring,rangelength(12,12))" + r1_key_holder.rmempty = true + + reassociation_deadline = s:taboption("encryption", Value, "reassociation_deadline", + translate("Reassociation Deadline"), + translate("time units (TUs / 1.024 ms) [1000-65535]")) + reassociation_deadline:depends({ieee80211r="1"}) + reassociation_deadline.placeholder = "1000" + reassociation_deadline.datatype = "range(1000,65535)" + reassociation_deadline.rmempty = true + + pmk_r1_push = s:taboption("encryption", Flag, "pmk_r1_push", translate("PMK R1 Push")) + pmk_r1_push:depends({ieee80211r="1"}) + pmk_r1_push.placeholder = "0" + pmk_r1_push.rmempty = true + + r0kh = s:taboption("encryption", DynamicList, "r0kh", translate("External R0 Key Holder List"), + translate("List of R0KHs in the same Mobility Domain. " .. + "
Format: MAC-address,NAS-Identifier,128-bit key as hex string. " .. + "
This list is used to map R0KH-ID (NAS Identifier) to a destination " .. + "MAC address when requesting PMK-R1 key from the R0KH that the STA " .. + "used during the Initial Mobility Domain Association.")) + + r0kh:depends({ieee80211r="1"}) + r0kh.rmempty = true + + r1kh = s:taboption("encryption", DynamicList, "r1kh", translate("External R1 Key Holder List"), + translate ("List of R1KHs in the same Mobility Domain. ".. + "
Format: MAC-address,R1KH-ID as 6 octets with colons,128-bit key as hex string. ".. + "
This list is used to map R1KH-ID to a destination MAC address " .. + "when sending PMK-R1 key from the R0KH. This is also the " .. + "list of authorized R1KHs in the MD that can request PMK-R1 keys.")) + r1kh:depends({ieee80211r="1"}) + r1kh.rmempty = true + -- End of 802.11r options + eaptype = s:taboption("encryption", ListValue, "eap_type", translate("EAP-Method")) eaptype:value("tls", "TLS") eaptype:value("ttls", "TTLS") @@ -1032,6 +1123,47 @@ if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then password.password = true end +-- ieee802.11w options +if hwtype == "mac80211" then + local has_80211w = (os.execute("hostapd -v11w 2>/dev/null || hostapd -veap 2>/dev/null") == 0) + if has_80211w then + ieee80211w = s:taboption("encryption", ListValue, "ieee80211w", + translate("802.11w Management Frame Protection"), + translate("Requires the 'full' version of wpad/hostapd " .. + "and support from the wifi driver
(as of Feb 2017: " .. + "ath9k and ath10k, in LEDE also mwlwifi and mt76)")) + ieee80211w.default = "" + ieee80211w.rmempty = true + ieee80211w:value("", translate("Disabled (default)")) + ieee80211w:value("1", translate("Optional")) + ieee80211w:value("2", translate("Required")) + ieee80211w:depends({mode="ap", encryption="wpa2"}) + ieee80211w:depends({mode="ap-wds", encryption="wpa2"}) + ieee80211w:depends({mode="ap", encryption="psk2"}) + ieee80211w:depends({mode="ap", encryption="psk-mixed"}) + ieee80211w:depends({mode="ap-wds", encryption="psk2"}) + ieee80211w:depends({mode="ap-wds", encryption="psk-mixed"}) + + max_timeout = s:taboption("encryption", Value, "ieee80211w_max_timeout", + translate("802.11w maximum timeout"), + translate("802.11w Association SA Query maximum timeout")) + max_timeout:depends({ieee80211w="1"}) + max_timeout:depends({ieee80211w="2"}) + max_timeout.datatype = "uinteger" + max_timeout.placeholder = "1000" + max_timeout.rmempty = true + + retry_timeout = s:taboption("encryption", Value, "ieee80211w_retry_timeout", + translate("802.11w retry timeout"), + translate("802.11w Association SA Query retry timeout")) + retry_timeout:depends({ieee80211w="1"}) + retry_timeout:depends({ieee80211w="2"}) + retry_timeout.datatype = "uinteger" + retry_timeout.placeholder = "201" + retry_timeout.rmempty = true + end +end + if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then local wpasupplicant = fs.access("/usr/sbin/wpa_supplicant") local hostcli = fs.access("/usr/sbin/hostapd_cli") diff --git a/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_add.lua b/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_add.lua index 7dd094d7ec..8277deb2f6 100644 --- a/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_add.lua +++ b/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_add.lua @@ -16,7 +16,7 @@ if not iw then return end -m = SimpleForm("network", translate("Joining Network: %q", http.formvalue("join"))) +m = SimpleForm("network", translatef("Joining Network: %q", http.formvalue("join"))) m.cancel = translate("Back to scan results") m.reset = false diff --git a/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/admin.lua b/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/admin.lua index 1e475640be..493a735bde 100644 --- a/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/admin.lua +++ b/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/admin.lua @@ -21,7 +21,7 @@ function s.cfgsections() return { "_pass" } end -function m.on_commit(map) +function m.parse(map) local v1 = pw1:formvalue("_pass") local v2 = pw2:formvalue("_pass") @@ -36,6 +36,8 @@ function m.on_commit(map) m.message = translate("Given password confirmation did not match, password not changed!") end end + + Map.parse(map) end diff --git a/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/fstab/mount.lua b/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/fstab/mount.lua index f5751673fd..a85872afad 100644 --- a/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/fstab/mount.lua +++ b/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/fstab/mount.lua @@ -56,6 +56,8 @@ mount:taboption("general", Flag, "enabled", translate("Enable this mount")).rmem o = mount:taboption("general", Value, "uuid", translate("UUID"), translate("If specified, mount the device by its UUID instead of a fixed device node")) +o:value("", translate("-- match by uuid --")) + for i, d in ipairs(devices) do if d.uuid and d.size then o:value(d.uuid, "%s (%s, %d MB)" %{ d.uuid, d.dev, d.size }) @@ -64,12 +66,12 @@ for i, d in ipairs(devices) do end end -o:value("", translate("-- match by label --")) - o = mount:taboption("general", Value, "label", translate("Label"), translate("If specified, mount the device by the partition label instead of a fixed device node")) +o:value("", translate("-- match by label --")) + o:depends("uuid", "") for i, d in ipairs(devices) do @@ -80,12 +82,12 @@ for i, d in ipairs(devices) do end end -o:value("", translate("-- match by device --")) - o = mount:taboption("general", Value, "device", translate("Device"), translate("The device file of the memory or partition (e.g. /dev/sda1)")) +o:value("", translate("-- match by device --")) + o:depends({ uuid = "", label = "" }) for i, d in ipairs(devices) do diff --git a/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/leds.lua b/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/leds.lua index 8d9bcb1371..74e2f1a19d 100644 --- a/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/leds.lua +++ b/package/luci/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/leds.lua @@ -7,10 +7,11 @@ local sysfs_path = "/sys/class/leds/" local leds = {} local fs = require "nixio.fs" -local util = require "nixio.util" +local nu = require "nixio.util" +local util = require "luci.util" if fs.access(sysfs_path) then - leds = util.consume((fs.dir(sysfs_path))) + leds = nu.consume((fs.dir(sysfs_path))) end if #leds == 0 then @@ -109,6 +110,33 @@ function usbdev.remove(self, section) end end + +usbport = s:option(MultiValue, "port", translate("USB Ports")) +usbport:depends("trigger", "usbport") +usbport.rmempty = true +usbport.widget = "checkbox" +usbport.cast = "table" +usbport.size = 1 + +function usbport.valuelist(self, section) + local port, ports = nil, {} + for port in util.imatch(m.uci:get("system", section, "port")) do + local b, n = port:match("^usb(%d+)-port(%d+)$") + if not (b and n) then + b, n = port:match("^(%d+)-(%d+)$") + end + if b and n then + ports[#ports+1] = "usb%u-port%u" %{ tonumber(b), tonumber(n) } + end + end + return ports +end + +function usbport.validate(self, value) + return type(value) == "string" and { value } or value +end + + for p in nixio.fs.glob("/sys/bus/usb/devices/[0-9]*/manufacturer") do local id = p:match("%d+-%d+") local mf = nixio.fs.readfile("/sys/bus/usb/devices/" .. id .. "/manufacturer") or "?" @@ -116,4 +144,12 @@ for p in nixio.fs.glob("/sys/bus/usb/devices/[0-9]*/manufacturer") do usbdev:value(id, "%s (%s - %s)" %{ id, mf, pr }) end +for p in nixio.fs.glob("/sys/bus/usb/devices/*/usb[0-9]*-port[0-9]*") do + local bus, port = p:match("usb(%d+)-port(%d+)") + if bus and port then + usbport:value("usb%u-port%u" %{ tonumber(bus), tonumber(port) }, + "Hub %u, Port %u" %{ tonumber(bus), tonumber(port) }) + end +end + return m diff --git a/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm b/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm index 646d931f37..2512a35b3c 100644 --- a/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm +++ b/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm @@ -164,6 +164,11 @@ ifc.ip6addrs[i] ); } + + if (ifc.ip6prefix) + { + html += String.format('<%:IPv6-PD%>: %s
', ifc.ip6prefix); + } d.innerHTML = html; } diff --git a/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm b/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm index 8c3b1abcc7..b15dd13f39 100644 --- a/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm +++ b/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm @@ -54,6 +54,11 @@ ifc.ip6addrs[i] ); } + + if (ifc.ip6prefix) + { + html += String.format('<%:IPv6-PD%>: %s
', ifc.ip6prefix); + } d.innerHTML = html; } diff --git a/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/connections.htm b/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/connections.htm index 0b2e52e059..b7ebc41451 100644 --- a/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/connections.htm +++ b/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/connections.htm @@ -153,7 +153,8 @@ { var c = conn[i]; - if (c.src == '127.0.0.1' && c.dst == '127.0.0.1') + if ((c.src == '127.0.0.1' && c.dst == '127.0.0.1') + || (c.src == '::1' && c.dst == '::1')) continue; var tr = conn_table.rows[0].parentNode.insertRow(-1); diff --git a/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm b/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm index 8976e30cba..206f9ef82a 100644 --- a/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm +++ b/package/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm @@ -76,12 +76,14 @@ if wan6 then rv.wan6 = { - ip6addr = wan6:ip6addr(), - gw6addr = wan6:gw6addr(), - dns = wan6:dns6addrs(), - uptime = wan6:uptime(), - ifname = wan6:ifname(), - link = wan6:adminlink() + ip6addr = wan6:ip6addr(), + gw6addr = wan6:gw6addr(), + dns = wan6:dns6addrs(), + ip6prefix = wan6:ip6prefix(), + uptime = wan6:uptime(), + proto = wan6:proto(), + ifname = wan6:ifname(), + link = wan6:adminlink() } end @@ -233,9 +235,34 @@ if (ifc6 && ifc6.ifname && ifc6.proto != 'none') { var s = String.format( - '<%:Address%>: %s
' + + '<%:Type%>: %s%s
', + ifc6.proto, (ifc6.ip6prefix) ? '-pd' : '' + ); + + if (!ifc6.ip6prefix) + { + s += String.format( + '<%:Address%>: %s
', + (ifc6.ip6addr) ? ifc6.ip6addr : '::' + ); + } + else + { + s += String.format( + '<%:Prefix Delegated%>: %s
', + ifc6.ip6prefix + ); + if (ifc6.ip6addr) + { + s += String.format( + '<%:Address%>: %s
', + ifc6.ip6addr + ); + } + } + + s += String.format( '<%:Gateway%>: %s
', - (ifc6.ip6addr) ? ifc6.ip6addr : '::', (ifc6.gw6addr) ? ifc6.gw6addr : '::' ); diff --git a/package/luci/modules/luci-mod-admin-full/src/luci-bwc.c b/package/luci/modules/luci-mod-admin-full/src/luci-bwc.c index 63668d42b3..8ddd91727a 100644 --- a/package/luci/modules/luci-mod-admin-full/src/luci-bwc.c +++ b/package/luci/modules/luci-mod-admin-full/src/luci-bwc.c @@ -521,8 +521,8 @@ static int run_daemon(void) if (strstr(line, "TIME_WAIT")) continue; - if (strstr(line, "src=127.0.0.1 ") && - strstr(line, "dst=127.0.0.1 ")) + if ((strstr(line, "src=127.0.0.1 ") && strstr(line, "dst=127.0.0.1 ")) + || (strstr(line, "src=::1 ") && strstr(line, "dst=::1 "))) continue; if (sscanf(line, "%*s %*d %s", ifname) || sscanf(line, "%s %*d", ifname)) diff --git a/package/luci/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua b/package/luci/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua index 774c6db22b..e585324106 100644 --- a/package/luci/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua +++ b/package/luci/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua @@ -1,4 +1,4 @@ --- Copyright 2016 Dan Luedtke +-- Copyright 2016-2017 Dan Luedtke -- Licensed to the public under the Apache License 2.0. @@ -34,6 +34,16 @@ listen_port.datatype = "port" listen_port.placeholder = "51820" listen_port.optional = true +addresses = section:taboption( + "general", + DynamicList, + "addresses", + translate("IP Addresses"), + translate("Recommended. IP addresses of the WireGuard interface.") +) +addresses.datatype = "ipaddr" +addresses.optional = true + -- advanced -------------------------------------------------------------------- diff --git a/package/network/config/firewall/Makefile b/package/network/config/firewall/Makefile index ee31d17b25..0d57340ab9 100644 --- a/package/network/config/firewall/Makefile +++ b/package/network/config/firewall/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/firewall3.git -PKG_SOURCE_DATE:=2016-11-29 -PKG_SOURCE_VERSION:=13698aafb52c45817ee7815da3405e620657c8d0 -PKG_MIRROR_HASH:=6ba6e96a588dd3afd7e9db7e9246c5cc6c560aa95385592960c6b71b5a9c6395 +PKG_SOURCE_DATE:=2017-01-13 +PKG_SOURCE_VERSION:=37cb4cb437fd685f31926a4c326ba8afe329e4a6 +PKG_MIRROR_HASH:=7ee075f05977e5d9a78e661b537e6eb077c8f328ff2e71d1e2fbef44cca97355 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index c0a354b881..fb03586401 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2016-12-23 -PKG_SOURCE_VERSION:=64a655d8ffa9f0cea1bbdd35cac6b3b99b865270 -PKG_MIRROR_HASH:=1fa244a10f6d12d8bad2e60c054c0542d6f9ebe1cde319085f02289e8676612a +PKG_SOURCE_DATE:=2017-01-25 +PKG_SOURCE_VERSION:=650758b16e5185505a3fbc1307949340af70b611 +PKG_MIRROR_HASH:=d09c740bc1bf6269678bd75c9af52ecd4be3d1d59402a543ceb9d4459cecfa2b PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 diff --git a/package/network/config/netifd/files/etc/init.d/network b/package/network/config/netifd/files/etc/init.d/network index bdadbbce6d..a825dfd31f 100755 --- a/package/network/config/netifd/files/etc/init.d/network +++ b/package/network/config/netifd/files/etc/init.d/network @@ -31,9 +31,10 @@ reload_service() { /sbin/wifi reload_legacy } -stop() { +stop_service() { /sbin/wifi down - procd_kill network '' + ifdown -a + sleep 1 } service_running() { @@ -137,14 +138,6 @@ service_triggers() procd_close_validate } -restart() { - ifdown -a - sleep 1 - trap '' TERM - stop "$@" - start "$@" -} - shutdown() { ifdown -a sleep 1 diff --git a/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh b/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh index 285617c0d7..9ce4eb41ef 100755 --- a/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh +++ b/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh @@ -347,7 +347,6 @@ tc filter add dev $device parent ffff: prio 1 u32 match u32 0 0 flowid 1:1 actio fi add_insmod cls_fw add_insmod sch_hfsc - add_insmod sch_fq_codel cat <type, "switch_port")) { - char *devn, *port, *port_err = NULL; + char *devn = NULL, *port = NULL, *port_err = NULL; int port_n; uci_foreach_element(&s->options, os) { @@ -190,7 +190,7 @@ found: swlib_map_settings(dev, SWLIB_ATTR_GROUP_PORT, port_n, s); } else if (!strcmp(s->type, "switch_vlan")) { - char *devn, *vlan, *vlan_err = NULL; + char *devn = NULL, *vlan = NULL, *vlan_err = NULL; int vlan_n; uci_foreach_element(&s->options, os) { diff --git a/package/network/ipv6/6in4/files/6in4.sh b/package/network/ipv6/6in4/files/6in4.sh index 45d8ab75ad..786f37fc14 100755 --- a/package/network/ipv6/6in4/files/6in4.sh +++ b/package/network/ipv6/6in4/files/6in4.sh @@ -84,7 +84,7 @@ proto_6in4_setup() { local http="http" local urlget="uclient-fetch" local urlget_opts="-qO-" - local ca_path="${SSL_CERT_DIR-/etc/ssl/certs}" + local ca_path="${SSL_CERT_DIR:-/etc/ssl/certs}" [ -f /lib/libustream-ssl.so ] && http=https [ "$http" = "https" -a -z "$(find $ca_path -name "*.0" 2>/dev/null)" ] && { diff --git a/package/network/ipv6/map/Makefile b/package/network/ipv6/map/Makefile index 8cc1afeda1..fd8291d683 100644 --- a/package/network/ipv6/map/Makefile +++ b/package/network/ipv6/map/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=map PKG_VERSION:=4 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk @@ -20,7 +20,7 @@ define Package/map CATEGORY:=Network DEPENDS:=@IPV6 +kmod-ip6-tunnel +libubox +libubus +iptables-mod-conntrack-extra TITLE:=MAP-E and Lightweight 4over6 configuration support - MAINTAINER:=Steven Barth + MAINTAINER:=Hans Dedecker endef define Package/map/description diff --git a/package/network/ipv6/map/files/map.sh b/package/network/ipv6/map/files/map.sh index 98a493dd57..fe872828c3 100755 --- a/package/network/ipv6/map/files/map.sh +++ b/package/network/ipv6/map/files/map.sh @@ -192,7 +192,17 @@ proto_map_setup() { proto_map_teardown() { local cfg="$1" - ifdown "${cfg}_" + local link="map-$cfg" + + json_get_var type type + + [ -z "$type" ] && type="map-e" + + case "$type" in + "map-e"|"lw4o6") ifdown "${cfg}_" ;; + "map-t") [ -f "/proc/net/nat46/control" ] && echo del $link > /proc/net/nat46/control ;; + esac + rm -f /tmp/map-$cfg.rules } diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile index 60602f5554..0ed9b581f5 100644 --- a/package/network/ipv6/odhcp6c/Makefile +++ b/package/network/ipv6/odhcp6c/Makefile @@ -10,12 +10,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcp6c PKG_RELEASE:=1 -PKG_SOURCE_URL:=git://git.lede-project.org/project/odhcp6c.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2017-01-07 -PKG_SOURCE_VERSION:=d420f49396c627ce1072b83170889baf0720bc8b -PKG_MIRROR_HASH:=a7c599b5600b6cca9aec221dd32fc7754e0e942b0192bd902f1e789f53345127 -PKG_MAINTAINER:=Steven Barth +PKG_SOURCE_URL:=$(LEDE_GIT)/project/odhcp6c.git +PKG_SOURCE_DATE:=2017-01-30 +PKG_SOURCE_VERSION:=c13b6a05dbd9174356cc4b7fd1edf39445efd982 +PKG_MIRROR_HASH:=001e58f1ab6eb8903d9e47060ae037a2e4f021f1fef5032347b767f56f4664f6 +PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index 98333850af..bbcda9afb7 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_VERSION:=2.76 -PKG_RELEASE:=7 +PKG_RELEASE:=6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 87332a9081..46607dfe25 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -8,7 +8,6 @@ PROG=/usr/sbin/dnsmasq ADD_LOCAL_DOMAIN=1 ADD_LOCAL_HOSTNAME=1 -ADD_WAN_HOSTNAME=0 BASECONFIGFILE="/var/etc/dnsmasq.conf" BASEHOSTFILE="/tmp/hosts/dhcp" @@ -294,26 +293,6 @@ dhcp_host_add() { xappend "--dhcp-host=$macs${duid:+,id:$duid}${networkid:+,net:$networkid}${broadcast:+,set:needs-broadcast}${tag:+,set:$tag}${ip:+,$ip${hostid:+,[::$hostid]}}${name:+,$name}${leasetime:+,$leasetime}" } -dhcp_this_host_add() { - # TODO: case-in do/not short-host or FQDN; UCI already intended ... - local ifname="$1" - local do_enable="$2" - local routerstub routername ifdashname - - - if [ "$do_enable" -gt 0 ] ; then - # All IP addresses discovered by dnsmasq will be labeled robustly (except fe80::) - ifdashname="${ifname//./-}" - routerstub="$( md5sum /etc/os-release )" - routerstub="router-${routerstub// */}" - routername="$( uci_get system @system[0] hostname $routerstub )" - - xappend "--interface-name=$ifdashname.$routername.$DOMAIN,$ifname" - xappend "--interface-name=$routername.$DOMAIN,$ifname" - xappend "--interface-name=$routername,$ifname" - fi -} - dhcp_tag_add() { local cfg="$1" @@ -384,11 +363,7 @@ dhcp_add() { DNS_SERVERS="$DNS_SERVERS $dnsserver" } - append_bool "$cfg" ignore "--no-dhcp-interface=$ifname" && { - # Many ISP do not have useful names for DHCP customers (your WAN). - dhcp_this_host_add $ifname $ADD_WAN_HOSTNAME - return 0 - } + append_bool "$cfg" ignore "--no-dhcp-interface=$ifname" && return 0 # Do not support non-static interfaces for now [ static = "$proto" ] || return 0 @@ -406,9 +381,6 @@ dhcp_add() { config_get options "$cfg" options config_get_bool dynamicdhcp "$cfg" dynamicdhcp 1 - # Put the router host name on this DHCP served interface address(es) - dhcp_this_host_add $ifname $ADD_LOCAL_HOSTNAME - leasetime="${leasetime:-12h}" start="$(dhcp_calc "${start:-100}")" limit="${limit:-150}" @@ -633,7 +605,6 @@ dnsmasq_start() config_get_bool ADD_LOCAL_DOMAIN "$cfg" add_local_domain 1 config_get_bool ADD_LOCAL_HOSTNAME "$cfg" add_local_hostname 1 - config_get_bool ADD_WAN_HOSTNAME "$cfg" add_wan_hostname 0 config_get_bool readethers "$cfg" readethers [ "$readethers" = "1" -a \! -e "/etc/ethers" ] && touch /etc/ethers @@ -731,6 +702,27 @@ dnsmasq_start() config_foreach filter_dnsmasq hostrecord dhcp_hostrecord_add "$cfg" config_foreach filter_dnsmasq relay dhcp_relay_add "$cfg" + # add own hostname + [ $ADD_LOCAL_HOSTNAME -eq 1 ] && { + local lanaddr lanaddr6 + local ulaprefix="$(uci_get network @globals[0] ula_prefix)" + local hostname="$(uci_get system @system[0] hostname Lede)" + + network_get_ipaddr lanaddr "lan" && { + dhcp_domain_add "" "$hostname" "$lanaddr" + } + + [ -n "$ulaprefix" ] && network_get_ipaddrs6 lanaddr6 "lan" && { + for lanaddr6 in $lanaddr6; do + case "$lanaddr6" in + "${ulaprefix%%:/*}"*) + dhcp_domain_add "" "$hostname" "$lanaddr6" + ;; + esac + done + } + } + echo >> $CONFIGFILE_TMP config_foreach filter_dnsmasq srvhost dhcp_srv_add "$cfg" config_foreach filter_dnsmasq mxhost dhcp_mx_add "$cfg" diff --git a/package/network/services/dnsmasq/files/dnsmasqsec.hotplug b/package/network/services/dnsmasq/files/dnsmasqsec.hotplug index 5c69314bd9..a155eb0f6e 100644 --- a/package/network/services/dnsmasq/files/dnsmasqsec.hotplug +++ b/package/network/services/dnsmasq/files/dnsmasqsec.hotplug @@ -1,5 +1,7 @@ #!/bin/sh +. /lib/functions/procd.sh + TIMEVALIDFILE="/var/state/dnsmasqsec" [ "$ACTION" = stratum ] || exit 0 @@ -7,8 +9,6 @@ TIMEVALIDFILE="/var/state/dnsmasqsec" [ -f "$TIMEVALIDFILE" ] || { echo "ntpd says time is valid" >$TIMEVALIDFILE /etc/init.d/dnsmasq enabled && { - pid=$(pidof dnsmasq) - [ "$(readlink /proc/$pid/exe)" = "/usr/sbin/dnsmasq" ] && kill -SIGHUP $pid \ - || /etc/init.d/dnsmasq restart + procd_send_signal dnsmasq } } diff --git a/package/network/services/dnsmasq/patches/000-fix-servfail-handling.patch b/package/network/services/dnsmasq/patches/000-fix-servfail-handling.patch new file mode 100644 index 0000000000..e311c34729 --- /dev/null +++ b/package/network/services/dnsmasq/patches/000-fix-servfail-handling.patch @@ -0,0 +1,130 @@ +From 68f6312d4bae30b78daafcd6f51dc441b8685b1e Mon Sep 17 00:00:00 2001 +From: Baptiste Jonglez +Date: Mon, 6 Feb 2017 21:09:11 +0000 +Subject: [PATCH] Stop treating SERVFAIL as a successful response from upstream + servers. + +This effectively reverts most of 51967f9807 ("SERVFAIL is an expected +error return, don't try all servers.") and 4ace25c5d6 ("Treat REFUSED (not +SERVFAIL) as an unsuccessful upstream response"). + +With the current behaviour, as soon as dnsmasq receives a SERVFAIL from an +upstream server, it stops trying to resolve the query and simply returns +SERVFAIL to the client. With this commit, dnsmasq will instead try to +query other upstream servers upon receiving a SERVFAIL response. + +According to RFC 1034 and 1035, the semantic of SERVFAIL is that of a +temporary error condition. Recursive resolvers are expected to encounter +network or resources issues from time to time, and will respond with +SERVFAIL in this case. Similarly, if a validating DNSSEC resolver [RFC +4033] encounters issues when checking signatures (unknown signing +algorithm, missing signatures, expired signatures because of a wrong +system clock, etc), it will respond with SERVFAIL. + +Note that all those behaviours are entirely different from a negative +response, which would provide a definite indication that the requested +name does not exist. In our case, if an upstream server responds with +SERVFAIL, another upstream server may well provide a positive answer for +the same query. + +Thus, this commit will increase robustness whenever some upstream servers +encounter temporary issues or are misconfigured. + +Quoting RFC 1034, Section 4.3.1. "Queries and responses": + + If recursive service is requested and available, the recursive response + to a query will be one of the following: + + - The answer to the query, possibly preface by one or more CNAME + RRs that specify aliases encountered on the way to an answer. + + - A name error indicating that the name does not exist. This + may include CNAME RRs that indicate that the original query + name was an alias for a name which does not exist. + + - A temporary error indication. + +Here is Section 5.2.3. of RFC 1034, "Temporary failures": + + In a less than perfect world, all resolvers will occasionally be unable + to resolve a particular request. This condition can be caused by a + resolver which becomes separated from the rest of the network due to a + link failure or gateway problem, or less often by coincident failure or + unavailability of all servers for a particular domain. + +And finally, RFC 1035 specifies RRCODE 2 for this usage, which is now more +widely known as SERVFAIL (RFC 1035, Section 4.1.1. "Header section format"): + + RCODE Response code - this 4 bit field is set as part of + responses. The values have the following + interpretation: + (...) + + 2 Server failure - The name server was + unable to process this query due to a + problem with the name server. + +For the DNSSEC-related usage of SERVFAIL, here is RFC 4033 +Section 5. "Scope of the DNSSEC Document Set and Last Hop Issues": + + A validating resolver can determine the following 4 states: + (...) + + Insecure: The validating resolver has a trust anchor, a chain of + trust, and, at some delegation point, signed proof of the + non-existence of a DS record. This indicates that subsequent + branches in the tree are provably insecure. A validating resolver + may have a local policy to mark parts of the domain space as + insecure. + + Bogus: The validating resolver has a trust anchor and a secure + delegation indicating that subsidiary data is signed, but the + response fails to validate for some reason: missing signatures, + expired signatures, signatures with unsupported algorithms, data + missing that the relevant NSEC RR says should be present, and so + forth. + (...) + + This specification only defines how security-aware name servers can + signal non-validating stub resolvers that data was found to be bogus + (using RCODE=2, "Server Failure"; see [RFC4035]). + +Notice the difference between a definite negative answer ("Insecure" +state), and an indefinite error condition ("Bogus" state). The second +type of error may be specific to a recursive resolver, for instance +because its system clock has been incorrectly set, or because it does not +implement newer cryptographic primitives. Another recursive resolver may +succeed for the same query. + +There are other similar situations in which the specified behaviour is +similar to the one implemented by this commit. + +For instance, RFC 2136 specifies the behaviour of a "requestor" that wants +to update a zone using the DNS UPDATE mechanism. The requestor tries to +contact all authoritative name servers for the zone, with the following +behaviour specified in RFC 2136, Section 4: + + 4.6. If a response is received whose RCODE is SERVFAIL or NOTIMP, or + if no response is received within an implementation dependent timeout + period, or if an ICMP error is received indicating that the server's + port is unreachable, then the requestor will delete the unusable + server from its internal name server list and try the next one, + repeating until the name server list is empty. If the requestor runs + out of servers to try, an appropriate error will be returned to the + requestor's caller. +--- + src/forward.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/src/forward.c ++++ b/src/forward.c +@@ -853,7 +853,8 @@ void reply_query(int fd, int family, tim + we get a good reply from another server. Kill it when we've + had replies from all to avoid filling the forwarding table when + everything is broken */ +- if (forward->forwardall == 0 || --forward->forwardall == 1 || RCODE(header) != REFUSED) ++ if (forward->forwardall == 0 || --forward->forwardall == 1 || ++ (RCODE(header) != REFUSED && RCODE(header) != SERVFAIL)) + { + int check_rebind = 0, no_cache_dnssec = 0, cache_secure = 0, bogusanswer = 0; + diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index e6bae9f21f..5e518dabd4 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dropbear PKG_VERSION:=2016.74 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/network/services/dropbear/patches/120-openwrt_options.patch b/package/network/services/dropbear/patches/120-openwrt_options.patch index f16aaf001e..b49a95ce93 100644 --- a/package/network/services/dropbear/patches/120-openwrt_options.patch +++ b/package/network/services/dropbear/patches/120-openwrt_options.patch @@ -44,10 +44,9 @@ * which are not the standard form. */ #define DROPBEAR_SHA1_HMAC -#define DROPBEAR_SHA1_96_HMAC --#define DROPBEAR_SHA2_256_HMAC --#define DROPBEAR_SHA2_512_HMAC +/*#define DROPBEAR_SHA1_96_HMAC*/ -+/*#define DROPBEAR_SHA2_256_HMAC*/ + #define DROPBEAR_SHA2_256_HMAC +-#define DROPBEAR_SHA2_512_HMAC +/*#define DROPBEAR_SHA2_512_HMAC*/ #define DROPBEAR_MD5_HMAC diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 207dfecebe..f3aa94b6ea 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git @@ -242,7 +242,7 @@ define Package/eapol-test SECTION:=net CATEGORY:=Network VARIANT:=supplicant-full - DEPENDS:=$(DRV_DEPENDS) + DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl endef @@ -318,19 +318,19 @@ define Build/Compile/wpad endef define Build/Compile/hostapd - $(call Build/RunMake,hostapd, \ + +$(call Build/RunMake,hostapd, \ hostapd hostapd_cli \ ) endef define Build/Compile/supplicant - $(call Build/RunMake,wpa_supplicant, \ + +$(call Build/RunMake,wpa_supplicant, \ wpa_cli wpa_supplicant \ ) endef define Build/Compile/supplicant-full - $(call Build/RunMake,wpa_supplicant, \ + +$(call Build/RunMake,wpa_supplicant, \ eapol_test \ ) endef @@ -350,7 +350,7 @@ endef define Package/hostapd-common/install $(INSTALL_DIR) $(1)/lib/netifd - $(INSTALL_DATA) ./files/netifd.sh $(1)/lib/netifd/hostapd.sh + $(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/netifd/hostapd.sh endef define Package/hostapd/install diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config index e388109fbb..4a2e87c2eb 100644 --- a/package/network/services/hostapd/files/hostapd-full.config +++ b/package/network/services/hostapd/files/hostapd-full.config @@ -146,6 +146,9 @@ CONFIG_IEEE80211AC=y # code is not needed. #CONFIG_NO_STDOUT_DEBUG=y +# Send debug messages to syslog instead of stdout +CONFIG_DEBUG_SYSLOG=y + # Remove support for RADIUS accounting #CONFIG_NO_ACCOUNTING=y diff --git a/package/network/services/hostapd/files/hostapd-mini.config b/package/network/services/hostapd/files/hostapd-mini.config index 8baff18fe4..2bd7d239c5 100644 --- a/package/network/services/hostapd/files/hostapd-mini.config +++ b/package/network/services/hostapd/files/hostapd-mini.config @@ -142,6 +142,9 @@ CONFIG_IEEE80211AC=y # code is not needed. #CONFIG_NO_STDOUT_DEBUG=y +# Send debug messages to syslog instead of stdout +CONFIG_DEBUG_SYSLOG=y + # Remove support for RADIUS accounting CONFIG_NO_ACCOUNTING=y diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/hostapd.sh similarity index 97% rename from package/network/services/hostapd/files/netifd.sh rename to package/network/services/hostapd/files/hostapd.sh index fb23e52e67..988ebc7757 100644 --- a/package/network/services/hostapd/files/netifd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -40,8 +40,8 @@ hostapd_append_wpa_key_mgmt() { local auth_type="$(echo $auth_type | tr 'a-z' 'A-Z')" append wpa_key_mgmt "WPA-$auth_type" - [ "$ieee80211r" -gt 0 ] && append wpa_key_mgmt "FT-${auth_type}" - [ "$ieee80211w" -gt 0 ] && append wpa_key_mgmt "WPA-${auth_type}-SHA256" + [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-${auth_type}" + [ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-${auth_type}-SHA256" } hostapd_add_log_config() { @@ -158,6 +158,7 @@ hostapd_common_add_bss_config() { config_add_string wpa_psk_file config_add_boolean wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 + config_add_int wps_ap_setup_locked wps_independent config_add_string wps_device_type wps_device_name wps_manufacturer wps_pin config_add_boolean ieee80211r pmk_r1_push @@ -191,8 +192,8 @@ hostapd_set_bss_options() { json_get_vars \ wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey \ maxassoc max_inactivity disassoc_low_ack isolate auth_cache \ - wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 \ - wps_device_type wps_device_name wps_manufacturer wps_pin \ + wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 wps_ap_setup_locked \ + wps_independent wps_device_type wps_device_name wps_manufacturer wps_pin \ macfilter ssid wmm uapsd hidden short_preamble rsn_preauth \ iapp_interface eapol_version acct_server acct_secret acct_port \ dynamic_vlan ieee80211w @@ -328,6 +329,7 @@ hostapd_set_bss_options() { set_default wps_device_type "6-0050F204-1" set_default wps_device_name "Lede AP" set_default wps_manufacturer "www.lede-project.org" + set_default wps_independent 1 wps_state=2 [ -n "$wps_configured" ] && wps_state=1 @@ -337,11 +339,12 @@ hostapd_set_bss_options() { append bss_conf "eap_server=1" "$N" [ -n "$wps_pin" ] && append bss_conf "ap_pin=$wps_pin" "$N" append bss_conf "wps_state=$wps_state" "$N" - append bss_conf "ap_setup_locked=0" "$N" append bss_conf "device_type=$wps_device_type" "$N" append bss_conf "device_name=$wps_device_name" "$N" append bss_conf "manufacturer=$wps_manufacturer" "$N" append bss_conf "config_methods=$config_methods" "$N" + append bss_conf "wps_independent=$wps_independent" "$N" + [ -n "$wps_ap_setup_locked" ] && append bss_conf "ap_setup_locked=$wps_ap_setup_locked" "$N" [ "$wps_pbc_in_m1" -gt 0 ] && append bss_conf "pbc_in_m1=$wps_pbc_in_m1" "$N" } diff --git a/package/network/services/hostapd/patches/001-Fix-race-condition-between-AssocResp-callback-and-4a.patch b/package/network/services/hostapd/patches/001-Fix-race-condition-between-AssocResp-callback-and-4a.patch new file mode 100644 index 0000000000..bf54e9df32 --- /dev/null +++ b/package/network/services/hostapd/patches/001-Fix-race-condition-between-AssocResp-callback-and-4a.patch @@ -0,0 +1,83 @@ +From: Jouni Malinen +Date: Tue, 20 Dec 2016 01:30:09 +0200 +Subject: [PATCH] Fix race condition between AssocResp callback and 4addr event + +It is apparently possible for the NL80211_CMD_UNEXPECTED_4ADDR_FRAME +event to be delivered to hostapd before the NL80211_CMD_FRAME_TX_STATUS +event for (Re)Association Response frame. This resulted in the 4-address +WDS mode not getting enabled for a STA. This could occur in particular +when operating under heavy load and the STA is reconnecting to the same +AP in a sequence where Deauthentication frame is followed immediately by +Authentication frame and the driver event processing gets delayed due to +removal of the previous netdev taking time in the middle of this +sequence. + +Fix this by recording a pending item for 4-address WDS enabling if the +NL80211_CMD_UNEXPECTED_4ADDR_FRAME event would have been dropped due to +incompleted association and then process this pending item if the TX +status for the (Re)Association Response frame is received and it shows +that the frame was acknowledged. + +Signed-off-by: Jouni Malinen +--- + +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -2634,6 +2634,8 @@ static void handle_assoc(struct hostapd_ + taxonomy_sta_info_assoc_req(hapd, sta, pos, left); + #endif /* CONFIG_TAXONOMY */ + ++ sta->pending_wds_enable = 0; ++ + fail: + /* + * In case of a successful response, add the station to the driver. +@@ -3248,6 +3250,14 @@ static void handle_assoc_cb(struct hosta + + hostapd_set_sta_flags(hapd, sta); + ++ if (!(sta->flags & WLAN_STA_WDS) && sta->pending_wds_enable) { ++ wpa_printf(MSG_DEBUG, "Enable 4-address WDS mode for STA " ++ MACSTR " based on pending request", ++ MAC2STR(sta->addr)); ++ sta->pending_wds_enable = 0; ++ sta->flags |= WLAN_STA_WDS; ++ } ++ + if (sta->flags & WLAN_STA_WDS) { + int ret; + char ifname_wds[IFNAMSIZ + 1]; +@@ -3512,10 +3522,22 @@ void ieee802_11_rx_from_unknown(struct h + struct sta_info *sta; + + sta = ap_get_sta(hapd, src); +- if (sta && (sta->flags & WLAN_STA_ASSOC)) { ++ if (sta && ++ ((sta->flags & WLAN_STA_ASSOC) || ++ ((sta->flags & WLAN_STA_ASSOC_REQ_OK) && wds))) { + if (!hapd->conf->wds_sta) + return; + ++ if ((sta->flags & (WLAN_STA_ASSOC | WLAN_STA_ASSOC_REQ_OK)) == ++ WLAN_STA_ASSOC_REQ_OK) { ++ wpa_printf(MSG_DEBUG, ++ "Postpone 4-address WDS mode enabling for STA " ++ MACSTR " since TX status for AssocResp is not yet known", ++ MAC2STR(sta->addr)); ++ sta->pending_wds_enable = 1; ++ return; ++ } ++ + if (wds && !(sta->flags & WLAN_STA_WDS)) { + int ret; + char ifname_wds[IFNAMSIZ + 1]; +--- a/src/ap/sta_info.h ++++ b/src/ap/sta_info.h +@@ -115,6 +115,7 @@ struct sta_info { + unsigned int radius_das_match:1; + unsigned int ecsa_supported:1; + unsigned int added_unassoc:1; ++ unsigned int pending_wds_enable:1; + + u16 auth_alg; + diff --git a/package/network/services/hostapd/patches/002-Fix-duplicate-Reassociation-Request-frame-dropping.patch b/package/network/services/hostapd/patches/002-Fix-duplicate-Reassociation-Request-frame-dropping.patch new file mode 100644 index 0000000000..6db1e9b34b --- /dev/null +++ b/package/network/services/hostapd/patches/002-Fix-duplicate-Reassociation-Request-frame-dropping.patch @@ -0,0 +1,36 @@ +From: Jouni Malinen +Date: Sat, 14 Jan 2017 01:04:31 +0200 +Subject: [PATCH] Fix duplicate Reassociation Request frame dropping + +Relational operators (==) have higher precedence than the ternary +conditional in C. The last_subtype check for association/reassociation +was broken due to incorrect assumption about the precedence. Fix this by +adding parenthesis around the ternary conditional. + +The previous implementation worked for Association Request frames by +accident since WLAN_FC_STYPE_ASSOC_REQ happens to have value 0 and when +the last receive frame was an Association Request frame, the +sta->last_subtype == reassoc check was true and non-zero +WLAN_FC_STYPE_REASSOC_REQ was interpreted as true. However, this was +broken for Reassociation Request frame. reassoc == 1 in that case could +have matched received Association Response frame (subtype == 1), but +those are not received in AP mode and as such, this did not break other +behavior apart from not being able to drop duplicated Reassociation +Request frames. + +Signed-off-by: Jouni Malinen +--- + +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -2485,8 +2485,8 @@ static void handle_assoc(struct hostapd_ + if ((fc & WLAN_FC_RETRY) && + sta->last_seq_ctrl != WLAN_INVALID_MGMT_SEQ && + sta->last_seq_ctrl == seq_ctrl && +- sta->last_subtype == reassoc ? WLAN_FC_STYPE_REASSOC_REQ : +- WLAN_FC_STYPE_ASSOC_REQ) { ++ sta->last_subtype == (reassoc ? WLAN_FC_STYPE_REASSOC_REQ : ++ WLAN_FC_STYPE_ASSOC_REQ)) { + hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, + HOSTAPD_LEVEL_DEBUG, + "Drop repeated association frame seq_ctrl=0x%x", diff --git a/package/network/services/hostapd/patches/003-RSN-IBSS-Fix-TK-clearing-on-Authentication-frame-RX.patch b/package/network/services/hostapd/patches/003-RSN-IBSS-Fix-TK-clearing-on-Authentication-frame-RX.patch new file mode 100644 index 0000000000..0a3c27f89e --- /dev/null +++ b/package/network/services/hostapd/patches/003-RSN-IBSS-Fix-TK-clearing-on-Authentication-frame-RX.patch @@ -0,0 +1,40 @@ +From: Jouni Malinen +Date: Sat, 14 Jan 2017 13:56:18 +0200 +Subject: [PATCH] RSN IBSS: Fix TK clearing on Authentication frame RX + +When wpa_supplicant was processing a received Authentication frame (seq +1) from a peer STA for which there was already a TK configured to the +driver, debug log claimed that the PTK gets cleared, but the actual +call to clear the key was actually dropped due to AUTH vs. SUPP set_key +selection. Fix this by explicitly clearing the TK in case it was set +and an Authentication frame (seq 1) is received. + +This fixes some cases where EAPOL-Key frames were sent encrypted using +the old key when a peer STA restarted itself and lost the key and had to +re-join the IBSS. Previously, that state required timing out the 4-way +handshake and Deauthentication frame exchange to recover. + +Signed-off-by: Jouni Malinen +--- + +--- a/wpa_supplicant/ibss_rsn.c ++++ b/wpa_supplicant/ibss_rsn.c +@@ -838,6 +838,18 @@ static void ibss_rsn_handle_auth_1_of_2( + MAC2STR(addr)); + + if (peer && ++ peer->authentication_status & (IBSS_RSN_SET_PTK_SUPP | ++ IBSS_RSN_SET_PTK_AUTH)) { ++ /* Clear the TK for this pair to allow recovery from the case ++ * where the peer STA has restarted and lost its key while we ++ * still have a pairwise key configured. */ ++ wpa_printf(MSG_DEBUG, "RSN: Clear pairwise key for peer " ++ MACSTR, MAC2STR(addr)); ++ wpa_drv_set_key(ibss_rsn->wpa_s, WPA_ALG_NONE, addr, 0, 0, ++ NULL, 0, NULL, 0); ++ } ++ ++ if (peer && + peer->authentication_status & IBSS_RSN_AUTH_EAPOL_BY_PEER) { + if (peer->own_auth_tx.sec) { + struct os_reltime now, diff; diff --git a/package/network/services/hostapd/patches/004-hostapd-Add-possibility-to-send-debug-messages-to-sy.patch b/package/network/services/hostapd/patches/004-hostapd-Add-possibility-to-send-debug-messages-to-sy.patch new file mode 100644 index 0000000000..3417b5ac3c --- /dev/null +++ b/package/network/services/hostapd/patches/004-hostapd-Add-possibility-to-send-debug-messages-to-sy.patch @@ -0,0 +1,145 @@ +From cc3dae85bd694506cdea66ae532d452fb8716297 Mon Sep 17 00:00:00 2001 +From: Wojciech Dubowik +Date: Mon, 23 Jan 2017 13:55:04 +0100 +Subject: [PATCH] hostapd: Add possibility to send debug messages to syslog + +We can only send module specific messages to syslog and not debug +messages printed with wpa_printf. Add an extra command line parameter +'-s' to allow it. The feature is enabled with compile flag +CONFIG_DEBUG_SYSLOG as for wpa_supplicant and behaves in the same manner +as the wpa_supplicant -s command line argument. + +Signed-off-by: Wojciech Dubowik +--- + hostapd/Android.mk | 4 ++++ + hostapd/Makefile | 4 ++++ + hostapd/defconfig | 3 +++ + hostapd/main.c | 19 ++++++++++++++++++- + src/utils/wpa_debug.c | 2 +- + src/utils/wpa_debug.h | 3 +++ + 6 files changed, 33 insertions(+), 2 deletions(-) + +--- a/hostapd/Android.mk ++++ b/hostapd/Android.mk +@@ -952,6 +952,10 @@ ifdef CONFIG_NO_STDOUT_DEBUG + L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG + endif + ++ifdef CONFIG_DEBUG_SYSLOG ++L_CFLAGS += -DCONFIG_DEBUG_SYSLOG ++endif ++ + ifdef CONFIG_DEBUG_LINUX_TRACING + L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING + endif +--- a/hostapd/Makefile ++++ b/hostapd/Makefile +@@ -997,6 +997,10 @@ ifdef CONFIG_NO_STDOUT_DEBUG + CFLAGS += -DCONFIG_NO_STDOUT_DEBUG + endif + ++ifdef CONFIG_DEBUG_SYSLOG ++CFLAGS += -DCONFIG_DEBUG_SYSLOG ++endif ++ + ifdef CONFIG_DEBUG_LINUX_TRACING + CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING + endif +--- a/hostapd/defconfig ++++ b/hostapd/defconfig +@@ -166,6 +166,9 @@ CONFIG_IPV6=y + # Disabled by default. + #CONFIG_DEBUG_FILE=y + ++# Send debug messages to syslog instead of stdout ++#CONFIG_DEBUG_SYSLOG=y ++ + # Add support for sending all debug messages (regardless of debug verbosity) + # to the Linux kernel tracing facility. This helps debug the entire stack by + # making it easy to record everything happening from the driver up into the +--- a/hostapd/main.c ++++ b/hostapd/main.c +@@ -108,6 +108,10 @@ static void hostapd_logger_cb(void *ctx, + module_str ? module_str : "", + module_str ? ": " : "", txt); + ++#ifdef CONFIG_DEBUG_SYSLOG ++ if (wpa_debug_syslog) ++ conf_stdout = 0; ++#endif /* CONFIG_DEBUG_SYSLOG */ + if ((conf_stdout & module) && level >= conf_stdout_level) { + wpa_debug_print_timestamp(); + wpa_printf(MSG_INFO, "%s", format); +@@ -484,6 +488,9 @@ static void usage(void) + " (records all messages regardless of debug verbosity)\n" + #endif /* CONFIG_DEBUG_LINUX_TRACING */ + " -i list of interface names to use\n" ++#ifdef CONFIG_DEBUG_SYSLOG ++ " -s log output to syslog instead of stdout\n" ++#endif /* CONFIG_DEBUG_SYSLOG */ + " -S start all the interfaces synchronously\n" + " -t include timestamps in some debug messages\n" + " -v show hostapd version\n"); +@@ -661,7 +668,7 @@ int main(int argc, char *argv[]) + dl_list_init(&interfaces.global_ctrl_dst); + + for (;;) { +- c = getopt(argc, argv, "b:Bde:f:hi:KP:STtu:vg:G:"); ++ c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:"); + if (c < 0) + break; + switch (c) { +@@ -718,6 +725,11 @@ int main(int argc, char *argv[]) + bss_config = tmp_bss; + bss_config[num_bss_configs++] = optarg; + break; ++#ifdef CONFIG_DEBUG_SYSLOG ++ case 's': ++ wpa_debug_syslog = 1; ++ break; ++#endif /* CONFIG_DEBUG_SYSLOG */ + case 'S': + start_ifaces_in_sync = 1; + break; +@@ -746,6 +758,10 @@ int main(int argc, char *argv[]) + wpa_debug_open_file(log_file); + else + wpa_debug_setup_stdout(); ++#ifdef CONFIG_DEBUG_SYSLOG ++ if (wpa_debug_syslog) ++ wpa_debug_open_syslog(); ++#endif /* CONFIG_DEBUG_SYSLOG */ + #ifdef CONFIG_DEBUG_LINUX_TRACING + if (enable_trace_dbg) { + int tret = wpa_debug_open_linux_tracing(); +@@ -882,6 +898,7 @@ int main(int argc, char *argv[]) + hostapd_global_deinit(pid_file, interfaces.eloop_initialized); + os_free(pid_file); + ++ wpa_debug_close_syslog(); + if (log_file) + wpa_debug_close_file(); + wpa_debug_close_linux_tracing(); +--- a/src/utils/wpa_debug.c ++++ b/src/utils/wpa_debug.c +@@ -13,7 +13,7 @@ + #ifdef CONFIG_DEBUG_SYSLOG + #include + +-static int wpa_debug_syslog = 0; ++int wpa_debug_syslog = 0; + #endif /* CONFIG_DEBUG_SYSLOG */ + + #ifdef CONFIG_DEBUG_LINUX_TRACING +--- a/src/utils/wpa_debug.h ++++ b/src/utils/wpa_debug.h +@@ -14,6 +14,9 @@ + extern int wpa_debug_level; + extern int wpa_debug_show_keys; + extern int wpa_debug_timestamp; ++#ifdef CONFIG_DEBUG_SYSLOG ++extern int wpa_debug_syslog; ++#endif /* CONFIG_DEBUG_SYSLOG */ + + /* Debugging function - conditional printf and hex dump. Driver wrappers can + * use these for debugging purposes. */ diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch index 9ea3ef9c2d..f0348201ff 100644 --- a/package/network/services/hostapd/patches/200-multicall.patch +++ b/package/network/services/hostapd/patches/200-multicall.patch @@ -36,7 +36,7 @@ LIBS += $(DRV_AP_LIBS) ifdef CONFIG_L2_PACKET -@@ -1073,6 +1079,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) +@@ -1077,6 +1083,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) BCHECK=../src/drivers/build.hostapd @@ -49,7 +49,7 @@ hostapd: $(BCHECK) $(OBJS) $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) @$(E) " LD " $@ -@@ -1114,6 +1126,12 @@ HOBJS += ../src/crypto/aes-internal.o +@@ -1118,6 +1130,12 @@ HOBJS += ../src/crypto/aes-internal.o HOBJS += ../src/crypto/aes-internal-enc.o endif @@ -293,7 +293,7 @@ wpa_debug_open_file(params->wpa_debug_file_path); --- a/hostapd/main.c +++ b/hostapd/main.c -@@ -583,6 +583,11 @@ fail: +@@ -590,6 +590,11 @@ fail: return -1; } @@ -305,14 +305,14 @@ #ifdef CONFIG_WPS static int gen_uuid(const char *txt_addr) -@@ -660,6 +665,8 @@ int main(int argc, char *argv[]) +@@ -667,6 +672,8 @@ int main(int argc, char *argv[]) interfaces.global_ctrl_sock = -1; dl_list_init(&interfaces.global_ctrl_dst); + wpa_supplicant_event = hostapd_wpa_event; + wpa_supplicant_event_global = hostapd_wpa_event_global; for (;;) { - c = getopt(argc, argv, "b:Bde:f:hi:KP:STtu:vg:G:"); + c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:"); if (c < 0) --- a/src/drivers/drivers.c +++ b/src/drivers/drivers.c diff --git a/package/network/services/hostapd/patches/410-limit_debug_messages.patch b/package/network/services/hostapd/patches/410-limit_debug_messages.patch index a48b6962ee..b7dbbd0dc7 100644 --- a/package/network/services/hostapd/patches/410-limit_debug_messages.patch +++ b/package/network/services/hostapd/patches/410-limit_debug_messages.patch @@ -84,7 +84,7 @@ char *buf; --- a/src/utils/wpa_debug.h +++ b/src/utils/wpa_debug.h -@@ -49,6 +49,17 @@ int wpa_debug_reopen_file(void); +@@ -52,6 +52,17 @@ int wpa_debug_reopen_file(void); void wpa_debug_close_file(void); void wpa_debug_setup_stdout(void); @@ -102,7 +102,7 @@ /** * wpa_debug_printf_timestamp - Print timestamp for debug output * -@@ -69,9 +80,15 @@ void wpa_debug_print_timestamp(void); +@@ -72,9 +83,15 @@ void wpa_debug_print_timestamp(void); * * Note: New line '\n' is added to the end of the text when printing to stdout. */ @@ -119,7 +119,7 @@ /** * wpa_hexdump - conditional hex dump * @level: priority level (MSG_*) of the message -@@ -83,7 +100,13 @@ PRINTF_FORMAT(2, 3); +@@ -86,7 +103,13 @@ PRINTF_FORMAT(2, 3); * output may be directed to stdout, stderr, and/or syslog based on * configuration. The contents of buf is printed out has hex dump. */ @@ -134,7 +134,7 @@ static inline void wpa_hexdump_buf(int level, const char *title, const struct wpabuf *buf) -@@ -105,7 +128,13 @@ static inline void wpa_hexdump_buf(int l +@@ -108,7 +131,13 @@ static inline void wpa_hexdump_buf(int l * like wpa_hexdump(), but by default, does not include secret keys (passwords, * etc.) in debug output. */ @@ -149,7 +149,7 @@ static inline void wpa_hexdump_buf_key(int level, const char *title, const struct wpabuf *buf) -@@ -127,8 +156,14 @@ static inline void wpa_hexdump_buf_key(i +@@ -130,8 +159,14 @@ static inline void wpa_hexdump_buf_key(i * the hex numbers and ASCII characters (for printable range) are shown. 16 * bytes per line will be shown. */ @@ -166,7 +166,7 @@ /** * wpa_hexdump_ascii_key - conditional hex dump, hide keys -@@ -144,8 +179,14 @@ void wpa_hexdump_ascii(int level, const +@@ -147,8 +182,14 @@ void wpa_hexdump_ascii(int level, const * bytes per line will be shown. This works like wpa_hexdump_ascii(), but by * default, does not include secret keys (passwords, etc.) in debug output. */ @@ -183,7 +183,7 @@ /* * wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce -@@ -182,7 +223,12 @@ void wpa_hexdump_ascii_key(int level, co +@@ -185,7 +226,12 @@ void wpa_hexdump_ascii_key(int level, co * * Note: New line '\n' is added to the end of the text when printing to stdout. */ @@ -197,7 +197,7 @@ /** * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors -@@ -196,8 +242,13 @@ void wpa_msg(void *ctx, int level, const +@@ -199,8 +245,13 @@ void wpa_msg(void *ctx, int level, const * attached ctrl_iface monitors. In other words, it can be used for frequent * events that do not need to be sent to syslog. */ diff --git a/package/network/services/hostapd/patches/420-indicate-features.patch b/package/network/services/hostapd/patches/420-indicate-features.patch index 8abeafcace..ac699f4e49 100644 --- a/package/network/services/hostapd/patches/420-indicate-features.patch +++ b/package/network/services/hostapd/patches/420-indicate-features.patch @@ -8,16 +8,16 @@ #include "crypto/random.h" #include "crypto/tls.h" #include "common/version.h" -@@ -668,7 +669,7 @@ int main(int argc, char *argv[]) +@@ -675,7 +676,7 @@ int main(int argc, char *argv[]) wpa_supplicant_event = hostapd_wpa_event; wpa_supplicant_event_global = hostapd_wpa_event_global; for (;;) { -- c = getopt(argc, argv, "b:Bde:f:hi:KP:STtu:vg:G:"); -+ c = getopt(argc, argv, "b:Bde:f:hi:KP:STtu:g:G:v::"); +- c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:"); ++ c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:v::"); if (c < 0) break; switch (c) { -@@ -705,6 +706,8 @@ int main(int argc, char *argv[]) +@@ -712,6 +713,8 @@ int main(int argc, char *argv[]) break; #endif /* CONFIG_DEBUG_LINUX_TRACING */ case 'v': diff --git a/package/network/services/hostapd/patches/450-scan_wait.patch b/package/network/services/hostapd/patches/450-scan_wait.patch index 78cf3064fa..463a362911 100644 --- a/package/network/services/hostapd/patches/450-scan_wait.patch +++ b/package/network/services/hostapd/patches/450-scan_wait.patch @@ -9,7 +9,7 @@ #ifndef CONFIG_NO_HOSTAPD_LOGGER -@@ -143,6 +145,14 @@ static void hostapd_logger_cb(void *ctx, +@@ -147,6 +149,14 @@ static void hostapd_logger_cb(void *ctx, } #endif /* CONFIG_NO_HOSTAPD_LOGGER */ @@ -24,7 +24,7 @@ /** * hostapd_driver_init - Preparate driver interface -@@ -161,6 +171,8 @@ static int hostapd_driver_init(struct ho +@@ -165,6 +175,8 @@ static int hostapd_driver_init(struct ho return -1; } @@ -33,7 +33,7 @@ /* Initialize the driver interface */ if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5])) b = NULL; -@@ -401,8 +413,6 @@ static void hostapd_global_deinit(const +@@ -405,8 +417,6 @@ static void hostapd_global_deinit(const #endif /* CONFIG_NATIVE_WINDOWS */ eap_server_unregister_methods(); @@ -42,7 +42,7 @@ } -@@ -428,18 +438,6 @@ static int hostapd_global_run(struct hap +@@ -432,18 +442,6 @@ static int hostapd_global_run(struct hap } #endif /* EAP_SERVER_TNC */ @@ -61,7 +61,7 @@ eloop_run(); return 0; -@@ -638,8 +636,7 @@ int main(int argc, char *argv[]) +@@ -645,8 +643,7 @@ int main(int argc, char *argv[]) struct hapd_interfaces interfaces; int ret = 1; size_t i, j; diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index e758afb17d..ee892e2bae 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -156,7 +156,7 @@ /* * sta->capability is used in check_assoc_ies() for RRM enabled * capability element. -@@ -3023,7 +3049,7 @@ int ieee802_11_mgmt(struct hostapd_data +@@ -3025,7 +3051,7 @@ int ieee802_11_mgmt(struct hostapd_data if (stype == WLAN_FC_STYPE_PROBE_REQ) { @@ -165,7 +165,7 @@ return 1; } -@@ -3041,17 +3067,17 @@ int ieee802_11_mgmt(struct hostapd_data +@@ -3043,17 +3069,17 @@ int ieee802_11_mgmt(struct hostapd_data switch (stype) { case WLAN_FC_STYPE_AUTH: wpa_printf(MSG_DEBUG, "mgmt::auth"); diff --git a/package/network/services/hostapd/src/src/utils/build_features.h b/package/network/services/hostapd/src/src/utils/build_features.h index ffbb7978d9..315804361c 100644 --- a/package/network/services/hostapd/src/src/utils/build_features.h +++ b/package/network/services/hostapd/src/src/utils/build_features.h @@ -3,13 +3,25 @@ static inline int has_feature(const char *feat) { -#ifdef IEEE8021X_EAPOL +#if defined(IEEE8021X_EAPOL) || (defined(HOSTAPD) && !defined(CONFIG_NO_RADIUS)) if (!strcmp(feat, "eap")) return 1; #endif -#ifdef IEEE80211N +#ifdef CONFIG_IEEE80211N if (!strcmp(feat, "11n")) return 1; +#endif +#ifdef CONFIG_IEEE80211AC + if (!strcmp(feat, "11ac")) + return 1; +#endif +#ifdef CONFIG_IEEE80211R + if (!strcmp(feat, "11r")) + return 1; +#endif +#ifdef CONFIG_IEEE80211W + if (!strcmp(feat, "11w")) + return 1; #endif return 0; } diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 6813a0fdef..c0a7ceff2c 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -10,13 +10,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcpd PKG_RELEASE:=1 -PKG_SOURCE_URL:=git://git.lede-project.org/project/odhcpd.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2017-01-06 -PKG_SOURCE_VERSION:=ef3c5632c100fda0fa463a3ed56ff926f3f86b20 -PKG_MIRROR_HASH:=a870ae200dd4b0776f18f19051f75a6654108e8f25044d37c6d0856193c3ccf0 +PKG_SOURCE_URL=$(LEDE_GIT)/project/odhcpd.git +PKG_SOURCE_DATE:=2017-02-09 +PKG_SOURCE_VERSION:=8df4253ba73246d31f2e65f2004da3f9890c22c5 +PKG_MIRROR_HASH:=0040f94d11d0039505328a90b2ff48968db873e9e7967307631bf40ef5679275 -PKG_MAINTAINER:=Steven Barth +PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk @@ -33,7 +33,7 @@ define Package/odhcpd SECTION:=net CATEGORY:=Network TITLE:=OpenWrt DHCP/DHCPv6(-PD)/RA Server & Relay - DEPENDS:=+libubox +libuci +libubus + DEPENDS:=+libubox +libuci +libubus +libnl-tiny endef define Package/odhcpd/config diff --git a/package/network/services/openvpn/Makefile b/package/network/services/openvpn/Makefile index ab506d427c..7507e2029b 100644 --- a/package/network/services/openvpn/Makefile +++ b/package/network/services/openvpn/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openvpn PKG_VERSION:=2.4.0 -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_SOURCE_URL:=http://swupdate.openvpn.net/community/releases PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz @@ -34,6 +34,11 @@ define Package/openvpn/Default MENU:=1 DEPENDS:=+kmod-tun +OPENVPN_$(1)_ENABLE_LZO:liblzo +OPENVPN_$(1)_ENABLE_IPROUTE2:ip $(3) VARIANT:=$(1) +ifeq ($(1),nossl) + PROVIDES:=openvpn +else + PROVIDES:=openvpn openvpn-crypto +endif MAINTAINER:=Mirko Vogt endef diff --git a/package/network/services/openvpn/files/openvpn.init b/package/network/services/openvpn/files/openvpn.init index 0fcdc7eea0..d1f37d5c0f 100644 --- a/package/network/services/openvpn/files/openvpn.init +++ b/package/network/services/openvpn/files/openvpn.init @@ -95,38 +95,33 @@ start_instance() { # append flags append_bools "$s" \ - auth_nocache auth_user_pass_optional bind ccd_exclusive client client_cert_not_required \ - client_to_client comp_noadapt disable \ - disable_occ down_pre duplicate_cn fast_io float http_proxy_retry \ + allow_recursive_routing auth_nocache auth_user_pass_optional bind ccd_exclusive client client_cert_not_required \ + client_to_client comp_noadapt disable disable_occ down_pre duplicate_cn fast_io float http_proxy_retry \ ifconfig_noexec ifconfig_nowarn ifconfig_pool_linear management_forget_disconnect management_hold \ management_query_passwords management_signal mktun mlock mtu_test multihome mute_replay_warnings \ - nobind no_iv no_name_remapping no_replay opt_verify passtos persist_key persist_local_ip \ - persist_remote_ip persist_tun ping_timer_rem pull push_reset \ - remote_random rmtun route_noexec route_nopull single_session socks_proxy_retry \ - suppress_timestamps tcp_nodelay test_crypto tls_client tls_exit tls_server \ + ncp_disable nobind no_iv no_name_remapping no_replay opt_verify passtos persist_key persist_local_ip \ + persist_remote_ip persist_tun ping_timer_rem pull push_reset remote_random rmtun route_noexec route_nopull \ + single_session socks_proxy_retry suppress_timestamps tcp_nodelay test_crypto tls_client tls_exit tls_server \ tun_ipv6 up_delay up_restart username_as_common_name # append params append_params "$s" \ cd askpass auth auth_retry auth_user_pass auth_user_pass_verify bcast_buffers ca cert capath \ - chroot cipher client_config_dir client_connect client_disconnect comp_lzo connect_freq \ + chroot cipher client_config_dir client_connect client_disconnect comp_lzo compress connect_freq \ connect_retry connect_timeout connect_retry_max crl_verify dev dev_node dev_type dh \ - echo engine explicit_exit_notify fragment group hand_window hash_size \ - http_proxy http_proxy_option http_proxy_timeout ifconfig ifconfig_pool \ - ifconfig_pool_persist ifconfig_push inactive ipchange iroute keepalive \ - key key_method keysize learn_address link_mtu lladdr local log log_append \ - lport management management_log_cache max_clients \ - max_routes_per_client mode mssfix mtu_disc mute nice ns_cert_type ping \ - ping_exit ping_restart pkcs12 plugin port port_share prng proto rcvbuf \ - redirect_gateway remap_usr1 remote remote_cert_eku remote_cert_ku remote_cert_tls \ - reneg_bytes reneg_pkts reneg_sec \ - replay_persist replay_window resolv_retry route route_delay route_gateway \ - route_metric route_pre_down route_up rport script_security secret server server_bridge setenv shaper sndbuf \ - socks_proxy status status_version syslog tcp_queue_limit tls_auth tls_version_min \ - tls_cipher tls_remote tls_timeout tls_verify tmp_dir topology tran_window \ - tun_mtu tun_mtu_extra txqueuelen user verb down push up \ - verify_x509_name x509_username_field \ - ifconfig_ipv6 route_ipv6 server_ipv6 ifconfig_ipv6_pool ifconfig_ipv6_push iroute_ipv6 + ecdh_curve echo engine explicit_exit_notify fragment group hand_window hash_size http_proxy \ + http_proxy_option http_proxy_timeout ifconfig ifconfig_pool ifconfig_pool_persist ifconfig_push \ + inactive ipchange iroute keepalive key key_direction key_method keysize learn_address link_mtu lladdr \ + local log log_append lport management management_log_cache max_clients max_routes_per_client mode \ + mssfix mtu_disc mute ncp_ciphers nice ns_cert_type ping ping_exit ping_restart pkcs12 plugin \ + port port_share prng proto pull_filter rcvbuf redirect_gateway remap_usr1 remote remote_cert_eku \ + remote_cert_ku remote_cert_tls reneg_bytes reneg_pkts reneg_sec replay_persist replay_window \ + resolv_retry route route_delay route_gateway route_metric route_pre_down route_up rport \ + script_security secret server server_bridge setenv shaper sndbuf socks_proxy status status_version \ + syslog tcp_queue_limit tls_auth tls_crypt tls_version_min tls_cipher tls_timeout \ + tls_verify tmp_dir topology tran_window tun_mtu tun_mtu_extra txqueuelen user verb \ + down push up verify_x509_name x509_username_field ifconfig_ipv6 route_ipv6 server_ipv6 \ + ifconfig_ipv6_pool ifconfig_ipv6_push iroute_ipv6 openvpn_add_instance "$s" "/var/etc" "openvpn-$s.conf" } diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index 8b58c1c06f..8b0daf2295 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ppp PKG_VERSION:=2.4.7 -PKG_RELEASE:=10 +PKG_RELEASE:=11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://download.samba.org/pub/ppp/ @@ -30,7 +30,7 @@ include $(INCLUDE_DIR)/package.mk define Package/ppp/Default SECTION:=net CATEGORY:=Network - URL:=http://ppp.samba.org/ + URL:=https://ppp.samba.org/ endef define Package/ppp @@ -158,6 +158,17 @@ define Package/pppstats/description This package contains an utility to report PPP statistics. endef +define Package/pppoe-discovery +$(call Package/ppp/Default) + DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +ppp-mod-pppoe + TITLE:=Perform a PPPoE-discovery process +endef + +define Package/pppoe-discovery/description +This tool performs the same discovery process as pppoe, but does +not initiate a session. Can be useful to debug pppoe. +endef + define Build/Configure $(call Build/Configure/Default,, \ @@ -274,6 +285,11 @@ define Package/pppstats/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppstats $(1)/usr/sbin/ endef +define Package/pppoe-discovery/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppoe-discovery $(1)/usr/sbin/ +endef + $(eval $(call BuildPackage,ppp)) $(eval $(call BuildPackage,ppp-multilink)) $(eval $(call BuildPackage,ppp-mod-pppoa)) @@ -285,3 +301,4 @@ $(eval $(call BuildPackage,ppp-mod-passwordfd)) $(eval $(call BuildPackage,chat)) $(eval $(call BuildPackage,pppdump)) $(eval $(call BuildPackage,pppstats)) +$(eval $(call BuildPackage,pppoe-discovery)) diff --git a/package/network/services/ppp/files/lib/netifd/ppp6-up b/package/network/services/ppp/files/lib/netifd/ppp6-up old mode 100644 new mode 100755 index 87ca63c751..8ad03223e5 --- a/package/network/services/ppp/files/lib/netifd/ppp6-up +++ b/package/network/services/ppp/files/lib/netifd/ppp6-up @@ -22,6 +22,8 @@ if [ -n "$AUTOIPV6" ]; then json_add_string ifname "@$PPP_IPPARAM" json_add_string proto "dhcpv6" [ -n "$EXTENDPREFIX" ] && json_add_string extendprefix 1 + [ -n "$IP6TABLE" ] && json_add_string ip6table $IP6TABLE + [ -n "$PEERDNS" ] && json_add_boolean peerdns $PEERDNS json_close_object ubus call network add_dynamic "$(json_dump)" fi diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh index 91452b4288..73bc3161cd 100755 --- a/package/network/services/ppp/files/ppp.sh +++ b/package/network/services/ppp/files/ppp.sh @@ -88,7 +88,7 @@ ppp_generic_setup() { local config="$1"; shift local localip - json_get_vars ipv6 demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered persist maxfail holdoff + json_get_vars ipv6 ip6table demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered persist maxfail holdoff peerdns if [ "$ipv6" = 0 ]; then ipv6="" elif [ -z "$ipv6" -o "$ipv6" = auto ]; then @@ -136,6 +136,8 @@ ppp_generic_setup() { ${lcp_failure:+lcp-echo-interval $lcp_interval lcp-echo-failure $lcp_failure $lcp_adaptive} \ ${ipv6:++ipv6} \ ${autoipv6:+set AUTOIPV6=1} \ + ${ip6table:+set IP6TABLE=$ip6table} \ + ${peerdns:+set PEERDNS=$peerdns} \ nodefaultroute \ usepeerdns \ $demand $persist maxfail $maxfail \ diff --git a/package/network/services/relayd/Makefile b/package/network/services/relayd/Makefile index 25c56d49c6..dcb69a11b5 100644 --- a/package/network/services/relayd/Makefile +++ b/package/network/services/relayd/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=relayd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL=$(LEDE_GIT)/project/relayd.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/relayd/files/relay.init b/package/network/services/relayd/files/relay.init index 028b61ea36..5c7a0f9efe 100644 --- a/package/network/services/relayd/files/relay.init +++ b/package/network/services/relayd/files/relay.init @@ -19,9 +19,7 @@ validate_proto_relayd() resolve_ifname() { grep -qs "^ *$1:" /proc/net/dev && { - procd_append_param command -I "$1" - procd_append_param netdev "$1" - append ifaces "$1" + append resolved_ifnames "$1" } } @@ -35,9 +33,7 @@ resolve_network() { start_relay() { local cfg="$1" - - local args="" - local ifaces="" + local proto disabled config_get proto "$cfg" proto [ "$proto" = "relay" ] || return 0 @@ -45,20 +41,7 @@ start_relay() { config_get_bool disabled "$cfg" disabled 0 [ "$disabled" -gt 0 ] && return 0 - SERVICE_DAEMONIZE=1 - SERVICE_WRITE_PID=1 - SERVICE_PID_FILE="/var/run/relay-$cfg.pid" - [ -f "$SERVICE_PID_FILE" ] && { - if grep -q relayd "/proc/$(cat $SERVICE_PID_FILE)/cmdline"; then - return 0 - else - rm -f "$SERVICE_PID_FILE" - fi - } - - procd_open_instance - procd_set_param command "$PROG" - + local resolved_ifnames local net networks config_get networks "$cfg" network for net in $networks; do @@ -70,9 +53,18 @@ start_relay() { local ifn ifnames config_get ifnames "$cfg" ifname for ifn in $ifnames; do - resolve_ifname "$ifn" + resolve_ifname "$ifn" || { + return 1 + } done + procd_open_instance + procd_set_param command "$PROG" + + for ifn in $resolved_ifnames; do + procd_append_param command -I "$ifn" + procd_append_param netdev "$ifn" + done local ipaddr config_get ipaddr "$cfg" ipaddr [ -n "$ipaddr" ] && procd_append_param command -L "$ipaddr" diff --git a/package/network/services/samba36/Makefile b/package/network/services/samba36/Makefile index 1311e09001..fcf772195a 100644 --- a/package/network/services/samba36/Makefile +++ b/package/network/services/samba36/Makefile @@ -11,8 +11,8 @@ PKG_NAME:=samba PKG_VERSION:=3.6.25 PKG_RELEASE:=5 -PKG_SOURCE_URL:=http://ftp.samba.org/pub/samba \ - http://ftp.samba.org/pub/samba/stable +PKG_SOURCE_URL:=https://download.samba.org/pub/samba \ + https://download.samba.org/pub/samba/stable PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_HASH:=8f2c8a7f2bd89b0dfd228ed917815852f7c625b2bc0936304ac3ed63aaf83751 @@ -34,7 +34,7 @@ define Package/samba36-server SECTION:=net CATEGORY:=Network TITLE:=Samba 3.6 SMB/CIFS server - URL:=http://www.samba.org/ + URL:=https://www.samba.org/ DEPENDS:=+USE_GLIBC:librt $(ICONV_DEPENDS) endef @@ -42,7 +42,7 @@ define Package/samba36-client SECTION:=net CATEGORY:=Network TITLE:=Samba 3.6 SMB/CIFS client - URL:=http://www.samba.org/ + URL:=https://www.samba.org/ DEPENDS:=+libreadline +libncurses endef diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init index 53bf04c921..6b8be1c7e4 100755 --- a/package/network/services/uhttpd/files/uhttpd.init +++ b/package/network/services/uhttpd/files/uhttpd.init @@ -47,7 +47,7 @@ generate_keys() { # Prefer px5g for certificate generation (existence evaluated last) local GENKEY_CMD="" local UNIQUEID=$(dd if=/dev/urandom bs=1 count=4 | hexdump -e '1/1 "%02x"') - [ -x "$OPENSSL_BIN" ] && GENKEY_CMD="$OPENSSL_BIN req -x509 -outform der -nodes" + [ -x "$OPENSSL_BIN" ] && GENKEY_CMD="$OPENSSL_BIN req -x509 -sha256 -outform der -nodes" [ -x "$PX5G_BIN" ] && GENKEY_CMD="$PX5G_BIN selfsigned -der" [ -n "$GENKEY_CMD" ] && { $GENKEY_CMD \ diff --git a/package/network/services/mdns/Makefile b/package/network/services/umdns/Makefile similarity index 56% rename from package/network/services/mdns/Makefile rename to package/network/services/umdns/Makefile index b36176e1ae..2323cf4b36 100644 --- a/package/network/services/mdns/Makefile +++ b/package/network/services/umdns/Makefile @@ -7,14 +7,14 @@ include $(TOPDIR)/rules.mk -PKG_NAME:=mdns +PKG_NAME:=umdns PKG_RELEASE:=1 PKG_SOURCE_URL=$(LEDE_GIT)/project/mdnsd.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2016-12-19 -PKG_SOURCE_VERSION:=be8ae8d0b5f2e8651edf0cc8f35916fc4b71d1ac -PKG_MIRROR_HASH:=fd6e8b17407b9e6dc96f485c62f54e02a0ab27b5878c271f95749495970dacc2 +PKG_SOURCE_DATE:=2017-03-10 +PKG_SOURCE_VERSION:=d4376788601c38963c4c836d325e3a66498079ea +PKG_MIRROR_HASH:=be60c437e13cf712b967af08c7cf8bda8dc3ad6d169965e3108fe3107c59009b PKG_MAINTAINER:=John Crispin PKG_LICENSE:=LGPL-2.1 @@ -23,7 +23,7 @@ include $(INCLUDE_DIR)/package-seccomp.mk include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk -define Package/mdns +define Package/umdns SECTION:=net CATEGORY:=Network TITLE:=OpenWrt Multicast DNS Daemon @@ -32,16 +32,16 @@ endef TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -define Package/mdns/conffiles -/etc/config/mdns +define Package/umdns/conffiles +/etc/config/umdns endef -define Package/mdns/install +define Package/umdns/install $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config - $(INSTALL_BIN) $(PKG_BUILD_DIR)/mdns $(1)/usr/sbin/ - $(INSTALL_BIN) ./files/mdns.init $(1)/etc/init.d/mdns - $(INSTALL_CONF) ./files/mdns.config $(1)/etc/config/mdns - $(call InstallSeccomp,$(1),./files/mdns.json) + $(INSTALL_BIN) $(PKG_BUILD_DIR)/umdns $(1)/usr/sbin/ + $(INSTALL_BIN) ./files/umdns.init $(1)/etc/init.d/umdns + $(INSTALL_CONF) ./files/umdns.config $(1)/etc/config/umdns + $(call InstallSeccomp,$(1),./files/umdns.json) endef -$(eval $(call BuildPackage,mdns)) +$(eval $(call BuildPackage,umdns)) diff --git a/package/network/services/mdns/files/mdns.config b/package/network/services/umdns/files/umdns.config similarity index 71% rename from package/network/services/mdns/files/mdns.config rename to package/network/services/umdns/files/umdns.config index b09eaf5c89..d4936bb092 100644 --- a/package/network/services/mdns/files/mdns.config +++ b/package/network/services/umdns/files/umdns.config @@ -1,3 +1,3 @@ -config mdns +config umdns option jail 1 list network lan diff --git a/package/network/services/mdns/files/mdns.init b/package/network/services/umdns/files/umdns.init similarity index 59% rename from package/network/services/mdns/files/mdns.init rename to package/network/services/umdns/files/umdns.init index c0f9155c06..627930b88d 100644 --- a/package/network/services/mdns/files/mdns.init +++ b/package/network/services/umdns/files/umdns.init @@ -6,11 +6,11 @@ START=80 USE_PROCD=1 -PROG=/usr/sbin/mdns +PROG=/usr/sbin/umdns IFACES="" load_ifaces() { - local network="$(uci get mdns.@mdns[-1].network)" + local network="$(uci get umdns.@umdns[-1].network)" for n in $network; do local device json_load "$(ifstatus $n)" @@ -27,28 +27,28 @@ reload_service() { done json_close_array - ubus call mdns set_config "$(json_dump)" + ubus call umdns set_config "$(json_dump)" } start_service() { - local network="$(uci get mdns.@mdns[-1].network)" + local network="$(uci get umdns.@umdns[-1].network)" procd_open_instance procd_set_param command "$PROG" - procd_set_param seccomp /etc/seccomp/mdns.json + procd_set_param seccomp /etc/seccomp/umdns.json procd_set_param respawn procd_open_trigger - procd_add_config_trigger "config.change" "mdns" /etc/init.d/mdns reload + procd_add_config_trigger "config.change" "umdns" /etc/init.d/umdns reload for n in $network; do - procd_add_interface_trigger "interface.*" $n /etc/init.d/mdns reload + procd_add_interface_trigger "interface.*" $n /etc/init.d/umdns reload done - procd_add_raw_trigger "instance.update" 5000 "/bin/ubus" "call" "mdns" "reload" + procd_add_raw_trigger "instance.update" 5000 "/bin/ubus" "call" "umdns" "reload" procd_close_trigger - [ "$(uci get mdns.@mdns[-1].jail)" = 1 ] && procd_add_jail mdns ubus log + [ "$(uci get umdns.@umdns[-1].jail)" = 1 ] && procd_add_jail umdns ubus log procd_close_instance } service_started() { - ubus -t 10 wait_for mdns + ubus -t 10 wait_for umdns [ $? = 0 ] && reload_service } diff --git a/package/network/services/mdns/files/mdns.json b/package/network/services/umdns/files/umdns.json similarity index 100% rename from package/network/services/mdns/files/mdns.json rename to package/network/services/umdns/files/umdns.json diff --git a/package/network/utils/comgt/Makefile b/package/network/utils/comgt/Makefile index 9ddc61758f..3926016581 100644 --- a/package/network/utils/comgt/Makefile +++ b/package/network/utils/comgt/Makefile @@ -21,6 +21,8 @@ PKG_LICENSE:=GPL-2.0+ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION) PKG_CHECK_FORMAT_SECURITY:=0 +PKG_FLAGS:=nonshared + include $(INCLUDE_DIR)/package.mk define Package/comgt/Default diff --git a/package/network/utils/curl/Makefile b/package/network/utils/curl/Makefile index 950044a226..68558a9eda 100644 --- a/package/network/utils/curl/Makefile +++ b/package/network/utils/curl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=curl PKG_VERSION:=7.52.1 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://curl.haxx.se/download/ \ diff --git a/package/network/utils/curl/patches/001-curl-https-openssl-fix.patch b/package/network/utils/curl/patches/001-curl-https-openssl-fix.patch new file mode 100644 index 0000000000..9658ef554b --- /dev/null +++ b/package/network/utils/curl/patches/001-curl-https-openssl-fix.patch @@ -0,0 +1,34 @@ +From a7b38c9dc98481e4a5fc37e51a8690337c674dfb Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Mon, 26 Dec 2016 00:06:33 +0100 +Subject: [PATCH] vtls: s/SSLEAY/OPENSSL + +Fixed an old leftover use of the USE_SSLEAY define which would make a +socket get removed from the applications sockets to monitor when the +multi_socket API was used, leading to timeouts. + +Bug: #1174 +--- + lib/vtls/vtls.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/lib/vtls/vtls.c ++++ b/lib/vtls/vtls.c +@@ -484,7 +484,7 @@ void Curl_ssl_close_all(struct Curl_easy + curlssl_close_all(data); + } + +-#if defined(USE_SSLEAY) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \ ++#if defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \ + defined(USE_DARWINSSL) || defined(USE_NSS) + /* This function is for OpenSSL, GnuTLS, darwinssl, and schannel only. */ + int Curl_ssl_getsock(struct connectdata *conn, curl_socket_t *socks, +@@ -518,7 +518,7 @@ int Curl_ssl_getsock(struct connectdata + (void)numsocks; + return GETSOCK_BLANK; + } +-/* USE_SSLEAY || USE_GNUTLS || USE_SCHANNEL || USE_DARWINSSL || USE_NSS */ ++/* USE_OPENSSL || USE_GNUTLS || USE_SCHANNEL || USE_DARWINSSL || USE_NSS */ + #endif + + void Curl_ssl_close(struct connectdata *conn, int sockindex) diff --git a/package/network/utils/curl/patches/100-CVE-2017-2629.patch b/package/network/utils/curl/patches/100-CVE-2017-2629.patch new file mode 100644 index 0000000000..f2cd869c5b --- /dev/null +++ b/package/network/utils/curl/patches/100-CVE-2017-2629.patch @@ -0,0 +1,33 @@ +From a00a42b4abe8363a46071bb3b43b1b7138f5259b Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Sun, 22 Jan 2017 18:11:55 +0100 +Subject: [PATCH] TLS: make SSL_VERIFYSTATUS work again + +The CURLOPT_SSL_VERIFYSTATUS option was not properly handled by libcurl +and thus even if the status couldn't be verified, the connection would +be allowed and the user would not be told about the failed verification. + +Regression since cb4e2be7c6d42ca + +CVE-2017-2629 +Bug: https://curl.haxx.se/docs/adv_20170222.html + +Reported-by: Marcus Hoffmann +--- + lib/url.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/lib/url.c ++++ b/lib/url.c +@@ -4141,8 +4141,11 @@ static struct connectdata *allocate_conn + conn->bits.ftp_use_epsv = data->set.ftp_use_epsv; + conn->bits.ftp_use_eprt = data->set.ftp_use_eprt; + ++ conn->ssl_config.verifystatus = data->set.ssl.primary.verifystatus; + conn->ssl_config.verifypeer = data->set.ssl.primary.verifypeer; + conn->ssl_config.verifyhost = data->set.ssl.primary.verifyhost; ++ conn->proxy_ssl_config.verifystatus = ++ data->set.proxy_ssl.primary.verifystatus; + conn->proxy_ssl_config.verifypeer = data->set.proxy_ssl.primary.verifypeer; + conn->proxy_ssl_config.verifyhost = data->set.proxy_ssl.primary.verifyhost; + diff --git a/package/network/utils/ebtables/Makefile b/package/network/utils/ebtables/Makefile index 93bb23e5ab..da7b7416af 100644 --- a/package/network/utils/ebtables/Makefile +++ b/package/network/utils/ebtables/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ebtables -PKG_VERSION:=2.0.10-4 -PKG_RELEASE:=5 +PKG_SOURCE_DATE:=2015-10-28 +PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=@SF/ebtables -PKG_HASH:=dc6f7b484f207dc712bfca81645f45120cb6aee3380e77a1771e9c34a9a4455d +PKG_SOURCE_URL:=git://git.netfilter.org/ebtables +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=4c3e5cd3dbae3ea773e9dcca7cf019b2713af70d +PKG_MIRROR_HASH:=997a877da02d6e2141e6d31c5d4dd005737facecfdbea07308c0e1286db8591c -PKG_BUILD_DIR:=$(BUILD_DIR)/ebtables-v$(PKG_VERSION) PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/utils/ebtables/patches/100-musl_fix.patch b/package/network/utils/ebtables/patches/100-musl_fix.patch index 0ac1fbfecf..3fe5845897 100644 --- a/package/network/utils/ebtables/patches/100-musl_fix.patch +++ b/package/network/utils/ebtables/patches/100-musl_fix.patch @@ -1,181 +1,10 @@ ---- a/extensions/ebt_among.c -+++ b/extensions/ebt_among.c -@@ -13,7 +13,6 @@ - #include - #include - #include "../include/ebtables_u.h" --#include - #include "../include/ethernetdb.h" - #include - #include ---- a/extensions/ebt_arpreply.c -+++ b/extensions/ebt_arpreply.c -@@ -12,7 +12,6 @@ - #include - #include - #include "../include/ebtables_u.h" --#include - #include - - static int mac_supplied; ---- a/extensions/ebt_nat.c -+++ b/extensions/ebt_nat.c -@@ -11,7 +11,6 @@ - #include - #include - #include "../include/ebtables_u.h" --#include - #include - - static int to_source_supplied, to_dest_supplied; ---- a/useful_functions.c -+++ b/useful_functions.c -@@ -25,7 +25,6 @@ - #include "include/ebtables_u.h" - #include "include/ethernetdb.h" - #include --#include - #include - #include - #include --- a/include/ebtables_u.h +++ b/include/ebtables_u.h -@@ -23,7 +23,9 @@ +@@ -23,6 +23,7 @@ #ifndef EBTABLES_U_H #define EBTABLES_U_H -+#include ++#define _NETINET_IF_ETHER_H #include -+#include #include #include - ---- a/include/linux/if_ether.h -+++ /dev/null -@@ -1,126 +0,0 @@ --/* -- * INET An implementation of the TCP/IP protocol suite for the LINUX -- * operating system. INET is implemented using the BSD Socket -- * interface as the means of communication with the user level. -- * -- * Global definitions for the Ethernet IEEE 802.3 interface. -- * -- * Version: @(#)if_ether.h 1.0.1a 02/08/94 -- * -- * Author: Fred N. van Kempen, -- * Donald Becker, -- * Alan Cox, -- * Steve Whitehouse, -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of the GNU General Public License -- * as published by the Free Software Foundation; either version -- * 2 of the License, or (at your option) any later version. -- */ -- --#ifndef _LINUX_IF_ETHER_H --#define _LINUX_IF_ETHER_H -- --#include -- --/* -- * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble -- * and FCS/CRC (frame check sequence). -- */ -- --#define ETH_ALEN 6 /* Octets in one ethernet addr */ --#define ETH_HLEN 14 /* Total octets in header. */ --#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */ --#define ETH_DATA_LEN 1500 /* Max. octets in payload */ --#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */ --#define ETH_FCS_LEN 4 /* Octets in the FCS */ -- --/* -- * These are the defined Ethernet Protocol ID's. -- */ -- --#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */ --#define ETH_P_PUP 0x0200 /* Xerox PUP packet */ --#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */ --#define ETH_P_IP 0x0800 /* Internet Protocol packet */ --#define ETH_P_X25 0x0805 /* CCITT X.25 */ --#define ETH_P_ARP 0x0806 /* Address Resolution packet */ --#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */ --#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */ --#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */ --#define ETH_P_DEC 0x6000 /* DEC Assigned proto */ --#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */ --#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */ --#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */ --#define ETH_P_LAT 0x6004 /* DEC LAT */ --#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */ --#define ETH_P_CUST 0x6006 /* DEC Customer use */ --#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */ --#define ETH_P_TEB 0x6558 /* Trans Ether Bridging */ --#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */ --#define ETH_P_ATALK 0x809B /* Appletalk DDP */ --#define ETH_P_AARP 0x80F3 /* Appletalk AARP */ --#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */ --#define ETH_P_IPX 0x8137 /* IPX over DIX */ --#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */ --#define ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */ --#define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */ --#define ETH_P_WCCP 0x883E /* Web-cache coordination protocol -- * defined in draft-wilson-wrec-wccp-v2-00.txt */ --#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */ --#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */ --#define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */ --#define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */ --#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */ --#define ETH_P_LINK_CTL 0x886c /* HPNA, wlan link local tunnel */ --#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport -- * over Ethernet -- */ --#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ --#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ --#define ETH_P_TIPC 0x88CA /* TIPC */ --#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ --#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ --#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ --#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ -- --/* -- * Non DIX types. Won't clash for 1500 types. -- */ -- --#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */ --#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */ --#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */ --#define ETH_P_802_2 0x0004 /* 802.2 frames */ --#define ETH_P_SNAP 0x0005 /* Internal only */ --#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */ --#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/ --#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */ --#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */ --#define ETH_P_CAN 0x000C /* Controller Area Network */ --#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/ --#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */ --#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */ --#define ETH_P_CONTROL 0x0016 /* Card specific control frames */ --#define ETH_P_IRDA 0x0017 /* Linux-IrDA */ --#define ETH_P_ECONET 0x0018 /* Acorn Econet */ --#define ETH_P_HDLC 0x0019 /* HDLC frames */ --#define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */ --#define ETH_P_DSA 0x001B /* Distributed Switch Arch. */ --#define ETH_P_TRAILER 0x001C /* Trailer switch tagging */ --#define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */ --#define ETH_P_IEEE802154 0x00F6 /* IEEE802.15.4 frame */ --#define ETH_P_CAIF 0x00F7 /* ST-Ericsson CAIF protocol */ -- --/* -- * This is an Ethernet frame header. -- */ -- --struct ethhdr { -- unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ -- unsigned char h_source[ETH_ALEN]; /* source ether addr */ -- __be16 h_proto; /* packet type ID field */ --} __attribute__((packed)); -- -- --#endif /* _LINUX_IF_ETHER_H */ diff --git a/package/network/utils/ebtables/patches/200-fix-extension-init.patch b/package/network/utils/ebtables/patches/200-fix-extension-init.patch index 63d237708f..b77df159aa 100644 --- a/package/network/utils/ebtables/patches/200-fix-extension-init.patch +++ b/package/network/utils/ebtables/patches/200-fix-extension-init.patch @@ -29,7 +29,7 @@ } --- a/extensions/ebt_among.c +++ b/extensions/ebt_among.c -@@ -490,7 +490,7 @@ static struct ebt_u_match among_match = +@@ -491,7 +491,7 @@ static struct ebt_u_match among_match = .extra_ops = opts, }; @@ -51,7 +51,7 @@ } --- a/extensions/ebt_arpreply.c +++ b/extensions/ebt_arpreply.c -@@ -132,7 +132,7 @@ static struct ebt_u_target arpreply_targ +@@ -133,7 +133,7 @@ static struct ebt_u_target arpreply_targ .extra_ops = opts, }; @@ -73,7 +73,7 @@ } --- a/extensions/ebt_ip6.c +++ b/extensions/ebt_ip6.c -@@ -556,7 +556,7 @@ static struct ebt_u_match ip6_match = +@@ -560,7 +560,7 @@ static struct ebt_u_match ip6_match = .extra_ops = opts, }; @@ -128,7 +128,7 @@ } --- a/extensions/ebt_nat.c +++ b/extensions/ebt_nat.c -@@ -230,7 +230,7 @@ static struct ebt_u_target dnat_target = +@@ -231,7 +231,7 @@ static struct ebt_u_target dnat_target = .extra_ops = opts_d, }; diff --git a/package/network/utils/iftop/Makefile b/package/network/utils/iftop/Makefile index 5bbee31fd7..8c5b47444f 100644 --- a/package/network/utils/iftop/Makefile +++ b/package/network/utils/iftop/Makefile @@ -8,16 +8,18 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iftop -PKG_VERSION:=1.0pre4 -PKG_RELEASE:=2 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.ex-parrot.com/~pdw/iftop/download -PKG_HASH:=f733eeea371a7577f8fe353d86dd88d16f5b2a2e702bd96f5ffb2c197d9b4f97 +PKG_RELEASE:=1 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://code.blinkace.com/pdw/iftop.git +PKG_SOURCE_DATE:=2017-02-06 +PKG_SOURCE_VERSION:=35af3cf65f17961d173b31fd3b00166ec095c226 +PKG_MIRROR_HASH:=84131e2448ea5aa884d2bd7d58dc81741b5c476b4664a8c2c1eb34f62985804a PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 +PKG_FIXUP:=autoreconf + include $(INCLUDE_DIR)/package.mk define Package/iftop diff --git a/package/network/utils/iftop/patches/110-fix-mac-display.patch b/package/network/utils/iftop/patches/110-fix-mac-display.patch deleted file mode 100644 index 5db53aaa52..0000000000 --- a/package/network/utils/iftop/patches/110-fix-mac-display.patch +++ /dev/null @@ -1,67 +0,0 @@ -iftop: fix mac address display - -iftop would display portions of mac address with large ffffff prefixes. -Make if_hw_addr type consistent. - -Signed-off-by: Kevin Darbyshire-Bryant ---- - addrs_dlpi.c | 2 +- - addrs_ioctl.c | 2 +- - addrs_ioctl.h | 2 +- - iftop.c | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/addrs_dlpi.c b/addrs_dlpi.c -index 188fef8..6c04ea1 100644 ---- a/addrs_dlpi.c -+++ b/addrs_dlpi.c -@@ -50,7 +50,7 @@ extern char *strncat2(char *dest, char *src, int n); - */ - - int --get_addrs_dlpi(char *interface, char if_hw_addr[], struct in_addr *if_ip_addr) -+get_addrs_dlpi(char *interface, u_int8_t if_hw_addr[], struct in_addr *if_ip_addr) - { - int got_hw_addr = 0; - int got_ip_addr = 0; -diff --git a/addrs_ioctl.c b/addrs_ioctl.c -index 870c83b..7d01fb2 100644 ---- a/addrs_ioctl.c -+++ b/addrs_ioctl.c -@@ -45,7 +45,7 @@ - */ - - int --get_addrs_ioctl(char *interface, char if_hw_addr[], struct in_addr *if_ip_addr, struct in6_addr *if_ip6_addr) -+get_addrs_ioctl(char *interface, u_int8_t if_hw_addr[], struct in_addr *if_ip_addr, struct in6_addr *if_ip6_addr) - { - int s; - struct ifreq ifr = {}; -diff --git a/addrs_ioctl.h b/addrs_ioctl.h -index f93a0b4..739de61 100644 ---- a/addrs_ioctl.h -+++ b/addrs_ioctl.h -@@ -7,6 +7,6 @@ - #define __ADDRS_IOCTL_H_ - - int --get_addrs_ioctl(char *interface, char if_hw_addr[], struct in_addr *if_ip_addr, struct in6_addr *if_ip6_addr); -+get_addrs_ioctl(char *interface, u_int8_t if_hw_addr[], struct in_addr *if_ip_addr, struct in6_addr *if_ip6_addr); - - #endif /* __ADDRS_IOCTL_H_ */ -diff --git a/iftop.c b/iftop.c -index a090dcf..f1b371a 100644 ---- a/iftop.c -+++ b/iftop.c -@@ -55,7 +55,7 @@ - - /* ethernet address of interface. */ - int have_hw_addr = 0; --char if_hw_addr[6]; -+u_int8_t if_hw_addr[6]; - - /* IP address of interface */ - int have_ip_addr = 0; --- -1.9.1 - diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 620cce22a0..1c1ee3f24e 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 PKG_VERSION:=4.4.0 -PKG_RELEASE:=6 +PKG_RELEASE:=9 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 diff --git a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch index 6c73fbaf25..8da17112be 100644 --- a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch +++ b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch @@ -1,6 +1,8 @@ +diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h +index 8d2530d..c55a9a8 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h -@@ -850,4 +850,59 @@ struct tc_pie_xstats { +@@ -850,4 +850,60 @@ struct tc_pie_xstats { __u32 maxq; /* maximum queue size */ __u32 ecn_mark; /* packets marked with ecn*/ }; @@ -20,6 +22,7 @@ + TCA_CAKE_NAT, + TCA_CAKE_ETHERNET, + TCA_CAKE_WASH, ++ TCA_CAKE_MPU, + __TCA_CAKE_MAX +}; +#define TCA_CAKE_MAX (__TCA_CAKE_MAX - 1) @@ -60,6 +63,8 @@ +}; + #endif +diff --git a/tc/Makefile b/tc/Makefile +index 56acbaa..d421b8e 100644 --- a/tc/Makefile +++ b/tc/Makefile @@ -63,6 +63,7 @@ TCMODULES += q_codel.o @@ -70,9 +75,12 @@ TCMODULES += q_hhf.o TCMODULES += e_bpf.o +diff --git a/tc/q_cake.c b/tc/q_cake.c +new file mode 100644 +index 0000000..acbe56c --- /dev/null +++ b/tc/q_cake.c -@@ -0,0 +1,663 @@ +@@ -0,0 +1,692 @@ +/* + * Common Applications Kept Enhanced -- CAKE + * @@ -126,14 +134,20 @@ + +static void explain(void) +{ -+ fprintf(stderr, "Usage: ... cake [ bandwidth RATE | unlimited* | autorate_ingress ]\n" -+ " [ rtt TIME | datacentre | lan | metro | regional | internet* | oceanic | satellite | interplanetary ]\n" -+ " [ besteffort | precedence | diffserv8 | diffserv4 | diffserv-llt | diffserv3* ]\n" -+ " [ flowblind | srchost | dsthost | hosts | flows | dual-srchost | dual-dsthost | triple-isolate* ] [ nat | nonat* ]\n" -+ " [ ptm | atm | noatm* ] [ overhead N | conservative | raw* ]\n" -+ " [ wash | nowash* ]\n" -+ " [ memlimit LIMIT ]\n" -+ " (* marks defaults)\n"); ++ fprintf(stderr, ++"Usage: ... cake [ bandwidth RATE | unlimited* | autorate_ingress ]\n" ++" [ rtt TIME | datacentre | lan | metro | regional |\n" ++" internet* | oceanic | satellite | interplanetary ]\n" ++" [ besteffort | diffserv8 | diffserv4 | diffserv-llt |\n" ++" diffserv3* ]\n" ++" [ flowblind | srchost | dsthost | hosts | flows |\n" ++" dual-srchost | dual-dsthost | triple-isolate* ]\n" ++" [ nat | nonat* ]\n" ++" [ wash | nowash * ]\n" ++" [ memlimit LIMIT ]\n" ++" [ ptm | atm | noatm* ] [ overhead N | conservative | raw* ]\n" ++" [ mpu N ]\n" ++" (* marks defaults)\n"); +} + +static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv, @@ -149,6 +163,7 @@ + bool overhead_set = false; + bool overhead_override = false; + int wash = -1; ++ int mpu = 0; + int flowmode = -1; + int nat = -1; + int atm = -1; @@ -332,6 +347,7 @@ + * you may need to add vlan tag */ + overhead += 38; + overhead_set = true; ++ mpu = 84; + + /* Additional Ethernet-related overhead used by some ISPs */ + } else if (strcmp(*argv, "ether-vlan") == 0) { @@ -347,6 +363,7 @@ + atm = 0; + overhead += 18; + overhead_set = true; ++ mpu = 64; + + } else if (strcmp(*argv, "overhead") == 0) { + char* p = NULL; @@ -358,6 +375,15 @@ + } + overhead_set = true; + ++ } else if (strcmp(*argv, "mpu") == 0) { ++ char* p = NULL; ++ NEXT_ARG(); ++ mpu = strtol(*argv, &p, 10); ++ if(!p || *p || !*argv || mpu < 0 || mpu > 256) { ++ fprintf(stderr, "Illegal \"mpu\", valid range is 0 to 256\\n"); ++ return -1; ++ } ++ + } else if (strcmp(*argv, "memlimit") == 0) { + NEXT_ARG(); + if(get_size(&memlimit, *argv)) { @@ -392,6 +418,8 @@ + unsigned zero = 0; + addattr_l(n, 1024, TCA_CAKE_ETHERNET, &zero, sizeof(zero)); + } ++ if (mpu > 0) ++ addattr_l(n, 1024, TCA_CAKE_MPU, &mpu, sizeof(mpu)); + if (interval) + addattr_l(n, 1024, TCA_CAKE_RTT, &interval, sizeof(interval)); + if (target) @@ -420,6 +448,7 @@ + unsigned memlimit = 0; + int overhead = 0; + int ethernet = 0; ++ int mpu = 0; + int atm = 0; + int nat = 0; + int autorate = 0; @@ -525,6 +554,10 @@ + RTA_PAYLOAD(tb[TCA_CAKE_OVERHEAD]) >= sizeof(__u32)) { + overhead = rta_getattr_u32(tb[TCA_CAKE_OVERHEAD]); + } ++ if (tb[TCA_CAKE_MPU] && ++ RTA_PAYLOAD(tb[TCA_CAKE_MPU]) >= sizeof(__u32)) { ++ mpu = rta_getattr_u32(tb[TCA_CAKE_MPU]); ++ } + if (tb[TCA_CAKE_ETHERNET] && + RTA_PAYLOAD(tb[TCA_CAKE_ETHERNET]) >= sizeof(__u32)) { + ethernet = rta_getattr_u32(tb[TCA_CAKE_ETHERNET]); @@ -558,6 +591,10 @@ + fprintf(f, "via-ethernet "); + } + ++ if (mpu) { ++ fprintf(f, "mpu %d ", mpu); ++ } ++ + if (memlimit) + fprintf(f, "memlimit %s", sprint_size(memlimit, b1)); + diff --git a/package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch b/package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch new file mode 100644 index 0000000000..52be021e72 --- /dev/null +++ b/package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch @@ -0,0 +1,40 @@ +From c44003f7e7254ac972eaa1b22a686471ea4ce2d7 Mon Sep 17 00:00:00 2001 +From: Liping Zhang +Date: Tue, 20 Sep 2016 02:09:02 -0700 +Subject: [PATCH] ipmonitor: fix ip monitor can't work when NET_NS is not + enabled + +In ip monitor, netns_map_init will check getnsid is supported or not. +But when /proc/self/ns/net does not exist, we just print out error +messages and exit. So user cannot use ip monitor anymore when +CONFIG_NET_NS is disabled: + # ip monitor + open("/proc/self/ns/net"): No such file or directory + +If open "/proc/self/ns/net" failed, set have_rtnl_getnsid to false. + +Fixes: d652ccbf8195 ("netns: allow to dump and monitor nsid") +Signed-off-by: Liping Zhang +Acked-by: Nicolas Dichtel +--- + ip/ipnetns.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ip/ipnetns.c b/ip/ipnetns.c +index af87065..ccc652c 100644 +--- a/ip/ipnetns.c ++++ b/ip/ipnetns.c +@@ -72,8 +72,8 @@ static int ipnetns_have_nsid(void) + if (have_rtnl_getnsid < 0) { + fd = open("/proc/self/ns/net", O_RDONLY); + if (fd < 0) { +- perror("open(\"/proc/self/ns/net\")"); +- exit(1); ++ have_rtnl_getnsid = 0; ++ return 0; + } + + addattr32(&req.n, 1024, NETNSA_FD, fd); +-- +2.6.4 + diff --git a/package/network/utils/iw/patches/001-nl80211_h_sync.patch b/package/network/utils/iw/patches/001-nl80211_h_sync.patch index 5d98281eae..88e47cce82 100644 --- a/package/network/utils/iw/patches/001-nl80211_h_sync.patch +++ b/package/network/utils/iw/patches/001-nl80211_h_sync.patch @@ -1,21 +1,305 @@ --- a/nl80211.h +++ b/nl80211.h -@@ -1937,6 +1937,9 @@ enum nl80211_commands { +@@ -323,7 +323,7 @@ + * @NL80211_CMD_GET_SCAN: get scan results + * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters + * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the +- * probe requests at CCK rate or not. %NL80211_ATTR_MAC can be used to ++ * probe requests at CCK rate or not. %NL80211_ATTR_BSSID can be used to + * specify a BSSID to scan for; if not included, the wildcard BSSID will + * be used. + * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to +@@ -600,6 +600,20 @@ + * + * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. + * ++ * @NL80211_CMD_SET_MULTICAST_TO_UNICAST: Configure if this AP should perform ++ * multicast to unicast conversion. When enabled, all multicast packets ++ * with ethertype ARP, IPv4 or IPv6 (possibly within an 802.1Q header) ++ * will be sent out to each station once with the destination (multicast) ++ * MAC address replaced by the station's MAC address. Note that this may ++ * break certain expectations of the receiver, e.g. the ability to drop ++ * unicast IP packets encapsulated in multicast L2 frames, or the ability ++ * to not send destination unreachable messages in such cases. ++ * This can only be toggled per BSS. Configure this on an interface of ++ * type %NL80211_IFTYPE_AP. It applies to all its VLAN interfaces ++ * (%NL80211_IFTYPE_AP_VLAN), except for those in 4addr (WDS) mode. ++ * If %NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED is not present with this ++ * command, the feature is disabled. ++ * + * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial + * mesh config parameters may be given. + * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the +@@ -874,6 +888,12 @@ + * This will contain a %NL80211_ATTR_NAN_MATCH nested attribute and + * %NL80211_ATTR_COOKIE. + * ++ * @NL80211_CMD_UPDATE_CONNECT_PARAMS: Update one or more connect parameters ++ * for subsequent roaming cases if the driver or firmware uses internal ++ * BSS selection. This command can be issued only while connected and it ++ * does not result in a change for the current association. Currently, ++ * only the %NL80211_ATTR_IE data is used and updated with this command. ++ * + * @NL80211_CMD_MAX: highest used command number + * @__NL80211_CMD_AFTER_LAST: internal use + */ +@@ -1069,6 +1089,10 @@ enum nl80211_commands { + NL80211_CMD_CHANGE_NAN_CONFIG, + NL80211_CMD_NAN_MATCH, + ++ NL80211_CMD_SET_MULTICAST_TO_UNICAST, ++ ++ NL80211_CMD_UPDATE_CONNECT_PARAMS, ++ + /* add new commands above here */ + + /* used to define NL80211_CMD_MAX below */ +@@ -1638,8 +1662,16 @@ enum nl80211_commands { + * the connection request from a station. nl80211_connect_failed_reason + * enum has different reasons of connection failure. + * +- * @NL80211_ATTR_SAE_DATA: SAE elements in Authentication frames. This starts +- * with the Authentication transaction sequence number field. ++ * @NL80211_ATTR_AUTH_DATA: Fields and elements in Authentication frames. ++ * This contains the authentication frame body (non-IE and IE data), ++ * excluding the Authentication algorithm number, i.e., starting at the ++ * Authentication transaction sequence number field. It is used with ++ * authentication algorithms that need special fields to be added into ++ * the frames (SAE and FILS). Currently, only the SAE cases use the ++ * initial two fields (Authentication transaction sequence number and ++ * Status code). However, those fields are included in the attribute data ++ * for all authentication algorithms to keep the attribute definition ++ * consistent. + * + * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from + * association request when used with NL80211_CMD_NEW_STATION) +@@ -1740,7 +1772,9 @@ enum nl80211_commands { + * + * @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode + * Notification Element based on association request when used with +- * %NL80211_CMD_NEW_STATION; u8 attribute. ++ * %NL80211_CMD_NEW_STATION or %NL80211_CMD_SET_STATION (only when ++ * %NL80211_FEATURE_FULL_AP_CLIENT_STATE is supported, or with TDLS); ++ * u8 attribute. + * + * @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if + * %NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet) +@@ -1788,6 +1822,8 @@ enum nl80211_commands { + * and remove functions. NAN notifications will be sent in unicast to that + * socket. Without this attribute, any socket can add functions and the + * notifications will be sent to the %NL80211_MCGRP_NAN multicast group. ++ * If set during %NL80211_CMD_ASSOCIATE or %NL80211_CMD_CONNECT the ++ * station will deauthenticate when the socket is closed. + * + * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is + * the TDLS link initiator. +@@ -1936,6 +1972,38 @@ enum nl80211_commands { + * attribute. * @NL80211_ATTR_NAN_MATCH: used to report a match. This is a nested attribute. * See &enum nl80211_nan_match_attributes. - * ++ * @NL80211_ATTR_FILS_KEK: KEK for FILS (Re)Association Request/Response frame ++ * protection. ++ * @NL80211_ATTR_FILS_NONCES: Nonces (part of AAD) for FILS (Re)Association ++ * Request/Response frame protection. This attribute contains the 16 octet ++ * STA Nonce followed by 16 octets of AP Nonce. ++ * ++ * @NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED: Indicates whether or not multicast ++ * packets should be send out as unicast to all stations (flag attribute). ++ * ++ * @NL80211_ATTR_BSSID: The BSSID of the AP. Note that %NL80211_ATTR_MAC is also ++ * used in various commands/events for specifying the BSSID. ++ * ++ * @NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI: Relative RSSI threshold by which ++ * other BSSs has to be better or slightly worse than the current ++ * connected BSS so that they get reported to user space. ++ * This will give an opportunity to userspace to consider connecting to ++ * other matching BSSs which have better or slightly worse RSSI than ++ * the current connected BSS by using an offloaded operation to avoid ++ * unnecessary wakeups. ++ * ++ * @NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST: When present the RSSI level for BSSs in ++ * the specified band is to be adjusted before doing ++ * %NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI based comparision to figure out ++ * better BSSs. The attribute value is a packed structure ++ * value as specified by &struct nl80211_bss_select_rssi_adjust. ++ * ++ * @NL80211_ATTR_TIMEOUT_REASON: The reason for which an operation timed out. ++ * u32 attribute with an &enum nl80211_timeout_reason value. This is used, ++ * e.g., with %NL80211_CMD_CONNECT event. ++ * + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce + * transmit power to stay within regulatory limits. u32, dBi. -+ * + * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined - * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -2336,6 +2339,8 @@ enum nl80211_attrs { +@@ -2195,7 +2263,7 @@ enum nl80211_attrs { + + NL80211_ATTR_CONN_FAILED_REASON, + +- NL80211_ATTR_SAE_DATA, ++ NL80211_ATTR_AUTH_DATA, + + NL80211_ATTR_VHT_CAPABILITY, + +@@ -2336,6 +2404,20 @@ enum nl80211_attrs { NL80211_ATTR_NAN_FUNC, NL80211_ATTR_NAN_MATCH, ++ NL80211_ATTR_FILS_KEK, ++ NL80211_ATTR_FILS_NONCES, ++ ++ NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED, ++ ++ NL80211_ATTR_BSSID, ++ ++ NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI, ++ NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST, ++ ++ NL80211_ATTR_TIMEOUT_REASON, ++ + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, +@@ -2347,6 +2429,7 @@ enum nl80211_attrs { + #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION + #define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG + #define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER ++#define NL80211_ATTR_SAE_DATA NL80211_ATTR_AUTH_DATA + + /* + * Allow user space programs to use #ifdef on new attributes by defining them +@@ -3027,6 +3110,13 @@ enum nl80211_reg_rule_attr { + * how this API was implemented in the past. Also, due to the same problem, + * the only way to create a matchset with only an RSSI filter (with this + * attribute) is if there's only a single matchset with the RSSI attribute. ++ * @NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI: Flag indicating whether ++ * %NL80211_SCHED_SCAN_MATCH_ATTR_RSSI to be used as absolute RSSI or ++ * relative to current bss's RSSI. ++ * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST: When present the RSSI level for ++ * BSS-es in the specified band is to be adjusted before doing ++ * RSSI-based BSS selection. The attribute value is a packed structure ++ * value as specified by &struct nl80211_bss_select_rssi_adjust. + * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter + * attribute number currently defined + * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use +@@ -3036,6 +3126,8 @@ enum nl80211_sched_scan_match_attr { + + NL80211_SCHED_SCAN_MATCH_ATTR_SSID, + NL80211_SCHED_SCAN_MATCH_ATTR_RSSI, ++ NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI, ++ NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST, + + /* keep last */ + __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST, +@@ -3660,6 +3752,9 @@ enum nl80211_bss_status { + * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) + * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) + * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals ++ * @NL80211_AUTHTYPE_FILS_SK: Fast Initial Link Setup shared key ++ * @NL80211_AUTHTYPE_FILS_SK_PFS: Fast Initial Link Setup shared key with PFS ++ * @NL80211_AUTHTYPE_FILS_PK: Fast Initial Link Setup public key + * @__NL80211_AUTHTYPE_NUM: internal + * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm + * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by +@@ -3672,6 +3767,9 @@ enum nl80211_auth_type { + NL80211_AUTHTYPE_FT, + NL80211_AUTHTYPE_NETWORK_EAP, + NL80211_AUTHTYPE_SAE, ++ NL80211_AUTHTYPE_FILS_SK, ++ NL80211_AUTHTYPE_FILS_SK_PFS, ++ NL80211_AUTHTYPE_FILS_PK, + + /* keep last */ + __NL80211_AUTHTYPE_NUM, +@@ -4280,6 +4378,9 @@ enum nl80211_iface_limit_attrs { + * of supported channel widths for radar detection. + * @NL80211_IFACE_COMB_RADAR_DETECT_REGIONS: u32 attribute containing the bitmap + * of supported regulatory regions for radar detection. ++ * @NL80211_IFACE_COMB_BI_MIN_GCD: u32 attribute specifying the minimum GCD of ++ * different beacon intervals supported by all the interface combinations ++ * in this group (if not present, all beacon intervals be identical). + * @NUM_NL80211_IFACE_COMB: number of attributes + * @MAX_NL80211_IFACE_COMB: highest attribute number + * +@@ -4287,8 +4388,8 @@ enum nl80211_iface_limit_attrs { + * limits = [ #{STA} <= 1, #{AP} <= 1 ], matching BI, channels = 1, max = 2 + * => allows an AP and a STA that must match BIs + * +- * numbers = [ #{AP, P2P-GO} <= 8 ], channels = 1, max = 8 +- * => allows 8 of AP/GO ++ * numbers = [ #{AP, P2P-GO} <= 8 ], BI min gcd, channels = 1, max = 8, ++ * => allows 8 of AP/GO that can have BI gcd >= min gcd + * + * numbers = [ #{STA} <= 2 ], channels = 2, max = 2 + * => allows two STAs on different channels +@@ -4314,6 +4415,7 @@ enum nl80211_if_combination_attrs { + NL80211_IFACE_COMB_NUM_CHANNELS, + NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, + NL80211_IFACE_COMB_RADAR_DETECT_REGIONS, ++ NL80211_IFACE_COMB_BI_MIN_GCD, + + /* keep last */ + NUM_NL80211_IFACE_COMB, +@@ -4634,6 +4736,15 @@ enum nl80211_feature_flags { + * configuration (AP/mesh) with HT rates. + * @NL80211_EXT_FEATURE_BEACON_RATE_VHT: Driver supports beacon rate + * configuration (AP/mesh) with VHT rates. ++ * @NL80211_EXT_FEATURE_FILS_STA: This driver supports Fast Initial Link Setup ++ * with user space SME (NL80211_CMD_AUTHENTICATE) in station mode. ++ * @NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA: This driver supports randomized TA ++ * in @NL80211_CMD_FRAME while not associated. ++ * @NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA_CONNECTED: This driver supports ++ * randomized TA in @NL80211_CMD_FRAME while associated. ++ * @NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI: The driver supports sched_scan ++ * for reporting BSSs with better RSSI than the current connected BSS ++ * (%NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI). + * + * @NUM_NL80211_EXT_FEATURES: number of extended features. + * @MAX_NL80211_EXT_FEATURES: highest extended feature index. +@@ -4648,6 +4759,10 @@ enum nl80211_ext_feature_index { + NL80211_EXT_FEATURE_BEACON_RATE_LEGACY, + NL80211_EXT_FEATURE_BEACON_RATE_HT, + NL80211_EXT_FEATURE_BEACON_RATE_VHT, ++ NL80211_EXT_FEATURE_FILS_STA, ++ NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA, ++ NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA_CONNECTED, ++ NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI, + + /* add new features before the definition below */ + NUM_NL80211_EXT_FEATURES, +@@ -4687,6 +4802,21 @@ enum nl80211_connect_failed_reason { + }; + + /** ++ * enum nl80211_timeout_reason - timeout reasons ++ * ++ * @NL80211_TIMEOUT_UNSPECIFIED: Timeout reason unspecified. ++ * @NL80211_TIMEOUT_SCAN: Scan (AP discovery) timed out. ++ * @NL80211_TIMEOUT_AUTH: Authentication timed out. ++ * @NL80211_TIMEOUT_ASSOC: Association timed out. ++ */ ++enum nl80211_timeout_reason { ++ NL80211_TIMEOUT_UNSPECIFIED, ++ NL80211_TIMEOUT_SCAN, ++ NL80211_TIMEOUT_AUTH, ++ NL80211_TIMEOUT_ASSOC, ++}; ++ ++/** + * enum nl80211_scan_flags - scan request control flags + * + * Scan request control flags are used to control the handling +@@ -4900,8 +5030,9 @@ enum nl80211_sched_scan_plan { + /** + * struct nl80211_bss_select_rssi_adjust - RSSI adjustment parameters. + * +- * @band: band of BSS that must match for RSSI value adjustment. +- * @delta: value used to adjust the RSSI value of matching BSS. ++ * @band: band of BSS that must match for RSSI value adjustment. The value ++ * of this field is according to &enum nl80211_band. ++ * @delta: value used to adjust the RSSI value of matching BSS in dB. + */ + struct nl80211_bss_select_rssi_adjust { + __u8 band; diff --git a/package/network/utils/tcpdump/Makefile b/package/network/utils/tcpdump/Makefile index ddc858defb..c026e636b0 100644 --- a/package/network/utils/tcpdump/Makefile +++ b/package/network/utils/tcpdump/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tcpdump -PKG_VERSION:=4.8.1 +PKG_VERSION:=4.9.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.tcpdump.org/release/ \ http://www.at.tcpdump.org/ -PKG_HASH:=20e4341ec48fcf72abcae312ea913e6ba6b958617b2f3fb496d51f0ae88d831c +PKG_HASH:=eae98121cbb1c9adbedd9a777bf2eae9fa1c1c676424a54740311c8abcee5a5e PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_PARALLEL:=1 diff --git a/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch b/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch index 310d50f3be..0588f39cca 100644 --- a/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch +++ b/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -6260,97 +6260,6 @@ $as_echo "no" >&6; } +@@ -6259,97 +6259,6 @@ $as_echo "no" >&6; } fi fi diff --git a/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch b/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch index 4855ec3872..6d96c2eacd 100644 --- a/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch +++ b/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -5472,37 +5472,6 @@ $as_echo "Using $pfopen" >&6; } +@@ -5471,37 +5471,6 @@ $as_echo "Using $pfopen" >&6; } LIBS="$LIBS $pfopen" fi fi @@ -38,7 +38,7 @@ # # Look for pcap-config. -@@ -5658,51 +5627,6 @@ if test "x$ac_cv_lib_pcap_main" = xyes; +@@ -5657,51 +5626,6 @@ if test "x$ac_cv_lib_pcap_main" = xyes; libpcap="-lpcap" fi diff --git a/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch b/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch index a39916e143..26dbe13e3a 100644 --- a/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch +++ b/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch @@ -8,7 +8,7 @@ + +CSRC=\ + tcpdump.c \ -+ util.c \ ++ netdissect.c \ + setsignal.c \ + addrtoname.c \ + addrtostr.c \ @@ -80,10 +80,10 @@ + +else + - CSRC = setsignal.c tcpdump.c util.c + CSRC = setsignal.c tcpdump.c LIBNETDISSECT_SRC=\ -@@ -236,12 +312,16 @@ LIBNETDISSECT_SRC=\ +@@ -237,12 +313,16 @@ LIBNETDISSECT_SRC=\ strtoaddr.c \ util-print.c @@ -100,7 +100,7 @@ SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC) -@@ -367,10 +447,12 @@ $(PROG): $(OBJ) @V_PCAPDEP@ +@@ -373,10 +453,12 @@ $(PROG): $(OBJ) @V_PCAPDEP@ @rm -f $@ $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) @@ -115,7 +115,7 @@ $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c --- a/addrtoname.c +++ b/addrtoname.c -@@ -564,8 +564,10 @@ linkaddr_string(netdissect_options *ndo, +@@ -566,8 +566,10 @@ linkaddr_string(netdissect_options *ndo, if (type == LINKADDR_ETHER && len == ETHER_ADDR_LEN) return (etheraddr_string(ndo, ep)); @@ -126,7 +126,7 @@ tp = lookup_bytestring(ndo, ep, len); if (tp->e_name) -@@ -1200,6 +1202,7 @@ init_addrtoname(netdissect_options *ndo, +@@ -1202,6 +1204,7 @@ init_addrtoname(netdissect_options *ndo, init_ipxsaparray(ndo); } @@ -134,7 +134,7 @@ const char * dnaddr_string(netdissect_options *ndo, u_short dnaddr) { -@@ -1219,6 +1222,7 @@ dnaddr_string(netdissect_options *ndo, u +@@ -1221,6 +1224,7 @@ dnaddr_string(netdissect_options *ndo, u return(tp->name); } @@ -237,7 +237,7 @@ --- a/print-ether.c +++ b/print-ether.c -@@ -332,6 +332,7 @@ ethertype_print(netdissect_options *ndo, +@@ -342,6 +342,7 @@ ethertype_print(netdissect_options *ndo, arp_print(ndo, p, length, caplen); return (1); @@ -245,27 +245,27 @@ case ETHERTYPE_DN: decnet_print(ndo, p, length, caplen); return (1); -@@ -354,6 +355,7 @@ ethertype_print(netdissect_options *ndo, - case ETHERTYPE_ISO: - isoclns_print(ndo, p + 1, length - 1, length - 1); +@@ -368,6 +369,7 @@ ethertype_print(netdissect_options *ndo, + } + isoclns_print(ndo, p + 1, length - 1, caplen - 1); return(1); +#endif case ETHERTYPE_PPPOED: case ETHERTYPE_PPPOES: -@@ -366,9 +368,11 @@ ethertype_print(netdissect_options *ndo, +@@ -380,9 +382,11 @@ ethertype_print(netdissect_options *ndo, eap_print(ndo, p, length); return (1); +#ifndef TCPDUMP_MINI case ETHERTYPE_RRCP: - rrcp_print(ndo, p - 14 , length + 14); + rrcp_print(ndo, p, length, src, dst); return (1); +#endif case ETHERTYPE_PPP: if (length) { -@@ -377,6 +381,7 @@ ethertype_print(netdissect_options *ndo, +@@ -391,6 +395,7 @@ ethertype_print(netdissect_options *ndo, } return (1); @@ -273,7 +273,7 @@ case ETHERTYPE_MPCP: mpcp_print(ndo, p, length); return (1); -@@ -389,6 +394,7 @@ ethertype_print(netdissect_options *ndo, +@@ -403,6 +408,7 @@ ethertype_print(netdissect_options *ndo, case ETHERTYPE_CFM_OLD: cfm_print(ndo, p, length); return (1); @@ -281,7 +281,7 @@ case ETHERTYPE_LLDP: lldp_print(ndo, p, length); -@@ -398,6 +404,7 @@ ethertype_print(netdissect_options *ndo, +@@ -412,6 +418,7 @@ ethertype_print(netdissect_options *ndo, loopback_print(ndo, p, length); return (1); @@ -289,9 +289,9 @@ case ETHERTYPE_MPLS: case ETHERTYPE_MPLS_MULTI: mpls_print(ndo, p, length); -@@ -427,6 +434,7 @@ ethertype_print(netdissect_options *ndo, +@@ -441,6 +448,7 @@ ethertype_print(netdissect_options *ndo, case ETHERTYPE_MEDSA: - medsa_print(ndo, p, length, caplen); + medsa_print(ndo, p, length, caplen, src, dst); return (1); +#endif @@ -299,7 +299,7 @@ case ETHERTYPE_SCA: --- a/print-gre.c +++ b/print-gre.c -@@ -203,6 +203,7 @@ gre_print_0(netdissect_options *ndo, con +@@ -216,6 +216,7 @@ gre_print_0(netdissect_options *ndo, con case ETHERTYPE_IPV6: ip6_print(ndo, bp, len); break; @@ -307,9 +307,9 @@ case ETHERTYPE_MPLS: mpls_print(ndo, bp, len); break; -@@ -218,6 +219,7 @@ gre_print_0(netdissect_options *ndo, con +@@ -231,6 +232,7 @@ gre_print_0(netdissect_options *ndo, con case ETHERTYPE_TEB: - ether_print(ndo, bp, len, len, NULL, NULL); + ether_print(ndo, bp, len, ndo->ndo_snapend - bp, NULL, NULL); break; +#endif default: @@ -317,7 +317,7 @@ } --- a/print-igmp.c +++ b/print-igmp.c -@@ -304,6 +304,7 @@ igmp_print(netdissect_options *ndo, +@@ -306,6 +306,7 @@ igmp_print(netdissect_options *ndo, ND_TCHECK2(bp[4], 4); ND_PRINT((ndo, "igmp leave %s", ipaddr_string(ndo, &bp[4]))); break; @@ -325,7 +325,7 @@ case 0x13: ND_PRINT((ndo, "igmp dvmrp")); if (len < 8) -@@ -315,6 +316,7 @@ igmp_print(netdissect_options *ndo, +@@ -317,6 +318,7 @@ igmp_print(netdissect_options *ndo, ND_PRINT((ndo, "igmp pimv1")); pimv1_print(ndo, bp, len); break; @@ -335,15 +335,15 @@ break; --- a/print-ip6.c +++ b/print-ip6.c -@@ -297,6 +297,7 @@ ip6_print(netdissect_options *ndo, const - advance = dstopt_print(ndo, cp); +@@ -303,6 +303,7 @@ ip6_print(netdissect_options *ndo, const + return; nh = *cp; break; +#ifndef TCPDUMP_MINI case IPPROTO_FRAGMENT: advance = frag6_print(ndo, cp, (const u_char *)ip6); - if (ndo->ndo_snapend <= cp + advance) -@@ -318,16 +319,19 @@ ip6_print(netdissect_options *ndo, const + if (advance < 0 || ndo->ndo_snapend <= cp + advance) +@@ -324,16 +325,19 @@ ip6_print(netdissect_options *ndo, const advance = mobility_print(ndo, cp, (const u_char *)ip6); nh = *cp; return; @@ -363,7 +363,7 @@ case IPPROTO_TCP: tcp_print(ndo, cp, len, (const u_char *)ip6, fragmented); return; -@@ -337,6 +341,7 @@ ip6_print(netdissect_options *ndo, const +@@ -343,6 +347,7 @@ ip6_print(netdissect_options *ndo, const case IPPROTO_ICMPV6: icmp6_print(ndo, cp, len, (const u_char *)ip6, fragmented); return; @@ -371,7 +371,7 @@ case IPPROTO_AH: advance = ah_print(ndo, cp); nh = *cp; -@@ -360,6 +365,7 @@ ip6_print(netdissect_options *ndo, const +@@ -371,6 +376,7 @@ ip6_print(netdissect_options *ndo, const case IPPROTO_PIM: pim_print(ndo, cp, len, (const u_char *)ip6); return; @@ -379,7 +379,7 @@ case IPPROTO_OSPF: ospf6_print(ndo, cp, len); -@@ -373,9 +379,11 @@ ip6_print(netdissect_options *ndo, const +@@ -384,9 +390,11 @@ ip6_print(netdissect_options *ndo, const ip_print(ndo, cp, len); return; @@ -393,17 +393,17 @@ gre_print(ndo, cp, len); --- a/print-ip.c +++ b/print-ip.c -@@ -327,6 +327,7 @@ ip_print_demux(netdissect_options *ndo, +@@ -329,6 +329,7 @@ ip_print_demux(netdissect_options *ndo, again: switch (ipds->nh) { +#ifndef TCPDUMP_MINI case IPPROTO_AH: - ipds->nh = *ipds->cp; - ipds->advance = ah_print(ndo, ipds->cp); -@@ -361,7 +362,9 @@ again: - ipds->nh = enh & 0xff; - goto again; + if (!ND_TTEST(*ipds->cp)) { + ND_PRINT((ndo, "[|AH]")); +@@ -367,7 +368,9 @@ again: + */ + break; } +#endif @@ -411,7 +411,7 @@ case IPPROTO_SCTP: sctp_print(ndo, ipds->cp, (const u_char *)ipds->ip, ipds->len); break; -@@ -369,6 +372,7 @@ again: +@@ -375,6 +378,7 @@ again: case IPPROTO_DCCP: dccp_print(ndo, ipds->cp, (const u_char *)ipds->ip, ipds->len); break; @@ -419,7 +419,7 @@ case IPPROTO_TCP: /* pass on the MF bit plus the offset to detect fragments */ -@@ -388,6 +392,7 @@ again: +@@ -394,6 +398,7 @@ again: ipds->off & (IP_MF|IP_OFFMASK)); break; @@ -427,7 +427,7 @@ case IPPROTO_PIGP: /* * XXX - the current IANA protocol number assignments -@@ -408,14 +413,17 @@ again: +@@ -414,14 +419,17 @@ again: case IPPROTO_EIGRP: eigrp_print(ndo, ipds->cp, ipds->len); break; @@ -445,7 +445,7 @@ case IPPROTO_OSPF: ospf_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip); -@@ -448,6 +456,7 @@ again: +@@ -454,6 +462,7 @@ again: gre_print(ndo, ipds->cp, ipds->len); break; @@ -453,7 +453,7 @@ case IPPROTO_MOBILE: mobile_print(ndo, ipds->cp, ipds->len); break; -@@ -476,6 +485,7 @@ again: +@@ -482,6 +491,7 @@ again: case IPPROTO_PGM: pgm_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip); break; @@ -463,7 +463,7 @@ if (ndo->ndo_nflag==0 && (proto = getprotobynumber(ipds->nh)) != NULL) --- a/print-llc.c +++ b/print-llc.c -@@ -204,6 +204,7 @@ llc_print(netdissect_options *ndo, const +@@ -206,6 +206,7 @@ llc_print(netdissect_options *ndo, const hdrlen = 4; /* DSAP, SSAP, 2-byte control field */ } @@ -471,7 +471,7 @@ if (ssap_field == LLCSAP_GLOBAL && dsap_field == LLCSAP_GLOBAL) { /* * This is an Ethernet_802.3 IPX frame; it has an -@@ -226,6 +227,7 @@ llc_print(netdissect_options *ndo, const +@@ -228,6 +229,7 @@ llc_print(netdissect_options *ndo, const ipx_print(ndo, p, length); return (0); /* no LLC header */ } @@ -479,7 +479,7 @@ dsap = dsap_field & ~LLC_IG; ssap = ssap_field & ~LLC_GSAP; -@@ -289,6 +291,7 @@ llc_print(netdissect_options *ndo, const +@@ -291,6 +293,7 @@ llc_print(netdissect_options *ndo, const return (hdrlen); } @@ -487,7 +487,7 @@ if (ssap == LLCSAP_IPX && dsap == LLCSAP_IPX && control == LLC_UI) { /* -@@ -302,6 +305,7 @@ llc_print(netdissect_options *ndo, const +@@ -304,6 +307,7 @@ llc_print(netdissect_options *ndo, const ipx_print(ndo, p, length); return (hdrlen); } @@ -495,7 +495,7 @@ #ifdef ENABLE_SMB if (ssap == LLCSAP_NETBEUI && dsap == LLCSAP_NETBEUI -@@ -320,11 +324,13 @@ llc_print(netdissect_options *ndo, const +@@ -322,11 +326,13 @@ llc_print(netdissect_options *ndo, const return (hdrlen); } #endif @@ -509,7 +509,7 @@ if (!ndo->ndo_eflag) { if (ssap == dsap) { -@@ -458,6 +464,7 @@ snap_print(netdissect_options *ndo, cons +@@ -480,6 +486,7 @@ snap_print(netdissect_options *ndo, cons case OUI_CISCO: switch (et) { @@ -517,7 +517,7 @@ case PID_CISCO_CDP: cdp_print(ndo, p, length, caplen); return (1); -@@ -470,6 +477,7 @@ snap_print(netdissect_options *ndo, cons +@@ -492,6 +499,7 @@ snap_print(netdissect_options *ndo, cons case PID_CISCO_VTP: vtp_print(ndo, p, length); return (1); @@ -525,7 +525,7 @@ case PID_CISCO_PVST: case PID_CISCO_VLANBRIDGE: stp_print(ndo, p, length); -@@ -482,6 +490,7 @@ snap_print(netdissect_options *ndo, cons +@@ -504,6 +512,7 @@ snap_print(netdissect_options *ndo, cons case OUI_RFC2684: switch (et) { @@ -533,7 +533,7 @@ case PID_RFC2684_ETH_FCS: case PID_RFC2684_ETH_NOFCS: /* -@@ -543,6 +552,7 @@ snap_print(netdissect_options *ndo, cons +@@ -565,6 +574,7 @@ snap_print(netdissect_options *ndo, cons */ fddi_print(ndo, p, length, caplen); return (1); @@ -543,7 +543,7 @@ stp_print(ndo, p, length); --- a/print-null.c +++ b/print-null.c -@@ -114,6 +114,7 @@ null_if_print(netdissect_options *ndo, c +@@ -116,6 +116,7 @@ null_if_print(netdissect_options *ndo, c ip6_print(ndo, p, length); break; @@ -551,7 +551,7 @@ case BSD_AFNUM_ISO: isoclns_print(ndo, p, length, caplen); break; -@@ -125,6 +126,7 @@ null_if_print(netdissect_options *ndo, c +@@ -127,6 +128,7 @@ null_if_print(netdissect_options *ndo, c case BSD_AFNUM_IPX: ipx_print(ndo, p, length); break; @@ -561,7 +561,7 @@ /* unknown AF_ value */ --- a/print-ppp.c +++ b/print-ppp.c -@@ -1346,6 +1346,7 @@ trunc: +@@ -1358,6 +1358,7 @@ trunc: return 0; } @@ -569,7 +569,7 @@ static void ppp_hdlc(netdissect_options *ndo, const u_char *p, int length) -@@ -1424,6 +1425,7 @@ trunc: +@@ -1436,6 +1437,7 @@ trunc: free(b); ND_PRINT((ndo, "[|ppp]")); } @@ -577,7 +577,7 @@ /* PPP */ -@@ -1431,10 +1433,12 @@ static void +@@ -1443,10 +1445,12 @@ static void handle_ppp(netdissect_options *ndo, u_int proto, const u_char *p, int length) { @@ -590,7 +590,7 @@ switch (proto) { case PPP_LCP: /* fall through */ -@@ -1467,6 +1471,7 @@ handle_ppp(netdissect_options *ndo, +@@ -1479,6 +1483,7 @@ handle_ppp(netdissect_options *ndo, case PPP_IPV6: ip6_print(ndo, p, length); break; @@ -598,7 +598,7 @@ case ETHERTYPE_IPX: /*XXX*/ case PPP_IPX: ipx_print(ndo, p, length); -@@ -1478,6 +1483,7 @@ handle_ppp(netdissect_options *ndo, +@@ -1490,6 +1495,7 @@ handle_ppp(netdissect_options *ndo, case PPP_MPLS_MCAST: mpls_print(ndo, p, length); break; @@ -606,7 +606,7 @@ case PPP_COMP: ND_PRINT((ndo, "compressed PPP data")); break; -@@ -1618,6 +1624,7 @@ ppp_if_print(netdissect_options *ndo, +@@ -1630,6 +1636,7 @@ ppp_if_print(netdissect_options *ndo, return (0); } @@ -614,7 +614,7 @@ /* * PPP I/F printer to use if we know that RFC 1662-style PPP in HDLC-like * framing, or Cisco PPP with HDLC framing as per section 4.3.1 of RFC 1547, -@@ -1840,6 +1847,7 @@ printx: +@@ -1857,6 +1864,7 @@ printx: #endif /* __bsdi__ */ return (hdrlength); } @@ -624,7 +624,7 @@ /* --- a/print-sll.c +++ b/print-sll.c -@@ -236,12 +236,14 @@ recurse: +@@ -238,12 +238,14 @@ recurse: */ switch (ether_type) { @@ -641,7 +641,7 @@ /* --- a/print-tcp.c +++ b/print-tcp.c -@@ -565,12 +565,14 @@ tcp_print(netdissect_options *ndo, +@@ -589,12 +589,14 @@ tcp_print(netdissect_options *ndo, ND_PRINT((ndo, " %u", utoval)); break; @@ -656,7 +656,7 @@ case TCPOPT_FASTOPEN: datalen = len - 2; -@@ -645,6 +647,7 @@ tcp_print(netdissect_options *ndo, +@@ -670,6 +672,7 @@ tcp_print(netdissect_options *ndo, return; } @@ -664,7 +664,7 @@ if (ndo->ndo_packettype) { switch (ndo->ndo_packettype) { case PT_ZMTP1: -@@ -656,28 +659,36 @@ tcp_print(netdissect_options *ndo, +@@ -681,28 +684,36 @@ tcp_print(netdissect_options *ndo, } return; } @@ -702,7 +702,7 @@ else if (IS_SRC_OR_DST_PORT(FTP_PORT)) { ND_PRINT((ndo, ": ")); ftp_print(ndo, bp, length); -@@ -694,6 +705,7 @@ tcp_print(netdissect_options *ndo, +@@ -719,6 +730,7 @@ tcp_print(netdissect_options *ndo, * XXX packet could be unaligned, it can go strange */ ns_print(ndo, bp + 2, length - 2, 0); @@ -710,7 +710,7 @@ } else if (IS_SRC_OR_DST_PORT(MSDP_PORT)) { msdp_print(ndo, bp, length); } else if (IS_SRC_OR_DST_PORT(RPKI_RTR_PORT)) { -@@ -701,6 +713,7 @@ tcp_print(netdissect_options *ndo, +@@ -726,6 +738,7 @@ tcp_print(netdissect_options *ndo, } else if (length > 0 && (IS_SRC_OR_DST_PORT(LDP_PORT))) { ldp_print(ndo, bp, length); @@ -720,7 +720,7 @@ length >= 4 && ND_TTEST2(*bp, 4)) { --- a/print-udp.c +++ b/print-udp.c -@@ -397,10 +397,12 @@ udp_print(netdissect_options *ndo, regis +@@ -430,10 +430,12 @@ udp_print(netdissect_options *ndo, regis vat_print(ndo, (const void *)(up + 1), up); break; @@ -733,7 +733,7 @@ case PT_RPC: rp = (const struct sunrpc_msg *)(up + 1); -@@ -429,10 +431,12 @@ udp_print(netdissect_options *ndo, regis +@@ -462,10 +464,12 @@ udp_print(netdissect_options *ndo, regis snmp_print(ndo, (const u_char *)(up + 1), length); break; @@ -746,7 +746,7 @@ case PT_TFTP: udpipaddr_print(ndo, ip, sport, dport); -@@ -450,6 +454,7 @@ udp_print(netdissect_options *ndo, regis +@@ -483,6 +487,7 @@ udp_print(netdissect_options *ndo, regis radius_print(ndo, cp, length); break; @@ -754,7 +754,7 @@ case PT_VXLAN: udpipaddr_print(ndo, ip, sport, dport); vxlan_print(ndo, (const u_char *)(up + 1), length); -@@ -464,6 +469,7 @@ udp_print(netdissect_options *ndo, regis +@@ -497,6 +502,7 @@ udp_print(netdissect_options *ndo, regis udpipaddr_print(ndo, ip, sport, dport); lmp_print(ndo, cp, length); break; @@ -762,7 +762,7 @@ } return; } -@@ -541,31 +547,40 @@ udp_print(netdissect_options *ndo, regis +@@ -574,31 +580,40 @@ udp_print(netdissect_options *ndo, regis ns_print(ndo, (const u_char *)(up + 1), length, 0); else if (IS_SRC_OR_DST_PORT(MULTICASTDNS_PORT)) ns_print(ndo, (const u_char *)(up + 1), length, 1); @@ -803,7 +803,7 @@ else if (IS_SRC_OR_DST_PORT(L2TP_PORT)) l2tp_print(ndo, (const u_char *)(up + 1), length); #ifdef ENABLE_SMB -@@ -576,6 +591,7 @@ udp_print(netdissect_options *ndo, regis +@@ -609,6 +624,7 @@ udp_print(netdissect_options *ndo, regis #endif else if (dport == VAT_PORT) vat_print(ndo, (const void *)(up + 1), up); @@ -811,7 +811,7 @@ else if (IS_SRC_OR_DST_PORT(ZEPHYR_SRV_PORT) || IS_SRC_OR_DST_PORT(ZEPHYR_CLT_PORT)) zephyr_print(ndo, (const void *)(up + 1), length); /* -@@ -588,8 +604,11 @@ udp_print(netdissect_options *ndo, regis +@@ -621,8 +637,11 @@ udp_print(netdissect_options *ndo, regis (const u_char *) ip); else if (IS_SRC_OR_DST_PORT(RIPNG_PORT)) ripng_print(ndo, (const u_char *)(up + 1), length); @@ -823,7 +823,7 @@ else if (IS_SRC_OR_DST_PORT(AHCP_PORT)) ahcp_print(ndo, (const u_char *)(up + 1), length); else if (IS_SRC_OR_DST_PORT(BABEL_PORT) || IS_SRC_OR_DST_PORT(BABEL_PORT_OLD)) -@@ -603,6 +622,7 @@ udp_print(netdissect_options *ndo, regis +@@ -636,6 +655,7 @@ udp_print(netdissect_options *ndo, regis wb_print(ndo, (const void *)(up + 1), length); else if (IS_SRC_OR_DST_PORT(CISCO_AUTORP_PORT)) cisco_autorp_print(ndo, (const void *)(up + 1), length); @@ -831,7 +831,7 @@ else if (IS_SRC_OR_DST_PORT(RADIUS_PORT) || IS_SRC_OR_DST_PORT(RADIUS_NEW_PORT) || IS_SRC_OR_DST_PORT(RADIUS_ACCOUNTING_PORT) || -@@ -610,15 +630,18 @@ udp_print(netdissect_options *ndo, regis +@@ -643,15 +663,18 @@ udp_print(netdissect_options *ndo, regis IS_SRC_OR_DST_PORT(RADIUS_CISCO_COA_PORT) || IS_SRC_OR_DST_PORT(RADIUS_COA_PORT) ) radius_print(ndo, (const u_char *)(up+1), length); @@ -850,7 +850,7 @@ else if (IS_SRC_OR_DST_PORT(MPLS_LSP_PING_PORT)) lspping_print(ndo, (const u_char *)(up + 1), length); else if (dport == BFD_CONTROL_PORT || -@@ -636,10 +659,12 @@ udp_print(netdissect_options *ndo, regis +@@ -669,10 +692,12 @@ udp_print(netdissect_options *ndo, regis lwapp_control_print(ndo, (const u_char *)(up + 1), length, 0); else if (IS_SRC_OR_DST_PORT(LWAPP_DATA_PORT)) lwapp_data_print(ndo, (const u_char *)(up + 1), length); @@ -863,7 +863,7 @@ else if (IS_SRC_OR_DST_PORT(OTV_PORT)) otv_print(ndo, (const u_char *)(up + 1), length); else if (IS_SRC_OR_DST_PORT(VXLAN_PORT)) -@@ -656,7 +681,9 @@ udp_print(netdissect_options *ndo, regis +@@ -689,7 +714,9 @@ udp_print(netdissect_options *ndo, regis if (ndo->ndo_vflag) ND_PRINT((ndo, "kip ")); llap_print(ndo, cp, length); diff --git a/package/network/utils/umbim/Makefile b/package/network/utils/umbim/Makefile index 42d4b85eaa..616a02367c 100644 --- a/package/network/utils/umbim/Makefile +++ b/package/network/utils/umbim/Makefile @@ -15,6 +15,8 @@ PKG_LICENSE_FILES:= PKG_BUILD_PARALLEL:=1 +PKG_FLAGS:=nonshared + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/package/network/utils/uqmi/Makefile b/package/network/utils/uqmi/Makefile index 41db1e7671..2102490f68 100644 --- a/package/network/utils/uqmi/Makefile +++ b/package/network/utils/uqmi/Makefile @@ -15,6 +15,8 @@ PKG_LICENSE_FILES:= PKG_BUILD_PARALLEL:=1 +PKG_FLAGS:=nonshared + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/package/network/utils/wireless-tools/Makefile b/package/network/utils/wireless-tools/Makefile index eac0573b43..dd3430a426 100644 --- a/package/network/utils/wireless-tools/Makefile +++ b/package/network/utils/wireless-tools/Makefile @@ -13,7 +13,7 @@ PKG_MINOR:= PKG_RELEASE:=5 PKG_SOURCE:=wireless_tools.$(PKG_VERSION)$(PKG_MINOR).tar.gz -PKG_SOURCE_URL:=http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux +PKG_SOURCE_URL:=https://hewlettpackard.github.io/wireless-tools PKG_HASH:=6fb80935fe208538131ce2c4178221bab1078a1656306bce8909c19887e2e5a1 TAR_OPTIONS += || true diff --git a/package/system/lede-keyring/Makefile b/package/system/lede-keyring/Makefile index a84f84722f..fb5752a54e 100644 --- a/package/system/lede-keyring/Makefile +++ b/package/system/lede-keyring/Makefile @@ -7,9 +7,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/keyring.git -PKG_SOURCE_DATE:=2016-04-30 -PKG_SOURCE_VERSION:=5c7857eed3fa06a9005f96b9b029388c7f316e83 -PKG_MIRROR_HASH:=6119196dad6c92df22617c5f4a923728a657b591c6a6901dda21acadc63da51d +PKG_SOURCE_DATE:=2017-01-20 +PKG_SOURCE_VERSION:=a50b7529880988ca96e72dede0279ff139a8ab1a +PKG_MIRROR_HASH:=811ba79ba71925e949d2c690db7d7b031ac1dd965aa831ca9b6d9d70f5657254 PKG_MAINTAINER:=John Crispin PKG_LICENSE:=GPL-2.0 diff --git a/package/system/mountd/Makefile b/package/system/mountd/Makefile index 6922f2f5a0..70275617fa 100644 --- a/package/system/mountd/Makefile +++ b/package/system/mountd/Makefile @@ -23,7 +23,7 @@ define Package/mountd SECTION:=utils CATEGORY:=Utilities TITLE:=OpenWrt automount daemon - DEPENDS:=@USB_SUPPORT +uci +kmod-usb-storage +kmod-fs-autofs4 + DEPENDS:=+uci +kmod-fs-autofs4 URL:=http://www.openwrt.org endef diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index 898d769b2e..39e6b4d058 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -11,14 +11,13 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=opkg -PKG_RELEASE:=16 +PKG_RELEASE:=17 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=http://git.yoctoproject.org/git/opkg PKG_SOURCE_DATE:=2011-04-08 PKG_SOURCE_VERSION:=9c97d5ecd795709c8584e972bfdf3aee3a5b846d PKG_MIRROR_HASH:=55e05270f3eb2f3aff5d3791463ce3d13b8197ca7b301cd58e731a249552c48f -PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) PKG_FIXUP:=autoreconf PKG_REMOVE_FILES = autogen.sh aclocal.m4 diff --git a/package/system/opkg/patches/290-clarify-download-errors.patch b/package/system/opkg/patches/290-clarify-download-errors.patch new file mode 100644 index 0000000000..5512f675d8 --- /dev/null +++ b/package/system/opkg/patches/290-clarify-download-errors.patch @@ -0,0 +1,61 @@ +--- a/libopkg/opkg_cmd.c ++++ b/libopkg/opkg_cmd.c +@@ -85,6 +85,7 @@ opkg_update_cmd(int argc, char **argv) + char *tmp; + int err; + int failures; ++ int pkglist_dl_error; + char *lists_dir; + pkg_src_list_elt_t *iter; + pkg_src_t *src; +@@ -130,15 +131,19 @@ opkg_update_cmd(int argc, char **argv) + sprintf_alloc(&url, "%s/%s", src->value, src->gzip ? "Packages.gz" : "Packages"); + + sprintf_alloc(&list_file_name, "%s/%s", lists_dir, src->name); ++ pkglist_dl_error = 0; + if (opkg_download(url, list_file_name, NULL, NULL, 0)) { + failures++; ++ pkglist_dl_error = 1; ++ opkg_msg(NOTICE, "*** Failed to download the package list from %s\n\n", ++ url); + } else { +- opkg_msg(NOTICE, "Updated list of available packages in %s.\n", ++ opkg_msg(NOTICE, "Updated list of available packages in %s\n", + list_file_name); + } + free(url); + #if defined(HAVE_GPGME) || defined(HAVE_OPENSSL) || defined(HAVE_USIGN) +- if (conf->check_signature) { ++ if (pkglist_dl_error == 0 && conf->check_signature) { + /* download detached signitures to verify the package lists */ + /* get the url for the sig file */ + if (src->extra_data) /* debian style? */ +@@ -156,7 +161,7 @@ opkg_update_cmd(int argc, char **argv) + err = opkg_download(url, tmp_file_name, NULL, NULL, 0); + if (err) { + failures++; +- opkg_msg(NOTICE, "Signature check failed.\n"); ++ opkg_msg(NOTICE, "Signature file download failed.\n"); + } else { + err = opkg_verify_file (list_file_name, tmp_file_name); + if (err == 0) +--- a/libopkg/opkg_download.c ++++ b/libopkg/opkg_download.c +@@ -91,7 +91,7 @@ opkg_download(const char *src, const cha + char *src_base = basename(src_basec); + char *tmp_file_location; + +- opkg_msg(NOTICE,"Downloading %s.\n", src); ++ opkg_msg(NOTICE,"Downloading %s\n", src); + + if (str_starts_with(src, "file:")) { + const char *file_src = src + 5; +@@ -175,6 +175,8 @@ opkg_download(const char *src, const cha + + if (res) { + opkg_msg(ERROR, "Failed to download %s, wget returned %d.\n", src, res); ++ if (res == 4) ++ opkg_msg(ERROR, "Check your network settings and connectivity.\n\n"); + free(tmp_file_location); + return -1; + } diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index b0e555e421..fd1bca3f4b 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/procd.git -PKG_SOURCE_DATE:=2017-01-10 -PKG_SOURCE_VERSION:=f7069032290a9720142b2ee2c6315d7e1f1a1bd3 -PKG_MIRROR_HASH:=3917269c1ed1f9b6d4a8f5559b2cdec6f91da3ad00ffe5375b5680f9e230b21d +PKG_SOURCE_DATE:=2017-02-15 +PKG_SOURCE_VERSION:=5f9124103410c178d816bb5229fba7dd2286a49b +PKG_MIRROR_HASH:=ec887b349fc60ad3882fc9eaefb5cd299d64e7d43c062df9f7b7500591ba3e85 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index 8f18cda70e..6347de57ab 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -213,9 +213,12 @@ _procd_set_param() { json_add_string "" "$@" json_close_array ;; - nice|reload_signal) + nice) json_add_int "$type" "$1" ;; + reload_signal) + json_add_int "$type" $(kill -l "$1") + ;; pidfile|user|seccomp|capabilities) json_add_string "$type" "$1" ;; @@ -248,9 +251,8 @@ _procd_add_interface_trigger() { json_close_array json_close_array - json_close_array - _procd_add_timeout + json_close_array } _procd_add_reload_interface_trigger() { @@ -280,10 +282,8 @@ _procd_add_config_trigger() { json_close_array json_close_array - - json_close_array - _procd_add_timeout + json_close_array } _procd_add_raw_trigger() { diff --git a/package/system/ubox/Makefile b/package/system/ubox/Makefile index 8900c67803..e833cac487 100644 --- a/package/system/ubox/Makefile +++ b/package/system/ubox/Makefile @@ -5,7 +5,7 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/ubox.git -PKG_SOURCE_DATE:=2016-09-26 +PKG_SOURCE_DATE:=2017-01-15 PKG_SOURCE_VERSION:=5649c028c426060616e2bd4e7ea83271cd333d21 PKG_MIRROR_HASH:=ae77504a4397f92173a7646fa3555e5b51abd7ff1dd1c419770223359e41937a CMAKE_INSTALL:=1 @@ -27,8 +27,15 @@ define Package/ubox TITLE:=OpenWrt system helper toolbox endef +define Package/logd +SECTION:=base + CATEGORY:=Base system + DEPENDS:=+libubox +libubus +libblobmsg-json +USE_GLIBC:librt + TITLE:=OpenWrt system log implementation +endef + define Package/ubox/install - $(INSTALL_DIR) $(1)/sbin $(1)/usr/sbin $(1)/lib $(1)/usr/bin $(1)/etc/init.d + $(INSTALL_DIR) $(1)/sbin $(1)/usr/sbin $(1)/lib $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{kmodloader,validate_data} $(1)/sbin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getrandom $(1)/usr/bin/ @@ -39,9 +46,14 @@ define Package/ubox/install $(LN) ../../sbin/kmodloader $(1)/usr/sbin/lsmod $(LN) ../../sbin/kmodloader $(1)/usr/sbin/modinfo $(LN) ../../sbin/kmodloader $(1)/usr/sbin/modprobe +endef + +define Package/logd/install + $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{logd,logread} $(1)/sbin/ $(INSTALL_BIN) ./files/log.init $(1)/etc/init.d/log endef $(eval $(call BuildPackage,ubox)) +$(eval $(call BuildPackage,logd)) diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index fadb436863..4f3d4e8309 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/ubus.git -PKG_SOURCE_DATE:=2016-10-12 -PKG_SOURCE_VERSION:=312448a5b147c221836827a7a641e76a4514db44 -PKG_MIRROR_HASH:=adeeae238deaac2b6af77c2e4473febdcbc0f1c256734b2ff019c76b2f3f2aa6 +PKG_SOURCE_DATE:=2017-02-18 +PKG_SOURCE_VERSION:=34c6e818e431cc53478a0f7c7c1eca07d194d692 +PKG_MIRROR_HASH:=fc4f1121faa4f5b8fa52ee25460b98b2e60e7d245aefa70e7f76c56ce5628fd5 CMAKE_INSTALL:=1 PKG_LICENSE:=LGPL-2.1 diff --git a/package/utils/ct-bugcheck/src/bugcheck.sh b/package/utils/ct-bugcheck/src/bugcheck.sh index 85f70c5e79..3f73b5e455 100755 --- a/package/utils/ct-bugcheck/src/bugcheck.sh +++ b/package/utils/ct-bugcheck/src/bugcheck.sh @@ -11,7 +11,7 @@ FOUND_BUG=0 bugcheck_generic() { - echo "LEDE crashlog report" > $CRASHDIR/info.txt + echo "libreCMC crashlog report" > $CRASHDIR/info.txt date >> $CRASHDIR/info.txt echo >> $CRASHDIR/info.txt echo "uname" >> $CRASHDIR/info.txt diff --git a/package/utils/osafeloader/Makefile b/package/utils/osafeloader/Makefile index 883d7ae603..d0a590e13b 100644 --- a/package/utils/osafeloader/Makefile +++ b/package/utils/osafeloader/Makefile @@ -10,6 +10,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=osafeloader PKG_RELEASE:=1 +PKG_FLAGS:=nonshared + include $(INCLUDE_DIR)/package.mk define Package/osafeloader diff --git a/package/utils/px5g-standalone/Makefile b/package/utils/px5g-standalone/Makefile deleted file mode 100644 index b8f68d7bf3..0000000000 --- a/package/utils/px5g-standalone/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -# -# Copyright (C) 2010-2014 Jo-Philipp Wich -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=px5g-standalone -PKG_RELEASE:=2 - -PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) - -include $(INCLUDE_DIR)/package.mk - -define Package/px5g-standalone - SECTION:=utils - CATEGORY:=Utilities - SUBMENU:=Encryption - TITLE:=X.509 certificate generator (standalone version) - MAINTAINER:=Jo-Philipp Wich - PROVIDES:=px5g -endef - -define Package/px5g-standalone/description - Px5g is a tiny standalone X.509 certificate generator. - It suitable to create key files and certificates in DER - and PEM format for use with stunnel, uhttpd and others. -endef - -define Package/px5g-standalone/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/px5g $(1)/usr/sbin/px5g -endef - -$(eval $(call BuildPackage,px5g-standalone)) diff --git a/package/utils/px5g-standalone/src/Makefile b/package/utils/px5g-standalone/src/Makefile deleted file mode 100644 index 2bd95739cb..0000000000 --- a/package/utils/px5g-standalone/src/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -CFLAGS?=-O2 -CFLAGS+= -SFLAGS:=--std=gnu99 -WFLAGS:=-Wall -Werror -pedantic -LDFLAGS?= -BINARY:=px5g - -all: $(BINARY) - -$(BINARY): *.c library/*.c - $(CC) -I. $(CFLAGS) $(SFLAGS) $(WFLAGS) $(LDFLAGS) -o $@ $+ - -clean: - rm -f $(BINARY) diff --git a/package/utils/px5g-standalone/src/library/base64.c b/package/utils/px5g-standalone/src/library/base64.c deleted file mode 100644 index b7cc5b84ea..0000000000 --- a/package/utils/px5g-standalone/src/library/base64.c +++ /dev/null @@ -1,264 +0,0 @@ -/* - * RFC 1521 base64 encoding/decoding - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the names of PolarSSL or XySSL nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "polarssl/config.h" - -#if defined(POLARSSL_BASE64_C) - -#include "polarssl/base64.h" - -static const unsigned char base64_enc_map[64] = -{ - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', - 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', - 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', - 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', - 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', - 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', '+', '/' -}; - -static const unsigned char base64_dec_map[128] = -{ - 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 62, 127, 127, 127, 63, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 127, 127, - 127, 64, 127, 127, 127, 0, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 127, 127, 127, 127, 127, 127, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 127, 127, 127, 127, 127 -}; - -/* - * Encode a buffer into base64 format - */ -int base64_encode( unsigned char *dst, int *dlen, - unsigned char *src, int slen ) -{ - int i, n; - int C1, C2, C3; - unsigned char *p; - - if( slen == 0 ) - return( 0 ); - - n = (slen << 3) / 6; - - switch( (slen << 3) - (n * 6) ) - { - case 2: n += 3; break; - case 4: n += 2; break; - default: break; - } - - if( *dlen < n + 1 ) - { - *dlen = n + 1; - return( POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL ); - } - - n = (slen / 3) * 3; - - for( i = 0, p = dst; i < n; i += 3 ) - { - C1 = *src++; - C2 = *src++; - C3 = *src++; - - *p++ = base64_enc_map[(C1 >> 2) & 0x3F]; - *p++ = base64_enc_map[(((C1 & 3) << 4) + (C2 >> 4)) & 0x3F]; - *p++ = base64_enc_map[(((C2 & 15) << 2) + (C3 >> 6)) & 0x3F]; - *p++ = base64_enc_map[C3 & 0x3F]; - } - - if( i < slen ) - { - C1 = *src++; - C2 = ((i + 1) < slen) ? *src++ : 0; - - *p++ = base64_enc_map[(C1 >> 2) & 0x3F]; - *p++ = base64_enc_map[(((C1 & 3) << 4) + (C2 >> 4)) & 0x3F]; - - if( (i + 1) < slen ) - *p++ = base64_enc_map[((C2 & 15) << 2) & 0x3F]; - else *p++ = '='; - - *p++ = '='; - } - - *dlen = p - dst; - *p = 0; - - return( 0 ); -} - -/* - * Decode a base64-formatted buffer - */ -int base64_decode( unsigned char *dst, int *dlen, - unsigned char *src, int slen ) -{ - int i, j, n; - unsigned long x; - unsigned char *p; - - for( i = j = n = 0; i < slen; i++ ) - { - if( ( slen - i ) >= 2 && - src[i] == '\r' && src[i + 1] == '\n' ) - continue; - - if( src[i] == '\n' ) - continue; - - if( src[i] == '=' && ++j > 2 ) - return( POLARSSL_ERR_BASE64_INVALID_CHARACTER ); - - if( src[i] > 127 || base64_dec_map[src[i]] == 127 ) - return( POLARSSL_ERR_BASE64_INVALID_CHARACTER ); - - if( base64_dec_map[src[i]] < 64 && j != 0 ) - return( POLARSSL_ERR_BASE64_INVALID_CHARACTER ); - - n++; - } - - if( n == 0 ) - return( 0 ); - - n = ((n * 6) + 7) >> 3; - - if( *dlen < n ) - { - *dlen = n; - return( POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL ); - } - - for( j = 3, n = x = 0, p = dst; i > 0; i--, src++ ) - { - if( *src == '\r' || *src == '\n' ) - continue; - - j -= ( base64_dec_map[*src] == 64 ); - x = (x << 6) | ( base64_dec_map[*src] & 0x3F ); - - if( ++n == 4 ) - { - n = 0; - if( j > 0 ) *p++ = (unsigned char)( x >> 16 ); - if( j > 1 ) *p++ = (unsigned char)( x >> 8 ); - if( j > 2 ) *p++ = (unsigned char)( x ); - } - } - - *dlen = p - dst; - - return( 0 ); -} - -#if defined(POLARSSL_SELF_TEST) - -#include -#include - -static const unsigned char base64_test_dec[64] = -{ - 0x24, 0x48, 0x6E, 0x56, 0x87, 0x62, 0x5A, 0xBD, - 0xBF, 0x17, 0xD9, 0xA2, 0xC4, 0x17, 0x1A, 0x01, - 0x94, 0xED, 0x8F, 0x1E, 0x11, 0xB3, 0xD7, 0x09, - 0x0C, 0xB6, 0xE9, 0x10, 0x6F, 0x22, 0xEE, 0x13, - 0xCA, 0xB3, 0x07, 0x05, 0x76, 0xC9, 0xFA, 0x31, - 0x6C, 0x08, 0x34, 0xFF, 0x8D, 0xC2, 0x6C, 0x38, - 0x00, 0x43, 0xE9, 0x54, 0x97, 0xAF, 0x50, 0x4B, - 0xD1, 0x41, 0xBA, 0x95, 0x31, 0x5A, 0x0B, 0x97 -}; - -static const unsigned char base64_test_enc[] = - "JEhuVodiWr2/F9mixBcaAZTtjx4Rs9cJDLbpEG8i7hPK" - "swcFdsn6MWwINP+Nwmw4AEPpVJevUEvRQbqVMVoLlw=="; - -/* - * Checkup routine - */ -int base64_self_test( int verbose ) -{ - int len; - unsigned char *src, buffer[128]; - - if( verbose != 0 ) - printf( " Base64 encoding test: " ); - - len = sizeof( buffer ); - src = (unsigned char *) base64_test_dec; - - if( base64_encode( buffer, &len, src, 64 ) != 0 || - memcmp( base64_test_enc, buffer, 88 ) != 0 ) - { - if( verbose != 0 ) - printf( "failed\n" ); - - return( 1 ); - } - - if( verbose != 0 ) - printf( "passed\n Base64 decoding test: " ); - - len = sizeof( buffer ); - src = (unsigned char *) base64_test_enc; - - if( base64_decode( buffer, &len, src, 88 ) != 0 || - memcmp( base64_test_dec, buffer, 64 ) != 0 ) - { - if( verbose != 0 ) - printf( "failed\n" ); - - return( 1 ); - } - - if( verbose != 0 ) - printf( "passed\n\n" ); - - return( 0 ); -} - -#endif - -#endif diff --git a/package/utils/px5g-standalone/src/library/bignum.c b/package/utils/px5g-standalone/src/library/bignum.c deleted file mode 100644 index 8b7c12ff00..0000000000 --- a/package/utils/px5g-standalone/src/library/bignum.c +++ /dev/null @@ -1,2010 +0,0 @@ -/* - * Multi-precision integer library - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the names of PolarSSL or XySSL nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/* - * This MPI implementation is based on: - * - * http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf - * http://www.stillhq.com/extracted/gnupg-api/mpi/ - * http://math.libtomcrypt.com/files/tommath.pdf - */ - -#include "polarssl/config.h" - -#if defined(POLARSSL_BIGNUM_C) - -#include "polarssl/bignum.h" -#include "polarssl/bn_mul.h" - -#include -#include -#include - -#define ciL ((int) sizeof(t_int)) /* chars in limb */ -#define biL (ciL << 3) /* bits in limb */ -#define biH (ciL << 2) /* half limb size */ - -/* - * Convert between bits/chars and number of limbs - */ -#define BITS_TO_LIMBS(i) (((i) + biL - 1) / biL) -#define CHARS_TO_LIMBS(i) (((i) + ciL - 1) / ciL) - -/* - * Initialize one or more mpi - */ -void mpi_init( mpi *X, ... ) -{ - va_list args; - - va_start( args, X ); - - while( X != NULL ) - { - X->s = 1; - X->n = 0; - X->p = NULL; - - X = va_arg( args, mpi* ); - } - - va_end( args ); -} - -/* - * Unallocate one or more mpi - */ -void mpi_free( mpi *X, ... ) -{ - va_list args; - - va_start( args, X ); - - while( X != NULL ) - { - if( X->p != NULL ) - { - memset( X->p, 0, X->n * ciL ); - free( X->p ); - } - - X->s = 1; - X->n = 0; - X->p = NULL; - - X = va_arg( args, mpi* ); - } - - va_end( args ); -} - -/* - * Enlarge to the specified number of limbs - */ -int mpi_grow( mpi *X, int nblimbs ) -{ - t_int *p; - - if( X->n < nblimbs ) - { - if( ( p = (t_int *) malloc( nblimbs * ciL ) ) == NULL ) - return( 1 ); - - memset( p, 0, nblimbs * ciL ); - - if( X->p != NULL ) - { - memcpy( p, X->p, X->n * ciL ); - memset( X->p, 0, X->n * ciL ); - free( X->p ); - } - - X->n = nblimbs; - X->p = p; - } - - return( 0 ); -} - -/* - * Copy the contents of Y into X - */ -int mpi_copy( mpi *X, mpi *Y ) -{ - int ret, i; - - if( X == Y ) - return( 0 ); - - for( i = Y->n - 1; i > 0; i-- ) - if( Y->p[i] != 0 ) - break; - i++; - - X->s = Y->s; - - MPI_CHK( mpi_grow( X, i ) ); - - memset( X->p, 0, X->n * ciL ); - memcpy( X->p, Y->p, i * ciL ); - -cleanup: - - return( ret ); -} - -/* - * Swap the contents of X and Y - */ -void mpi_swap( mpi *X, mpi *Y ) -{ - mpi T; - - memcpy( &T, X, sizeof( mpi ) ); - memcpy( X, Y, sizeof( mpi ) ); - memcpy( Y, &T, sizeof( mpi ) ); -} - -/* - * Set value from integer - */ -int mpi_lset( mpi *X, int z ) -{ - int ret; - - MPI_CHK( mpi_grow( X, 1 ) ); - memset( X->p, 0, X->n * ciL ); - - X->p[0] = ( z < 0 ) ? -z : z; - X->s = ( z < 0 ) ? -1 : 1; - -cleanup: - - return( ret ); -} - -/* - * Return the number of least significant bits - */ -int mpi_lsb( mpi *X ) -{ - int i, j, count = 0; - - for( i = 0; i < X->n; i++ ) - for( j = 0; j < (int) biL; j++, count++ ) - if( ( ( X->p[i] >> j ) & 1 ) != 0 ) - return( count ); - - return( 0 ); -} - -/* - * Return the number of most significant bits - */ -int mpi_msb( mpi *X ) -{ - int i, j; - - for( i = X->n - 1; i > 0; i-- ) - if( X->p[i] != 0 ) - break; - - for( j = biL - 1; j >= 0; j-- ) - if( ( ( X->p[i] >> j ) & 1 ) != 0 ) - break; - - return( ( i * biL ) + j + 1 ); -} - -/* - * Return the total size in bytes - */ -int mpi_size( mpi *X ) -{ - return( ( mpi_msb( X ) + 7 ) >> 3 ); -} - -/* - * Convert an ASCII character to digit value - */ -static int mpi_get_digit( t_int *d, int radix, char c ) -{ - *d = 255; - - if( c >= 0x30 && c <= 0x39 ) *d = c - 0x30; - if( c >= 0x41 && c <= 0x46 ) *d = c - 0x37; - if( c >= 0x61 && c <= 0x66 ) *d = c - 0x57; - - if( *d >= (t_int) radix ) - return( POLARSSL_ERR_MPI_INVALID_CHARACTER ); - - return( 0 ); -} - -/* - * Import from an ASCII string - */ -int mpi_read_string( mpi *X, int radix, char *s ) -{ - int ret, i, j, n; - t_int d; - mpi T; - - if( radix < 2 || radix > 16 ) - return( POLARSSL_ERR_MPI_BAD_INPUT_DATA ); - - mpi_init( &T, NULL ); - - if( radix == 16 ) - { - n = BITS_TO_LIMBS( strlen( s ) << 2 ); - - MPI_CHK( mpi_grow( X, n ) ); - MPI_CHK( mpi_lset( X, 0 ) ); - - for( i = strlen( s ) - 1, j = 0; i >= 0; i--, j++ ) - { - if( i == 0 && s[i] == '-' ) - { - X->s = -1; - break; - } - - MPI_CHK( mpi_get_digit( &d, radix, s[i] ) ); - X->p[j / (2 * ciL)] |= d << ( (j % (2 * ciL)) << 2 ); - } - } - else - { - MPI_CHK( mpi_lset( X, 0 ) ); - - for( i = 0; i < (int) strlen( s ); i++ ) - { - if( i == 0 && s[i] == '-' ) - { - X->s = -1; - continue; - } - - MPI_CHK( mpi_get_digit( &d, radix, s[i] ) ); - MPI_CHK( mpi_mul_int( &T, X, radix ) ); - MPI_CHK( mpi_add_int( X, &T, d ) ); - } - } - -cleanup: - - mpi_free( &T, NULL ); - - return( ret ); -} - -/* - * Helper to write the digits high-order first - */ -static int mpi_write_hlp( mpi *X, int radix, char **p ) -{ - int ret; - t_int r; - - if( radix < 2 || radix > 16 ) - return( POLARSSL_ERR_MPI_BAD_INPUT_DATA ); - - MPI_CHK( mpi_mod_int( &r, X, radix ) ); - MPI_CHK( mpi_div_int( X, NULL, X, radix ) ); - - if( mpi_cmp_int( X, 0 ) != 0 ) - MPI_CHK( mpi_write_hlp( X, radix, p ) ); - - if( r < 10 ) - *(*p)++ = (char)( r + 0x30 ); - else - *(*p)++ = (char)( r + 0x37 ); - -cleanup: - - return( ret ); -} - -/* - * Export into an ASCII string - */ -int mpi_write_string( mpi *X, int radix, char *s, int *slen ) -{ - int ret = 0, n; - char *p; - mpi T; - - if( radix < 2 || radix > 16 ) - return( POLARSSL_ERR_MPI_BAD_INPUT_DATA ); - - n = mpi_msb( X ); - if( radix >= 4 ) n >>= 1; - if( radix >= 16 ) n >>= 1; - n += 3; - - if( *slen < n ) - { - *slen = n; - return( POLARSSL_ERR_MPI_BUFFER_TOO_SMALL ); - } - - p = s; - mpi_init( &T, NULL ); - - if( X->s == -1 ) - *p++ = '-'; - - if( radix == 16 ) - { - int c, i, j, k; - - for( i = X->n - 1, k = 0; i >= 0; i-- ) - { - for( j = ciL - 1; j >= 0; j-- ) - { - c = ( X->p[i] >> (j << 3) ) & 0xFF; - - if( c == 0 && k == 0 && (i + j) != 0 ) - continue; - - p += sprintf( p, "%02X", c ); - k = 1; - } - } - } - else - { - MPI_CHK( mpi_copy( &T, X ) ); - MPI_CHK( mpi_write_hlp( &T, radix, &p ) ); - } - - *p++ = '\0'; - *slen = p - s; - -cleanup: - - mpi_free( &T, NULL ); - - return( ret ); -} - -/* - * Read X from an opened file - */ -int mpi_read_file( mpi *X, int radix, FILE *fin ) -{ - t_int d; - int slen; - char *p; - char s[1024]; - - memset( s, 0, sizeof( s ) ); - if( fgets( s, sizeof( s ) - 1, fin ) == NULL ) - return( POLARSSL_ERR_MPI_FILE_IO_ERROR ); - - slen = strlen( s ); - if( s[slen - 1] == '\n' ) { slen--; s[slen] = '\0'; } - if( s[slen - 1] == '\r' ) { slen--; s[slen] = '\0'; } - - p = s + slen; - while( --p >= s ) - if( mpi_get_digit( &d, radix, *p ) != 0 ) - break; - - return( mpi_read_string( X, radix, p + 1 ) ); -} - -/* - * Write X into an opened file (or stdout if fout == NULL) - */ -int mpi_write_file( char *p, mpi *X, int radix, FILE *fout ) -{ - int n, ret; - size_t slen; - size_t plen; - char s[1024]; - - n = sizeof( s ); - memset( s, 0, n ); - n -= 2; - - MPI_CHK( mpi_write_string( X, radix, s, (int *) &n ) ); - - if( p == NULL ) p = ""; - - plen = strlen( p ); - slen = strlen( s ); - s[slen++] = '\r'; - s[slen++] = '\n'; - - if( fout != NULL ) - { - if( fwrite( p, 1, plen, fout ) != plen || - fwrite( s, 1, slen, fout ) != slen ) - return( POLARSSL_ERR_MPI_FILE_IO_ERROR ); - } - else - printf( "%s%s", p, s ); - -cleanup: - - return( ret ); -} - -/* - * Import X from unsigned binary data, big endian - */ -int mpi_read_binary( mpi *X, unsigned char *buf, int buflen ) -{ - int ret, i, j, n; - - for( n = 0; n < buflen; n++ ) - if( buf[n] != 0 ) - break; - - MPI_CHK( mpi_grow( X, CHARS_TO_LIMBS( buflen - n ) ) ); - MPI_CHK( mpi_lset( X, 0 ) ); - - for( i = buflen - 1, j = 0; i >= n; i--, j++ ) - X->p[j / ciL] |= ((t_int) buf[i]) << ((j % ciL) << 3); - -cleanup: - - return( ret ); -} - -/* - * Export X into unsigned binary data, big endian - */ -int mpi_write_binary( mpi *X, unsigned char *buf, int buflen ) -{ - int i, j, n; - - n = mpi_size( X ); - - if( buflen < n ) - return( POLARSSL_ERR_MPI_BUFFER_TOO_SMALL ); - - memset( buf, 0, buflen ); - - for( i = buflen - 1, j = 0; n > 0; i--, j++, n-- ) - buf[i] = (unsigned char)( X->p[j / ciL] >> ((j % ciL) << 3) ); - - return( 0 ); -} - -/* - * Left-shift: X <<= count - */ -int mpi_shift_l( mpi *X, int count ) -{ - int ret, i, v0, t1; - t_int r0 = 0, r1; - - v0 = count / (biL ); - t1 = count & (biL - 1); - - i = mpi_msb( X ) + count; - - if( X->n * (int) biL < i ) - MPI_CHK( mpi_grow( X, BITS_TO_LIMBS( i ) ) ); - - ret = 0; - - /* - * shift by count / limb_size - */ - if( v0 > 0 ) - { - for( i = X->n - 1; i >= v0; i-- ) - X->p[i] = X->p[i - v0]; - - for( ; i >= 0; i-- ) - X->p[i] = 0; - } - - /* - * shift by count % limb_size - */ - if( t1 > 0 ) - { - for( i = v0; i < X->n; i++ ) - { - r1 = X->p[i] >> (biL - t1); - X->p[i] <<= t1; - X->p[i] |= r0; - r0 = r1; - } - } - -cleanup: - - return( ret ); -} - -/* - * Right-shift: X >>= count - */ -int mpi_shift_r( mpi *X, int count ) -{ - int i, v0, v1; - t_int r0 = 0, r1; - - v0 = count / biL; - v1 = count & (biL - 1); - - /* - * shift by count / limb_size - */ - if( v0 > 0 ) - { - for( i = 0; i < X->n - v0; i++ ) - X->p[i] = X->p[i + v0]; - - for( ; i < X->n; i++ ) - X->p[i] = 0; - } - - /* - * shift by count % limb_size - */ - if( v1 > 0 ) - { - for( i = X->n - 1; i >= 0; i-- ) - { - r1 = X->p[i] << (biL - v1); - X->p[i] >>= v1; - X->p[i] |= r0; - r0 = r1; - } - } - - return( 0 ); -} - -/* - * Compare unsigned values - */ -int mpi_cmp_abs( mpi *X, mpi *Y ) -{ - int i, j; - - for( i = X->n - 1; i >= 0; i-- ) - if( X->p[i] != 0 ) - break; - - for( j = Y->n - 1; j >= 0; j-- ) - if( Y->p[j] != 0 ) - break; - - if( i < 0 && j < 0 ) - return( 0 ); - - if( i > j ) return( 1 ); - if( j > i ) return( -1 ); - - for( ; i >= 0; i-- ) - { - if( X->p[i] > Y->p[i] ) return( 1 ); - if( X->p[i] < Y->p[i] ) return( -1 ); - } - - return( 0 ); -} - -/* - * Compare signed values - */ -int mpi_cmp_mpi( mpi *X, mpi *Y ) -{ - int i, j; - - for( i = X->n - 1; i >= 0; i-- ) - if( X->p[i] != 0 ) - break; - - for( j = Y->n - 1; j >= 0; j-- ) - if( Y->p[j] != 0 ) - break; - - if( i < 0 && j < 0 ) - return( 0 ); - - if( i > j ) return( X->s ); - if( j > i ) return( -X->s ); - - if( X->s > 0 && Y->s < 0 ) return( 1 ); - if( Y->s > 0 && X->s < 0 ) return( -1 ); - - for( ; i >= 0; i-- ) - { - if( X->p[i] > Y->p[i] ) return( X->s ); - if( X->p[i] < Y->p[i] ) return( -X->s ); - } - - return( 0 ); -} - -/* - * Compare signed values - */ -int mpi_cmp_int( mpi *X, int z ) -{ - mpi Y; - t_int p[1]; - - *p = ( z < 0 ) ? -z : z; - Y.s = ( z < 0 ) ? -1 : 1; - Y.n = 1; - Y.p = p; - - return( mpi_cmp_mpi( X, &Y ) ); -} - -/* - * Unsigned addition: X = |A| + |B| (HAC 14.7) - */ -int mpi_add_abs( mpi *X, mpi *A, mpi *B ) -{ - int ret, i, j; - t_int *o, *p, c; - - if( X == B ) - { - mpi *T = A; A = X; B = T; - } - - if( X != A ) - MPI_CHK( mpi_copy( X, A ) ); - - for( j = B->n - 1; j >= 0; j-- ) - if( B->p[j] != 0 ) - break; - - MPI_CHK( mpi_grow( X, j + 1 ) ); - - o = B->p; p = X->p; c = 0; - - for( i = 0; i <= j; i++, o++, p++ ) - { - *p += c; c = ( *p < c ); - *p += *o; c += ( *p < *o ); - } - - while( c != 0 ) - { - if( i >= X->n ) - { - MPI_CHK( mpi_grow( X, i + 1 ) ); - p = X->p + i; - } - - *p += c; c = ( *p < c ); i++; - } - -cleanup: - - return( ret ); -} - -/* - * Helper for mpi substraction - */ -static void mpi_sub_hlp( int n, t_int *s, t_int *d ) -{ - int i; - t_int c, z; - - for( i = c = 0; i < n; i++, s++, d++ ) - { - z = ( *d < c ); *d -= c; - c = ( *d < *s ) + z; *d -= *s; - } - - while( c != 0 ) - { - z = ( *d < c ); *d -= c; - c = z; i++; d++; - } -} - -/* - * Unsigned substraction: X = |A| - |B| (HAC 14.9) - */ -int mpi_sub_abs( mpi *X, mpi *A, mpi *B ) -{ - mpi TB; - int ret, n; - - if( mpi_cmp_abs( A, B ) < 0 ) - return( POLARSSL_ERR_MPI_NEGATIVE_VALUE ); - - mpi_init( &TB, NULL ); - - if( X == B ) - { - MPI_CHK( mpi_copy( &TB, B ) ); - B = &TB; - } - - if( X != A ) - MPI_CHK( mpi_copy( X, A ) ); - - ret = 0; - - for( n = B->n - 1; n >= 0; n-- ) - if( B->p[n] != 0 ) - break; - - mpi_sub_hlp( n + 1, B->p, X->p ); - -cleanup: - - mpi_free( &TB, NULL ); - - return( ret ); -} - -/* - * Signed addition: X = A + B - */ -int mpi_add_mpi( mpi *X, mpi *A, mpi *B ) -{ - int ret, s = A->s; - - if( A->s * B->s < 0 ) - { - if( mpi_cmp_abs( A, B ) >= 0 ) - { - MPI_CHK( mpi_sub_abs( X, A, B ) ); - X->s = s; - } - else - { - MPI_CHK( mpi_sub_abs( X, B, A ) ); - X->s = -s; - } - } - else - { - MPI_CHK( mpi_add_abs( X, A, B ) ); - X->s = s; - } - -cleanup: - - return( ret ); -} - -/* - * Signed substraction: X = A - B - */ -int mpi_sub_mpi( mpi *X, mpi *A, mpi *B ) -{ - int ret, s = A->s; - - if( A->s * B->s > 0 ) - { - if( mpi_cmp_abs( A, B ) >= 0 ) - { - MPI_CHK( mpi_sub_abs( X, A, B ) ); - X->s = s; - } - else - { - MPI_CHK( mpi_sub_abs( X, B, A ) ); - X->s = -s; - } - } - else - { - MPI_CHK( mpi_add_abs( X, A, B ) ); - X->s = s; - } - -cleanup: - - return( ret ); -} - -/* - * Signed addition: X = A + b - */ -int mpi_add_int( mpi *X, mpi *A, int b ) -{ - mpi _B; - t_int p[1]; - - p[0] = ( b < 0 ) ? -b : b; - _B.s = ( b < 0 ) ? -1 : 1; - _B.n = 1; - _B.p = p; - - return( mpi_add_mpi( X, A, &_B ) ); -} - -/* - * Signed substraction: X = A - b - */ -int mpi_sub_int( mpi *X, mpi *A, int b ) -{ - mpi _B; - t_int p[1]; - - p[0] = ( b < 0 ) ? -b : b; - _B.s = ( b < 0 ) ? -1 : 1; - _B.n = 1; - _B.p = p; - - return( mpi_sub_mpi( X, A, &_B ) ); -} - -/* - * Helper for mpi multiplication - */ -static void mpi_mul_hlp( int i, t_int *s, t_int *d, t_int b ) -{ - t_int c = 0, t = 0; - -#if defined(MULADDC_HUIT) - for( ; i >= 8; i -= 8 ) - { - MULADDC_INIT - MULADDC_HUIT - MULADDC_STOP - } - - for( ; i > 0; i-- ) - { - MULADDC_INIT - MULADDC_CORE - MULADDC_STOP - } -#else - for( ; i >= 16; i -= 16 ) - { - MULADDC_INIT - MULADDC_CORE MULADDC_CORE - MULADDC_CORE MULADDC_CORE - MULADDC_CORE MULADDC_CORE - MULADDC_CORE MULADDC_CORE - - MULADDC_CORE MULADDC_CORE - MULADDC_CORE MULADDC_CORE - MULADDC_CORE MULADDC_CORE - MULADDC_CORE MULADDC_CORE - MULADDC_STOP - } - - for( ; i >= 8; i -= 8 ) - { - MULADDC_INIT - MULADDC_CORE MULADDC_CORE - MULADDC_CORE MULADDC_CORE - - MULADDC_CORE MULADDC_CORE - MULADDC_CORE MULADDC_CORE - MULADDC_STOP - } - - for( ; i > 0; i-- ) - { - MULADDC_INIT - MULADDC_CORE - MULADDC_STOP - } -#endif - - t++; - - do { - *d += c; c = ( *d < c ); d++; - } - while( c != 0 ); -} - -/* - * Baseline multiplication: X = A * B (HAC 14.12) - */ -int mpi_mul_mpi( mpi *X, mpi *A, mpi *B ) -{ - int ret, i, j; - mpi TA, TB; - - mpi_init( &TA, &TB, NULL ); - - if( X == A ) { MPI_CHK( mpi_copy( &TA, A ) ); A = &TA; } - if( X == B ) { MPI_CHK( mpi_copy( &TB, B ) ); B = &TB; } - - for( i = A->n - 1; i >= 0; i-- ) - if( A->p[i] != 0 ) - break; - - for( j = B->n - 1; j >= 0; j-- ) - if( B->p[j] != 0 ) - break; - - MPI_CHK( mpi_grow( X, i + j + 2 ) ); - MPI_CHK( mpi_lset( X, 0 ) ); - - for( i++; j >= 0; j-- ) - mpi_mul_hlp( i, A->p, X->p + j, B->p[j] ); - - X->s = A->s * B->s; - -cleanup: - - mpi_free( &TB, &TA, NULL ); - - return( ret ); -} - -/* - * Baseline multiplication: X = A * b - */ -int mpi_mul_int( mpi *X, mpi *A, t_int b ) -{ - mpi _B; - t_int p[1]; - - _B.s = 1; - _B.n = 1; - _B.p = p; - p[0] = b; - - return( mpi_mul_mpi( X, A, &_B ) ); -} - -/* - * Division by mpi: A = Q * B + R (HAC 14.20) - */ -int mpi_div_mpi( mpi *Q, mpi *R, mpi *A, mpi *B ) -{ - int ret, i, n, t, k; - mpi X, Y, Z, T1, T2; - - if( mpi_cmp_int( B, 0 ) == 0 ) - return( POLARSSL_ERR_MPI_DIVISION_BY_ZERO ); - - mpi_init( &X, &Y, &Z, &T1, &T2, NULL ); - - if( mpi_cmp_abs( A, B ) < 0 ) - { - if( Q != NULL ) MPI_CHK( mpi_lset( Q, 0 ) ); - if( R != NULL ) MPI_CHK( mpi_copy( R, A ) ); - return( 0 ); - } - - MPI_CHK( mpi_copy( &X, A ) ); - MPI_CHK( mpi_copy( &Y, B ) ); - X.s = Y.s = 1; - - MPI_CHK( mpi_grow( &Z, A->n + 2 ) ); - MPI_CHK( mpi_lset( &Z, 0 ) ); - MPI_CHK( mpi_grow( &T1, 2 ) ); - MPI_CHK( mpi_grow( &T2, 3 ) ); - - k = mpi_msb( &Y ) % biL; - if( k < (int) biL - 1 ) - { - k = biL - 1 - k; - MPI_CHK( mpi_shift_l( &X, k ) ); - MPI_CHK( mpi_shift_l( &Y, k ) ); - } - else k = 0; - - n = X.n - 1; - t = Y.n - 1; - mpi_shift_l( &Y, biL * (n - t) ); - - while( mpi_cmp_mpi( &X, &Y ) >= 0 ) - { - Z.p[n - t]++; - mpi_sub_mpi( &X, &X, &Y ); - } - mpi_shift_r( &Y, biL * (n - t) ); - - for( i = n; i > t ; i-- ) - { - if( X.p[i] >= Y.p[t] ) - Z.p[i - t - 1] = ~0; - else - { -#if defined(POLARSSL_HAVE_LONGLONG) - t_dbl r; - - r = (t_dbl) X.p[i] << biL; - r |= (t_dbl) X.p[i - 1]; - r /= Y.p[t]; - if( r > ((t_dbl) 1 << biL) - 1) - r = ((t_dbl) 1 << biL) - 1; - - Z.p[i - t - 1] = (t_int) r; -#else - /* - * __udiv_qrnnd_c, from gmp/longlong.h - */ - t_int q0, q1, r0, r1; - t_int d0, d1, d, m; - - d = Y.p[t]; - d0 = ( d << biH ) >> biH; - d1 = ( d >> biH ); - - q1 = X.p[i] / d1; - r1 = X.p[i] - d1 * q1; - r1 <<= biH; - r1 |= ( X.p[i - 1] >> biH ); - - m = q1 * d0; - if( r1 < m ) - { - q1--, r1 += d; - while( r1 >= d && r1 < m ) - q1--, r1 += d; - } - r1 -= m; - - q0 = r1 / d1; - r0 = r1 - d1 * q0; - r0 <<= biH; - r0 |= ( X.p[i - 1] << biH ) >> biH; - - m = q0 * d0; - if( r0 < m ) - { - q0--, r0 += d; - while( r0 >= d && r0 < m ) - q0--, r0 += d; - } - r0 -= m; - - Z.p[i - t - 1] = ( q1 << biH ) | q0; -#endif - } - - Z.p[i - t - 1]++; - do - { - Z.p[i - t - 1]--; - - MPI_CHK( mpi_lset( &T1, 0 ) ); - T1.p[0] = (t < 1) ? 0 : Y.p[t - 1]; - T1.p[1] = Y.p[t]; - MPI_CHK( mpi_mul_int( &T1, &T1, Z.p[i - t - 1] ) ); - - MPI_CHK( mpi_lset( &T2, 0 ) ); - T2.p[0] = (i < 2) ? 0 : X.p[i - 2]; - T2.p[1] = (i < 1) ? 0 : X.p[i - 1]; - T2.p[2] = X.p[i]; - } - while( mpi_cmp_mpi( &T1, &T2 ) > 0 ); - - MPI_CHK( mpi_mul_int( &T1, &Y, Z.p[i - t - 1] ) ); - MPI_CHK( mpi_shift_l( &T1, biL * (i - t - 1) ) ); - MPI_CHK( mpi_sub_mpi( &X, &X, &T1 ) ); - - if( mpi_cmp_int( &X, 0 ) < 0 ) - { - MPI_CHK( mpi_copy( &T1, &Y ) ); - MPI_CHK( mpi_shift_l( &T1, biL * (i - t - 1) ) ); - MPI_CHK( mpi_add_mpi( &X, &X, &T1 ) ); - Z.p[i - t - 1]--; - } - } - - if( Q != NULL ) - { - mpi_copy( Q, &Z ); - Q->s = A->s * B->s; - } - - if( R != NULL ) - { - mpi_shift_r( &X, k ); - mpi_copy( R, &X ); - - R->s = A->s; - if( mpi_cmp_int( R, 0 ) == 0 ) - R->s = 1; - } - -cleanup: - - mpi_free( &X, &Y, &Z, &T1, &T2, NULL ); - - return( ret ); -} - -/* - * Division by int: A = Q * b + R - * - * Returns 0 if successful - * 1 if memory allocation failed - * POLARSSL_ERR_MPI_DIVISION_BY_ZERO if b == 0 - */ -int mpi_div_int( mpi *Q, mpi *R, mpi *A, int b ) -{ - mpi _B; - t_int p[1]; - - p[0] = ( b < 0 ) ? -b : b; - _B.s = ( b < 0 ) ? -1 : 1; - _B.n = 1; - _B.p = p; - - return( mpi_div_mpi( Q, R, A, &_B ) ); -} - -/* - * Modulo: R = A mod B - */ -int mpi_mod_mpi( mpi *R, mpi *A, mpi *B ) -{ - int ret; - - MPI_CHK( mpi_div_mpi( NULL, R, A, B ) ); - - while( mpi_cmp_int( R, 0 ) < 0 ) - MPI_CHK( mpi_add_mpi( R, R, B ) ); - - while( mpi_cmp_mpi( R, B ) >= 0 ) - MPI_CHK( mpi_sub_mpi( R, R, B ) ); - -cleanup: - - return( ret ); -} - -/* - * Modulo: r = A mod b - */ -int mpi_mod_int( t_int *r, mpi *A, int b ) -{ - int i; - t_int x, y, z; - - if( b == 0 ) - return( POLARSSL_ERR_MPI_DIVISION_BY_ZERO ); - - if( b < 0 ) - b = -b; - - /* - * handle trivial cases - */ - if( b == 1 ) - { - *r = 0; - return( 0 ); - } - - if( b == 2 ) - { - *r = A->p[0] & 1; - return( 0 ); - } - - /* - * general case - */ - for( i = A->n - 1, y = 0; i >= 0; i-- ) - { - x = A->p[i]; - y = ( y << biH ) | ( x >> biH ); - z = y / b; - y -= z * b; - - x <<= biH; - y = ( y << biH ) | ( x >> biH ); - z = y / b; - y -= z * b; - } - - *r = y; - - return( 0 ); -} - -/* - * Fast Montgomery initialization (thanks to Tom St Denis) - */ -static void mpi_montg_init( t_int *mm, mpi *N ) -{ - t_int x, m0 = N->p[0]; - - x = m0; - x += ( ( m0 + 2 ) & 4 ) << 1; - x *= ( 2 - ( m0 * x ) ); - - if( biL >= 16 ) x *= ( 2 - ( m0 * x ) ); - if( biL >= 32 ) x *= ( 2 - ( m0 * x ) ); - if( biL >= 64 ) x *= ( 2 - ( m0 * x ) ); - - *mm = ~x + 1; -} - -/* - * Montgomery multiplication: A = A * B * R^-1 mod N (HAC 14.36) - */ -static void mpi_montmul( mpi *A, mpi *B, mpi *N, t_int mm, mpi *T ) -{ - int i, n, m; - t_int u0, u1, *d; - - memset( T->p, 0, T->n * ciL ); - - d = T->p; - n = N->n; - m = ( B->n < n ) ? B->n : n; - - for( i = 0; i < n; i++ ) - { - /* - * T = (T + u0*B + u1*N) / 2^biL - */ - u0 = A->p[i]; - u1 = ( d[0] + u0 * B->p[0] ) * mm; - - mpi_mul_hlp( m, B->p, d, u0 ); - mpi_mul_hlp( n, N->p, d, u1 ); - - *d++ = u0; d[n + 1] = 0; - } - - memcpy( A->p, d, (n + 1) * ciL ); - - if( mpi_cmp_abs( A, N ) >= 0 ) - mpi_sub_hlp( n, N->p, A->p ); - else - /* prevent timing attacks */ - mpi_sub_hlp( n, A->p, T->p ); -} - -/* - * Montgomery reduction: A = A * R^-1 mod N - */ -static void mpi_montred( mpi *A, mpi *N, t_int mm, mpi *T ) -{ - t_int z = 1; - mpi U; - - U.n = U.s = z; - U.p = &z; - - mpi_montmul( A, &U, N, mm, T ); -} - -/* - * Sliding-window exponentiation: X = A^E mod N (HAC 14.85) - */ -int mpi_exp_mod( mpi *X, mpi *A, mpi *E, mpi *N, mpi *_RR ) -{ - int ret, i, j, wsize, wbits; - int bufsize, nblimbs, nbits; - t_int ei, mm, state; - mpi RR, T, W[64]; - - if( mpi_cmp_int( N, 0 ) < 0 || ( N->p[0] & 1 ) == 0 ) - return( POLARSSL_ERR_MPI_BAD_INPUT_DATA ); - - /* - * Init temps and window size - */ - mpi_montg_init( &mm, N ); - mpi_init( &RR, &T, NULL ); - memset( W, 0, sizeof( W ) ); - - i = mpi_msb( E ); - - wsize = ( i > 671 ) ? 6 : ( i > 239 ) ? 5 : - ( i > 79 ) ? 4 : ( i > 23 ) ? 3 : 1; - - j = N->n + 1; - MPI_CHK( mpi_grow( X, j ) ); - MPI_CHK( mpi_grow( &W[1], j ) ); - MPI_CHK( mpi_grow( &T, j * 2 ) ); - - /* - * If 1st call, pre-compute R^2 mod N - */ - if( _RR == NULL || _RR->p == NULL ) - { - MPI_CHK( mpi_lset( &RR, 1 ) ); - MPI_CHK( mpi_shift_l( &RR, N->n * 2 * biL ) ); - MPI_CHK( mpi_mod_mpi( &RR, &RR, N ) ); - - if( _RR != NULL ) - memcpy( _RR, &RR, sizeof( mpi ) ); - } - else - memcpy( &RR, _RR, sizeof( mpi ) ); - - /* - * W[1] = A * R^2 * R^-1 mod N = A * R mod N - */ - if( mpi_cmp_mpi( A, N ) >= 0 ) - mpi_mod_mpi( &W[1], A, N ); - else mpi_copy( &W[1], A ); - - mpi_montmul( &W[1], &RR, N, mm, &T ); - - /* - * X = R^2 * R^-1 mod N = R mod N - */ - MPI_CHK( mpi_copy( X, &RR ) ); - mpi_montred( X, N, mm, &T ); - - if( wsize > 1 ) - { - /* - * W[1 << (wsize - 1)] = W[1] ^ (wsize - 1) - */ - j = 1 << (wsize - 1); - - MPI_CHK( mpi_grow( &W[j], N->n + 1 ) ); - MPI_CHK( mpi_copy( &W[j], &W[1] ) ); - - for( i = 0; i < wsize - 1; i++ ) - mpi_montmul( &W[j], &W[j], N, mm, &T ); - - /* - * W[i] = W[i - 1] * W[1] - */ - for( i = j + 1; i < (1 << wsize); i++ ) - { - MPI_CHK( mpi_grow( &W[i], N->n + 1 ) ); - MPI_CHK( mpi_copy( &W[i], &W[i - 1] ) ); - - mpi_montmul( &W[i], &W[1], N, mm, &T ); - } - } - - nblimbs = E->n; - bufsize = 0; - nbits = 0; - wbits = 0; - state = 0; - - while( 1 ) - { - if( bufsize == 0 ) - { - if( nblimbs-- == 0 ) - break; - - bufsize = sizeof( t_int ) << 3; - } - - bufsize--; - - ei = (E->p[nblimbs] >> bufsize) & 1; - - /* - * skip leading 0s - */ - if( ei == 0 && state == 0 ) - continue; - - if( ei == 0 && state == 1 ) - { - /* - * out of window, square X - */ - mpi_montmul( X, X, N, mm, &T ); - continue; - } - - /* - * add ei to current window - */ - state = 2; - - nbits++; - wbits |= (ei << (wsize - nbits)); - - if( nbits == wsize ) - { - /* - * X = X^wsize R^-1 mod N - */ - for( i = 0; i < wsize; i++ ) - mpi_montmul( X, X, N, mm, &T ); - - /* - * X = X * W[wbits] R^-1 mod N - */ - mpi_montmul( X, &W[wbits], N, mm, &T ); - - state--; - nbits = 0; - wbits = 0; - } - } - - /* - * process the remaining bits - */ - for( i = 0; i < nbits; i++ ) - { - mpi_montmul( X, X, N, mm, &T ); - - wbits <<= 1; - - if( (wbits & (1 << wsize)) != 0 ) - mpi_montmul( X, &W[1], N, mm, &T ); - } - - /* - * X = A^E * R * R^-1 mod N = A^E mod N - */ - mpi_montred( X, N, mm, &T ); - -cleanup: - - for( i = (1 << (wsize - 1)); i < (1 << wsize); i++ ) - mpi_free( &W[i], NULL ); - - if( _RR != NULL ) - mpi_free( &W[1], &T, NULL ); - else mpi_free( &W[1], &T, &RR, NULL ); - - return( ret ); -} - -/* - * Greatest common divisor: G = gcd(A, B) (HAC 14.54) - */ -int mpi_gcd( mpi *G, mpi *A, mpi *B ) -{ - int ret, lz, lzt; - mpi TG, TA, TB; - - mpi_init( &TG, &TA, &TB, NULL ); - - MPI_CHK( mpi_copy( &TA, A ) ); - MPI_CHK( mpi_copy( &TB, B ) ); - - lz = mpi_lsb( &TA ); - lzt = mpi_lsb( &TB ); - - if ( lzt < lz ) - lz = lzt; - - MPI_CHK( mpi_shift_r( &TA, lz ) ); - MPI_CHK( mpi_shift_r( &TB, lz ) ); - - TA.s = TB.s = 1; - - while( mpi_cmp_int( &TA, 0 ) != 0 ) - { - MPI_CHK( mpi_shift_r( &TA, mpi_lsb( &TA ) ) ); - MPI_CHK( mpi_shift_r( &TB, mpi_lsb( &TB ) ) ); - - if( mpi_cmp_mpi( &TA, &TB ) >= 0 ) - { - MPI_CHK( mpi_sub_abs( &TA, &TA, &TB ) ); - MPI_CHK( mpi_shift_r( &TA, 1 ) ); - } - else - { - MPI_CHK( mpi_sub_abs( &TB, &TB, &TA ) ); - MPI_CHK( mpi_shift_r( &TB, 1 ) ); - } - } - - MPI_CHK( mpi_shift_l( &TB, lz ) ); - MPI_CHK( mpi_copy( G, &TB ) ); - -cleanup: - - mpi_free( &TB, &TA, &TG, NULL ); - - return( ret ); -} - -#if defined(POLARSSL_GENPRIME) - -/* - * Modular inverse: X = A^-1 mod N (HAC 14.61 / 14.64) - */ -int mpi_inv_mod( mpi *X, mpi *A, mpi *N ) -{ - int ret; - mpi G, TA, TU, U1, U2, TB, TV, V1, V2; - - if( mpi_cmp_int( N, 0 ) <= 0 ) - return( POLARSSL_ERR_MPI_BAD_INPUT_DATA ); - - mpi_init( &TA, &TU, &U1, &U2, &G, - &TB, &TV, &V1, &V2, NULL ); - - MPI_CHK( mpi_gcd( &G, A, N ) ); - - if( mpi_cmp_int( &G, 1 ) != 0 ) - { - ret = POLARSSL_ERR_MPI_NOT_ACCEPTABLE; - goto cleanup; - } - - MPI_CHK( mpi_mod_mpi( &TA, A, N ) ); - MPI_CHK( mpi_copy( &TU, &TA ) ); - MPI_CHK( mpi_copy( &TB, N ) ); - MPI_CHK( mpi_copy( &TV, N ) ); - - MPI_CHK( mpi_lset( &U1, 1 ) ); - MPI_CHK( mpi_lset( &U2, 0 ) ); - MPI_CHK( mpi_lset( &V1, 0 ) ); - MPI_CHK( mpi_lset( &V2, 1 ) ); - - do - { - while( ( TU.p[0] & 1 ) == 0 ) - { - MPI_CHK( mpi_shift_r( &TU, 1 ) ); - - if( ( U1.p[0] & 1 ) != 0 || ( U2.p[0] & 1 ) != 0 ) - { - MPI_CHK( mpi_add_mpi( &U1, &U1, &TB ) ); - MPI_CHK( mpi_sub_mpi( &U2, &U2, &TA ) ); - } - - MPI_CHK( mpi_shift_r( &U1, 1 ) ); - MPI_CHK( mpi_shift_r( &U2, 1 ) ); - } - - while( ( TV.p[0] & 1 ) == 0 ) - { - MPI_CHK( mpi_shift_r( &TV, 1 ) ); - - if( ( V1.p[0] & 1 ) != 0 || ( V2.p[0] & 1 ) != 0 ) - { - MPI_CHK( mpi_add_mpi( &V1, &V1, &TB ) ); - MPI_CHK( mpi_sub_mpi( &V2, &V2, &TA ) ); - } - - MPI_CHK( mpi_shift_r( &V1, 1 ) ); - MPI_CHK( mpi_shift_r( &V2, 1 ) ); - } - - if( mpi_cmp_mpi( &TU, &TV ) >= 0 ) - { - MPI_CHK( mpi_sub_mpi( &TU, &TU, &TV ) ); - MPI_CHK( mpi_sub_mpi( &U1, &U1, &V1 ) ); - MPI_CHK( mpi_sub_mpi( &U2, &U2, &V2 ) ); - } - else - { - MPI_CHK( mpi_sub_mpi( &TV, &TV, &TU ) ); - MPI_CHK( mpi_sub_mpi( &V1, &V1, &U1 ) ); - MPI_CHK( mpi_sub_mpi( &V2, &V2, &U2 ) ); - } - } - while( mpi_cmp_int( &TU, 0 ) != 0 ); - - while( mpi_cmp_int( &V1, 0 ) < 0 ) - MPI_CHK( mpi_add_mpi( &V1, &V1, N ) ); - - while( mpi_cmp_mpi( &V1, N ) >= 0 ) - MPI_CHK( mpi_sub_mpi( &V1, &V1, N ) ); - - MPI_CHK( mpi_copy( X, &V1 ) ); - -cleanup: - - mpi_free( &V2, &V1, &TV, &TB, &G, - &U2, &U1, &TU, &TA, NULL ); - - return( ret ); -} - -static const int small_prime[] = -{ - 3, 5, 7, 11, 13, 17, 19, 23, - 29, 31, 37, 41, 43, 47, 53, 59, - 61, 67, 71, 73, 79, 83, 89, 97, - 101, 103, 107, 109, 113, 127, 131, 137, - 139, 149, 151, 157, 163, 167, 173, 179, - 181, 191, 193, 197, 199, 211, 223, 227, - 229, 233, 239, 241, 251, 257, 263, 269, - 271, 277, 281, 283, 293, 307, 311, 313, - 317, 331, 337, 347, 349, 353, 359, 367, - 373, 379, 383, 389, 397, 401, 409, 419, - 421, 431, 433, 439, 443, 449, 457, 461, - 463, 467, 479, 487, 491, 499, 503, 509, - 521, 523, 541, 547, 557, 563, 569, 571, - 577, 587, 593, 599, 601, 607, 613, 617, - 619, 631, 641, 643, 647, 653, 659, 661, - 673, 677, 683, 691, 701, 709, 719, 727, - 733, 739, 743, 751, 757, 761, 769, 773, - 787, 797, 809, 811, 821, 823, 827, 829, - 839, 853, 857, 859, 863, 877, 881, 883, - 887, 907, 911, 919, 929, 937, 941, 947, - 953, 967, 971, 977, 983, 991, 997, -103 -}; - -/* - * Miller-Rabin primality test (HAC 4.24) - */ -int mpi_is_prime( mpi *X, int (*f_rng)(void *), void *p_rng ) -{ - int ret, i, j, n, s, xs; - mpi W, R, T, A, RR; - unsigned char *p; - - if( mpi_cmp_int( X, 0 ) == 0 ) - return( 0 ); - - mpi_init( &W, &R, &T, &A, &RR, NULL ); - - xs = X->s; X->s = 1; - - /* - * test trivial factors first - */ - if( ( X->p[0] & 1 ) == 0 ) - return( POLARSSL_ERR_MPI_NOT_ACCEPTABLE ); - - for( i = 0; small_prime[i] > 0; i++ ) - { - t_int r; - - if( mpi_cmp_int( X, small_prime[i] ) <= 0 ) - return( 0 ); - - MPI_CHK( mpi_mod_int( &r, X, small_prime[i] ) ); - - if( r == 0 ) - return( POLARSSL_ERR_MPI_NOT_ACCEPTABLE ); - } - - /* - * W = |X| - 1 - * R = W >> lsb( W ) - */ - s = mpi_lsb( &W ); - MPI_CHK( mpi_sub_int( &W, X, 1 ) ); - MPI_CHK( mpi_copy( &R, &W ) ); - MPI_CHK( mpi_shift_r( &R, s ) ); - - i = mpi_msb( X ); - /* - * HAC, table 4.4 - */ - n = ( ( i >= 1300 ) ? 2 : ( i >= 850 ) ? 3 : - ( i >= 650 ) ? 4 : ( i >= 350 ) ? 8 : - ( i >= 250 ) ? 12 : ( i >= 150 ) ? 18 : 27 ); - - for( i = 0; i < n; i++ ) - { - /* - * pick a random A, 1 < A < |X| - 1 - */ - MPI_CHK( mpi_grow( &A, X->n ) ); - - p = (unsigned char *) A.p; - for( j = 0; j < A.n * ciL; j++ ) - *p++ = (unsigned char) f_rng( p_rng ); - - j = mpi_msb( &A ) - mpi_msb( &W ); - MPI_CHK( mpi_shift_r( &A, j + 1 ) ); - A.p[0] |= 3; - - /* - * A = A^R mod |X| - */ - MPI_CHK( mpi_exp_mod( &A, &A, &R, X, &RR ) ); - - if( mpi_cmp_mpi( &A, &W ) == 0 || - mpi_cmp_int( &A, 1 ) == 0 ) - continue; - - j = 1; - while( j < s && mpi_cmp_mpi( &A, &W ) != 0 ) - { - /* - * A = A * A mod |X| - */ - MPI_CHK( mpi_mul_mpi( &T, &A, &A ) ); - MPI_CHK( mpi_mod_mpi( &A, &T, X ) ); - - if( mpi_cmp_int( &A, 1 ) == 0 ) - break; - - j++; - } - - /* - * not prime if A != |X| - 1 or A == 1 - */ - if( mpi_cmp_mpi( &A, &W ) != 0 || - mpi_cmp_int( &A, 1 ) == 0 ) - { - ret = POLARSSL_ERR_MPI_NOT_ACCEPTABLE; - break; - } - } - -cleanup: - - X->s = xs; - - mpi_free( &RR, &A, &T, &R, &W, NULL ); - - return( ret ); -} - -/* - * Prime number generation - */ -int mpi_gen_prime( mpi *X, int nbits, int dh_flag, - int (*f_rng)(void *), void *p_rng ) -{ - int ret, k, n; - unsigned char *p; - mpi Y; - - if( nbits < 3 ) - return( POLARSSL_ERR_MPI_BAD_INPUT_DATA ); - - mpi_init( &Y, NULL ); - - n = BITS_TO_LIMBS( nbits ); - - MPI_CHK( mpi_grow( X, n ) ); - MPI_CHK( mpi_lset( X, 0 ) ); - - p = (unsigned char *) X->p; - for( k = 0; k < X->n * ciL; k++ ) - *p++ = (unsigned char) f_rng( p_rng ); - - k = mpi_msb( X ); - if( k < nbits ) MPI_CHK( mpi_shift_l( X, nbits - k ) ); - if( k > nbits ) MPI_CHK( mpi_shift_r( X, k - nbits ) ); - - X->p[0] |= 3; - - if( dh_flag == 0 ) - { - while( ( ret = mpi_is_prime( X, f_rng, p_rng ) ) != 0 ) - { - if( ret != POLARSSL_ERR_MPI_NOT_ACCEPTABLE ) - goto cleanup; - - MPI_CHK( mpi_add_int( X, X, 2 ) ); - } - } - else - { - MPI_CHK( mpi_sub_int( &Y, X, 1 ) ); - MPI_CHK( mpi_shift_r( &Y, 1 ) ); - - while( 1 ) - { - if( ( ret = mpi_is_prime( X, f_rng, p_rng ) ) == 0 ) - { - if( ( ret = mpi_is_prime( &Y, f_rng, p_rng ) ) == 0 ) - break; - - if( ret != POLARSSL_ERR_MPI_NOT_ACCEPTABLE ) - goto cleanup; - } - - if( ret != POLARSSL_ERR_MPI_NOT_ACCEPTABLE ) - goto cleanup; - - MPI_CHK( mpi_add_int( &Y, X, 1 ) ); - MPI_CHK( mpi_add_int( X, X, 2 ) ); - MPI_CHK( mpi_shift_r( &Y, 1 ) ); - } - } - -cleanup: - - mpi_free( &Y, NULL ); - - return( ret ); -} - -#endif - -#if defined(POLARSSL_SELF_TEST) - -#define GCD_PAIR_COUNT 3 - -static const int gcd_pairs[GCD_PAIR_COUNT][3] = -{ - { 693, 609, 21 }, - { 1764, 868, 28 }, - { 768454923, 542167814, 1 } -}; - -/* - * Checkup routine - */ -int mpi_self_test( int verbose ) -{ - int ret, i; - mpi A, E, N, X, Y, U, V; - - mpi_init( &A, &E, &N, &X, &Y, &U, &V, NULL ); - - MPI_CHK( mpi_read_string( &A, 16, - "EFE021C2645FD1DC586E69184AF4A31E" \ - "D5F53E93B5F123FA41680867BA110131" \ - "944FE7952E2517337780CB0DB80E61AA" \ - "E7C8DDC6C5C6AADEB34EB38A2F40D5E6" ) ); - - MPI_CHK( mpi_read_string( &E, 16, - "B2E7EFD37075B9F03FF989C7C5051C20" \ - "34D2A323810251127E7BF8625A4F49A5" \ - "F3E27F4DA8BD59C47D6DAABA4C8127BD" \ - "5B5C25763222FEFCCFC38B832366C29E" ) ); - - MPI_CHK( mpi_read_string( &N, 16, - "0066A198186C18C10B2F5ED9B522752A" \ - "9830B69916E535C8F047518A889A43A5" \ - "94B6BED27A168D31D4A52F88925AA8F5" ) ); - - MPI_CHK( mpi_mul_mpi( &X, &A, &N ) ); - - MPI_CHK( mpi_read_string( &U, 16, - "602AB7ECA597A3D6B56FF9829A5E8B85" \ - "9E857EA95A03512E2BAE7391688D264A" \ - "A5663B0341DB9CCFD2C4C5F421FEC814" \ - "8001B72E848A38CAE1C65F78E56ABDEF" \ - "E12D3C039B8A02D6BE593F0BBBDA56F1" \ - "ECF677152EF804370C1A305CAF3B5BF1" \ - "30879B56C61DE584A0F53A2447A51E" ) ); - - if( verbose != 0 ) - printf( " MPI test #1 (mul_mpi): " ); - - if( mpi_cmp_mpi( &X, &U ) != 0 ) - { - if( verbose != 0 ) - printf( "failed\n" ); - - return( 1 ); - } - - if( verbose != 0 ) - printf( "passed\n" ); - - MPI_CHK( mpi_div_mpi( &X, &Y, &A, &N ) ); - - MPI_CHK( mpi_read_string( &U, 16, - "256567336059E52CAE22925474705F39A94" ) ); - - MPI_CHK( mpi_read_string( &V, 16, - "6613F26162223DF488E9CD48CC132C7A" \ - "0AC93C701B001B092E4E5B9F73BCD27B" \ - "9EE50D0657C77F374E903CDFA4C642" ) ); - - if( verbose != 0 ) - printf( " MPI test #2 (div_mpi): " ); - - if( mpi_cmp_mpi( &X, &U ) != 0 || - mpi_cmp_mpi( &Y, &V ) != 0 ) - { - if( verbose != 0 ) - printf( "failed\n" ); - - return( 1 ); - } - - if( verbose != 0 ) - printf( "passed\n" ); - - MPI_CHK( mpi_exp_mod( &X, &A, &E, &N, NULL ) ); - - MPI_CHK( mpi_read_string( &U, 16, - "36E139AEA55215609D2816998ED020BB" \ - "BD96C37890F65171D948E9BC7CBAA4D9" \ - "325D24D6A3C12710F10A09FA08AB87" ) ); - - if( verbose != 0 ) - printf( " MPI test #3 (exp_mod): " ); - - if( mpi_cmp_mpi( &X, &U ) != 0 ) - { - if( verbose != 0 ) - printf( "failed\n" ); - - return( 1 ); - } - - if( verbose != 0 ) - printf( "passed\n" ); - - MPI_CHK( mpi_inv_mod( &X, &A, &N ) ); - - MPI_CHK( mpi_read_string( &U, 16, - "003A0AAEDD7E784FC07D8F9EC6E3BFD5" \ - "C3DBA76456363A10869622EAC2DD84EC" \ - "C5B8A74DAC4D09E03B5E0BE779F2DF61" ) ); - - if( verbose != 0 ) - printf( " MPI test #4 (inv_mod): " ); - - if( mpi_cmp_mpi( &X, &U ) != 0 ) - { - if( verbose != 0 ) - printf( "failed\n" ); - - return( 1 ); - } - - if( verbose != 0 ) - printf( "passed\n" ); - - if( verbose != 0 ) - printf( " MPI test #5 (simple gcd): " ); - - for ( i = 0; i < GCD_PAIR_COUNT; i++) - { - MPI_CHK( mpi_lset( &X, gcd_pairs[i][0] ) ); - MPI_CHK( mpi_lset( &Y, gcd_pairs[i][1] ) ); - - MPI_CHK( mpi_gcd( &A, &X, &Y ) ); - - if( mpi_cmp_int( &A, gcd_pairs[i][2] ) != 0 ) - { - if( verbose != 0 ) - printf( "failed at %d\n", i ); - - return( 1 ); - } - } - - if( verbose != 0 ) - printf( "passed\n" ); - -cleanup: - - if( ret != 0 && verbose != 0 ) - printf( "Unexpected error, return code = %08X\n", ret ); - - mpi_free( &V, &U, &Y, &X, &N, &E, &A, NULL ); - - if( verbose != 0 ) - printf( "\n" ); - - return( ret ); -} - -#endif - -#endif diff --git a/package/utils/px5g-standalone/src/library/rsa.c b/package/utils/px5g-standalone/src/library/rsa.c deleted file mode 100644 index 131b6c6c9c..0000000000 --- a/package/utils/px5g-standalone/src/library/rsa.c +++ /dev/null @@ -1,750 +0,0 @@ -/* - * The RSA public-key cryptosystem - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the names of PolarSSL or XySSL nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/* - * RSA was designed by Ron Rivest, Adi Shamir and Len Adleman. - * - * http://theory.lcs.mit.edu/~rivest/rsapaper.pdf - * http://www.cacr.math.uwaterloo.ca/hac/about/chap8.pdf - */ - -#include "polarssl/config.h" - -#if defined(POLARSSL_RSA_C) - -#include "polarssl/rsa.h" - -#include -#include -#include - -/* - * Initialize an RSA context - */ -void rsa_init( rsa_context *ctx, - int padding, - int hash_id, - int (*f_rng)(void *), - void *p_rng ) -{ - memset( ctx, 0, sizeof( rsa_context ) ); - - ctx->padding = padding; - ctx->hash_id = hash_id; - - ctx->f_rng = f_rng; - ctx->p_rng = p_rng; -} - -#if defined(POLARSSL_GENPRIME) - -/* - * Generate an RSA keypair - */ -int rsa_gen_key( rsa_context *ctx, int nbits, int exponent ) -{ - int ret; - mpi P1, Q1, H, G; - - if( ctx->f_rng == NULL || nbits < 128 || exponent < 3 ) - return( POLARSSL_ERR_RSA_BAD_INPUT_DATA ); - - mpi_init( &P1, &Q1, &H, &G, NULL ); - - /* - * find primes P and Q with Q < P so that: - * GCD( E, (P-1)*(Q-1) ) == 1 - */ - MPI_CHK( mpi_lset( &ctx->E, exponent ) ); - - do - { - MPI_CHK( mpi_gen_prime( &ctx->P, ( nbits + 1 ) >> 1, 0, - ctx->f_rng, ctx->p_rng ) ); - - MPI_CHK( mpi_gen_prime( &ctx->Q, ( nbits + 1 ) >> 1, 0, - ctx->f_rng, ctx->p_rng ) ); - - if( mpi_cmp_mpi( &ctx->P, &ctx->Q ) < 0 ) - mpi_swap( &ctx->P, &ctx->Q ); - - if( mpi_cmp_mpi( &ctx->P, &ctx->Q ) == 0 ) - continue; - - MPI_CHK( mpi_mul_mpi( &ctx->N, &ctx->P, &ctx->Q ) ); - if( mpi_msb( &ctx->N ) != nbits ) - continue; - - MPI_CHK( mpi_sub_int( &P1, &ctx->P, 1 ) ); - MPI_CHK( mpi_sub_int( &Q1, &ctx->Q, 1 ) ); - MPI_CHK( mpi_mul_mpi( &H, &P1, &Q1 ) ); - MPI_CHK( mpi_gcd( &G, &ctx->E, &H ) ); - } - while( mpi_cmp_int( &G, 1 ) != 0 ); - - /* - * D = E^-1 mod ((P-1)*(Q-1)) - * DP = D mod (P - 1) - * DQ = D mod (Q - 1) - * QP = Q^-1 mod P - */ - MPI_CHK( mpi_inv_mod( &ctx->D , &ctx->E, &H ) ); - MPI_CHK( mpi_mod_mpi( &ctx->DP, &ctx->D, &P1 ) ); - MPI_CHK( mpi_mod_mpi( &ctx->DQ, &ctx->D, &Q1 ) ); - MPI_CHK( mpi_inv_mod( &ctx->QP, &ctx->Q, &ctx->P ) ); - - ctx->len = ( mpi_msb( &ctx->N ) + 7 ) >> 3; - -cleanup: - - mpi_free( &G, &H, &Q1, &P1, NULL ); - - if( ret != 0 ) - { - rsa_free( ctx ); - return( POLARSSL_ERR_RSA_KEY_GEN_FAILED | ret ); - } - - return( 0 ); -} - -#endif - -/* - * Check a public RSA key - */ -int rsa_check_pubkey( rsa_context *ctx ) -{ - if( ( ctx->N.p[0] & 1 ) == 0 || - ( ctx->E.p[0] & 1 ) == 0 ) - return( POLARSSL_ERR_RSA_KEY_CHECK_FAILED ); - - if( mpi_msb( &ctx->N ) < 128 || - mpi_msb( &ctx->N ) > 4096 ) - return( POLARSSL_ERR_RSA_KEY_CHECK_FAILED ); - - if( mpi_msb( &ctx->E ) < 2 || - mpi_msb( &ctx->E ) > 64 ) - return( POLARSSL_ERR_RSA_KEY_CHECK_FAILED ); - - return( 0 ); -} - -/* - * Check a private RSA key - */ -int rsa_check_privkey( rsa_context *ctx ) -{ - int ret; - mpi PQ, DE, P1, Q1, H, I, G; - - if( ( ret = rsa_check_pubkey( ctx ) ) != 0 ) - return( ret ); - - mpi_init( &PQ, &DE, &P1, &Q1, &H, &I, &G, NULL ); - - MPI_CHK( mpi_mul_mpi( &PQ, &ctx->P, &ctx->Q ) ); - MPI_CHK( mpi_mul_mpi( &DE, &ctx->D, &ctx->E ) ); - MPI_CHK( mpi_sub_int( &P1, &ctx->P, 1 ) ); - MPI_CHK( mpi_sub_int( &Q1, &ctx->Q, 1 ) ); - MPI_CHK( mpi_mul_mpi( &H, &P1, &Q1 ) ); - MPI_CHK( mpi_mod_mpi( &I, &DE, &H ) ); - MPI_CHK( mpi_gcd( &G, &ctx->E, &H ) ); - - if( mpi_cmp_mpi( &PQ, &ctx->N ) == 0 && - mpi_cmp_int( &I, 1 ) == 0 && - mpi_cmp_int( &G, 1 ) == 0 ) - { - mpi_free( &G, &I, &H, &Q1, &P1, &DE, &PQ, NULL ); - return( 0 ); - } - -cleanup: - - mpi_free( &G, &I, &H, &Q1, &P1, &DE, &PQ, NULL ); - return( POLARSSL_ERR_RSA_KEY_CHECK_FAILED | ret ); -} - -/* - * Do an RSA public key operation - */ -int rsa_public( rsa_context *ctx, - unsigned char *input, - unsigned char *output ) -{ - int ret, olen; - mpi T; - - mpi_init( &T, NULL ); - - MPI_CHK( mpi_read_binary( &T, input, ctx->len ) ); - - if( mpi_cmp_mpi( &T, &ctx->N ) >= 0 ) - { - mpi_free( &T, NULL ); - return( POLARSSL_ERR_RSA_BAD_INPUT_DATA ); - } - - olen = ctx->len; - MPI_CHK( mpi_exp_mod( &T, &T, &ctx->E, &ctx->N, &ctx->RN ) ); - MPI_CHK( mpi_write_binary( &T, output, olen ) ); - -cleanup: - - mpi_free( &T, NULL ); - - if( ret != 0 ) - return( POLARSSL_ERR_RSA_PUBLIC_FAILED | ret ); - - return( 0 ); -} - -/* - * Do an RSA private key operation - */ -int rsa_private( rsa_context *ctx, - unsigned char *input, - unsigned char *output ) -{ - int ret, olen; - mpi T, T1, T2; - - mpi_init( &T, &T1, &T2, NULL ); - - MPI_CHK( mpi_read_binary( &T, input, ctx->len ) ); - - if( mpi_cmp_mpi( &T, &ctx->N ) >= 0 ) - { - mpi_free( &T, NULL ); - return( POLARSSL_ERR_RSA_BAD_INPUT_DATA ); - } - -#if 0 - MPI_CHK( mpi_exp_mod( &T, &T, &ctx->D, &ctx->N, &ctx->RN ) ); -#else - /* - * faster decryption using the CRT - * - * T1 = input ^ dP mod P - * T2 = input ^ dQ mod Q - */ - MPI_CHK( mpi_exp_mod( &T1, &T, &ctx->DP, &ctx->P, &ctx->RP ) ); - MPI_CHK( mpi_exp_mod( &T2, &T, &ctx->DQ, &ctx->Q, &ctx->RQ ) ); - - /* - * T = (T1 - T2) * (Q^-1 mod P) mod P - */ - MPI_CHK( mpi_sub_mpi( &T, &T1, &T2 ) ); - MPI_CHK( mpi_mul_mpi( &T1, &T, &ctx->QP ) ); - MPI_CHK( mpi_mod_mpi( &T, &T1, &ctx->P ) ); - - /* - * output = T2 + T * Q - */ - MPI_CHK( mpi_mul_mpi( &T1, &T, &ctx->Q ) ); - MPI_CHK( mpi_add_mpi( &T, &T2, &T1 ) ); -#endif - - olen = ctx->len; - MPI_CHK( mpi_write_binary( &T, output, olen ) ); - -cleanup: - - mpi_free( &T, &T1, &T2, NULL ); - - if( ret != 0 ) - return( POLARSSL_ERR_RSA_PRIVATE_FAILED | ret ); - - return( 0 ); -} - -/* - * Add the message padding, then do an RSA operation - */ -int rsa_pkcs1_encrypt( rsa_context *ctx, - int mode, int ilen, - unsigned char *input, - unsigned char *output ) -{ - int nb_pad, olen; - unsigned char *p = output; - - olen = ctx->len; - - switch( ctx->padding ) - { - case RSA_PKCS_V15: - - if( ilen < 0 || olen < ilen + 11 ) - return( POLARSSL_ERR_RSA_BAD_INPUT_DATA ); - - nb_pad = olen - 3 - ilen; - - *p++ = 0; - *p++ = RSA_CRYPT; - - while( nb_pad-- > 0 ) - { - do { - *p = (unsigned char) rand(); - } while( *p == 0 ); - p++; - } - *p++ = 0; - memcpy( p, input, ilen ); - break; - - default: - - return( POLARSSL_ERR_RSA_INVALID_PADDING ); - } - - return( ( mode == RSA_PUBLIC ) - ? rsa_public( ctx, output, output ) - : rsa_private( ctx, output, output ) ); -} - -/* - * Do an RSA operation, then remove the message padding - */ -int rsa_pkcs1_decrypt( rsa_context *ctx, - int mode, int *olen, - unsigned char *input, - unsigned char *output, - int output_max_len) -{ - int ret, ilen; - unsigned char *p; - unsigned char buf[512]; - - ilen = ctx->len; - - if( ilen < 16 || ilen > (int) sizeof( buf ) ) - return( POLARSSL_ERR_RSA_BAD_INPUT_DATA ); - - ret = ( mode == RSA_PUBLIC ) - ? rsa_public( ctx, input, buf ) - : rsa_private( ctx, input, buf ); - - if( ret != 0 ) - return( ret ); - - p = buf; - - switch( ctx->padding ) - { - case RSA_PKCS_V15: - - if( *p++ != 0 || *p++ != RSA_CRYPT ) - return( POLARSSL_ERR_RSA_INVALID_PADDING ); - - while( *p != 0 ) - { - if( p >= buf + ilen - 1 ) - return( POLARSSL_ERR_RSA_INVALID_PADDING ); - p++; - } - p++; - break; - - default: - - return( POLARSSL_ERR_RSA_INVALID_PADDING ); - } - - if (ilen - (int)(p - buf) > output_max_len) - return( POLARSSL_ERR_RSA_OUTPUT_TO_LARGE ); - - *olen = ilen - (int)(p - buf); - memcpy( output, p, *olen ); - - return( 0 ); -} - -/* - * Do an RSA operation to sign the message digest - */ -int rsa_pkcs1_sign( rsa_context *ctx, - int mode, - int hash_id, - int hashlen, - unsigned char *hash, - unsigned char *sig ) -{ - int nb_pad, olen; - unsigned char *p = sig; - - olen = ctx->len; - - switch( ctx->padding ) - { - case RSA_PKCS_V15: - - switch( hash_id ) - { - case RSA_RAW: - nb_pad = olen - 3 - hashlen; - break; - - case RSA_MD2: - case RSA_MD4: - case RSA_MD5: - nb_pad = olen - 3 - 34; - break; - - case RSA_SHA1: - nb_pad = olen - 3 - 35; - break; - - default: - return( POLARSSL_ERR_RSA_BAD_INPUT_DATA ); - } - - if( nb_pad < 8 ) - return( POLARSSL_ERR_RSA_BAD_INPUT_DATA ); - - *p++ = 0; - *p++ = RSA_SIGN; - memset( p, 0xFF, nb_pad ); - p += nb_pad; - *p++ = 0; - break; - - default: - - return( POLARSSL_ERR_RSA_INVALID_PADDING ); - } - - switch( hash_id ) - { - case RSA_RAW: - memcpy( p, hash, hashlen ); - break; - - case RSA_MD2: - memcpy( p, ASN1_HASH_MDX, 18 ); - memcpy( p + 18, hash, 16 ); - p[13] = 2; break; - - case RSA_MD4: - memcpy( p, ASN1_HASH_MDX, 18 ); - memcpy( p + 18, hash, 16 ); - p[13] = 4; break; - - case RSA_MD5: - memcpy( p, ASN1_HASH_MDX, 18 ); - memcpy( p + 18, hash, 16 ); - p[13] = 5; break; - - case RSA_SHA1: - memcpy( p, ASN1_HASH_SHA1, 15 ); - memcpy( p + 15, hash, 20 ); - break; - - default: - return( POLARSSL_ERR_RSA_BAD_INPUT_DATA ); - } - - return( ( mode == RSA_PUBLIC ) - ? rsa_public( ctx, sig, sig ) - : rsa_private( ctx, sig, sig ) ); -} - -/* - * Do an RSA operation and check the message digest - */ -int rsa_pkcs1_verify( rsa_context *ctx, - int mode, - int hash_id, - int hashlen, - unsigned char *hash, - unsigned char *sig ) -{ - int ret, len, siglen; - unsigned char *p, c; - unsigned char buf[512]; - - siglen = ctx->len; - - if( siglen < 16 || siglen > (int) sizeof( buf ) ) - return( POLARSSL_ERR_RSA_BAD_INPUT_DATA ); - - ret = ( mode == RSA_PUBLIC ) - ? rsa_public( ctx, sig, buf ) - : rsa_private( ctx, sig, buf ); - - if( ret != 0 ) - return( ret ); - - p = buf; - - switch( ctx->padding ) - { - case RSA_PKCS_V15: - - if( *p++ != 0 || *p++ != RSA_SIGN ) - return( POLARSSL_ERR_RSA_INVALID_PADDING ); - - while( *p != 0 ) - { - if( p >= buf + siglen - 1 || *p != 0xFF ) - return( POLARSSL_ERR_RSA_INVALID_PADDING ); - p++; - } - p++; - break; - - default: - - return( POLARSSL_ERR_RSA_INVALID_PADDING ); - } - - len = siglen - (int)( p - buf ); - - if( len == 34 ) - { - c = p[13]; - p[13] = 0; - - if( memcmp( p, ASN1_HASH_MDX, 18 ) != 0 ) - return( POLARSSL_ERR_RSA_VERIFY_FAILED ); - - if( ( c == 2 && hash_id == RSA_MD2 ) || - ( c == 4 && hash_id == RSA_MD4 ) || - ( c == 5 && hash_id == RSA_MD5 ) ) - { - if( memcmp( p + 18, hash, 16 ) == 0 ) - return( 0 ); - else - return( POLARSSL_ERR_RSA_VERIFY_FAILED ); - } - } - - if( len == 35 && hash_id == RSA_SHA1 ) - { - if( memcmp( p, ASN1_HASH_SHA1, 15 ) == 0 && - memcmp( p + 15, hash, 20 ) == 0 ) - return( 0 ); - else - return( POLARSSL_ERR_RSA_VERIFY_FAILED ); - } - - if( len == hashlen && hash_id == RSA_RAW ) - { - if( memcmp( p, hash, hashlen ) == 0 ) - return( 0 ); - else - return( POLARSSL_ERR_RSA_VERIFY_FAILED ); - } - - return( POLARSSL_ERR_RSA_INVALID_PADDING ); -} - -/* - * Free the components of an RSA key - */ -void rsa_free( rsa_context *ctx ) -{ - mpi_free( &ctx->RQ, &ctx->RP, &ctx->RN, - &ctx->QP, &ctx->DQ, &ctx->DP, - &ctx->Q, &ctx->P, &ctx->D, - &ctx->E, &ctx->N, NULL ); -} - -#if defined(POLARSSL_SELF_TEST) - -#include "polarssl/sha1.h" - -/* - * Example RSA-1024 keypair, for test purposes - */ -#define KEY_LEN 128 - -#define RSA_N "9292758453063D803DD603D5E777D788" \ - "8ED1D5BF35786190FA2F23EBC0848AEA" \ - "DDA92CA6C3D80B32C4D109BE0F36D6AE" \ - "7130B9CED7ACDF54CFC7555AC14EEBAB" \ - "93A89813FBF3C4F8066D2D800F7C38A8" \ - "1AE31942917403FF4946B0A83D3D3E05" \ - "EE57C6F5F5606FB5D4BC6CD34EE0801A" \ - "5E94BB77B07507233A0BC7BAC8F90F79" - -#define RSA_E "10001" - -#define RSA_D "24BF6185468786FDD303083D25E64EFC" \ - "66CA472BC44D253102F8B4A9D3BFA750" \ - "91386C0077937FE33FA3252D28855837" \ - "AE1B484A8A9A45F7EE8C0C634F99E8CD" \ - "DF79C5CE07EE72C7F123142198164234" \ - "CABB724CF78B8173B9F880FC86322407" \ - "AF1FEDFDDE2BEB674CA15F3E81A1521E" \ - "071513A1E85B5DFA031F21ECAE91A34D" - -#define RSA_P "C36D0EB7FCD285223CFB5AABA5BDA3D8" \ - "2C01CAD19EA484A87EA4377637E75500" \ - "FCB2005C5C7DD6EC4AC023CDA285D796" \ - "C3D9E75E1EFC42488BB4F1D13AC30A57" - -#define RSA_Q "C000DF51A7C77AE8D7C7370C1FF55B69" \ - "E211C2B9E5DB1ED0BF61D0D9899620F4" \ - "910E4168387E3C30AA1E00C339A79508" \ - "8452DD96A9A5EA5D9DCA68DA636032AF" - -#define RSA_DP "C1ACF567564274FB07A0BBAD5D26E298" \ - "3C94D22288ACD763FD8E5600ED4A702D" \ - "F84198A5F06C2E72236AE490C93F07F8" \ - "3CC559CD27BC2D1CA488811730BB5725" - -#define RSA_DQ "4959CBF6F8FEF750AEE6977C155579C7" \ - "D8AAEA56749EA28623272E4F7D0592AF" \ - "7C1F1313CAC9471B5C523BFE592F517B" \ - "407A1BD76C164B93DA2D32A383E58357" - -#define RSA_QP "9AE7FBC99546432DF71896FC239EADAE" \ - "F38D18D2B2F0E2DD275AA977E2BF4411" \ - "F5A3B2A5D33605AEBBCCBA7FEB9F2D2F" \ - "A74206CEC169D74BF5A8C50D6F48EA08" - -#define PT_LEN 24 -#define RSA_PT "\xAA\xBB\xCC\x03\x02\x01\x00\xFF\xFF\xFF\xFF\xFF" \ - "\x11\x22\x33\x0A\x0B\x0C\xCC\xDD\xDD\xDD\xDD\xDD" - -/* - * Checkup routine - */ -int rsa_self_test( int verbose ) -{ - int len; - rsa_context rsa; - unsigned char sha1sum[20]; - unsigned char rsa_plaintext[PT_LEN]; - unsigned char rsa_decrypted[PT_LEN]; - unsigned char rsa_ciphertext[KEY_LEN]; - - memset( &rsa, 0, sizeof( rsa_context ) ); - - rsa.len = KEY_LEN; - mpi_read_string( &rsa.N , 16, RSA_N ); - mpi_read_string( &rsa.E , 16, RSA_E ); - mpi_read_string( &rsa.D , 16, RSA_D ); - mpi_read_string( &rsa.P , 16, RSA_P ); - mpi_read_string( &rsa.Q , 16, RSA_Q ); - mpi_read_string( &rsa.DP, 16, RSA_DP ); - mpi_read_string( &rsa.DQ, 16, RSA_DQ ); - mpi_read_string( &rsa.QP, 16, RSA_QP ); - - if( verbose != 0 ) - printf( " RSA key validation: " ); - - if( rsa_check_pubkey( &rsa ) != 0 || - rsa_check_privkey( &rsa ) != 0 ) - { - if( verbose != 0 ) - printf( "failed\n" ); - - return( 1 ); - } - - if( verbose != 0 ) - printf( "passed\n PKCS#1 encryption : " ); - - memcpy( rsa_plaintext, RSA_PT, PT_LEN ); - - if( rsa_pkcs1_encrypt( &rsa, RSA_PUBLIC, PT_LEN, - rsa_plaintext, rsa_ciphertext ) != 0 ) - { - if( verbose != 0 ) - printf( "failed\n" ); - - return( 1 ); - } - - if( verbose != 0 ) - printf( "passed\n PKCS#1 decryption : " ); - - if( rsa_pkcs1_decrypt( &rsa, RSA_PRIVATE, &len, - rsa_ciphertext, rsa_decrypted, - sizeof(rsa_decrypted) ) != 0 ) - { - if( verbose != 0 ) - printf( "failed\n" ); - - return( 1 ); - } - - if( memcmp( rsa_decrypted, rsa_plaintext, len ) != 0 ) - { - if( verbose != 0 ) - printf( "failed\n" ); - - return( 1 ); - } - - if( verbose != 0 ) - printf( "passed\n PKCS#1 data sign : " ); - - sha1( rsa_plaintext, PT_LEN, sha1sum ); - - if( rsa_pkcs1_sign( &rsa, RSA_PRIVATE, RSA_SHA1, 20, - sha1sum, rsa_ciphertext ) != 0 ) - { - if( verbose != 0 ) - printf( "failed\n" ); - - return( 1 ); - } - - if( verbose != 0 ) - printf( "passed\n PKCS#1 sig. verify: " ); - - if( rsa_pkcs1_verify( &rsa, RSA_PUBLIC, RSA_SHA1, 20, - sha1sum, rsa_ciphertext ) != 0 ) - { - if( verbose != 0 ) - printf( "failed\n" ); - - return( 1 ); - } - - if( verbose != 0 ) - printf( "passed\n\n" ); - - rsa_free( &rsa ); - - return( 0 ); -} - -#endif - -#endif diff --git a/package/utils/px5g-standalone/src/library/sha1.c b/package/utils/px5g-standalone/src/library/sha1.c deleted file mode 100644 index 54a4416f31..0000000000 --- a/package/utils/px5g-standalone/src/library/sha1.c +++ /dev/null @@ -1,622 +0,0 @@ -/* - * FIPS-180-1 compliant SHA-1 implementation - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the names of PolarSSL or XySSL nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/* - * The SHA-1 standard was published by NIST in 1993. - * - * http://www.itl.nist.gov/fipspubs/fip180-1.htm - */ - -#include "polarssl/config.h" - -#if defined(POLARSSL_SHA1_C) - -#include "polarssl/sha1.h" - -#include -#include - -/* - * 32-bit integer manipulation macros (big endian) - */ -#ifndef GET_ULONG_BE -#define GET_ULONG_BE(n,b,i) \ -{ \ - (n) = ( (unsigned long) (b)[(i) ] << 24 ) \ - | ( (unsigned long) (b)[(i) + 1] << 16 ) \ - | ( (unsigned long) (b)[(i) + 2] << 8 ) \ - | ( (unsigned long) (b)[(i) + 3] ); \ -} -#endif - -#ifndef PUT_ULONG_BE -#define PUT_ULONG_BE(n,b,i) \ -{ \ - (b)[(i) ] = (unsigned char) ( (n) >> 24 ); \ - (b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \ - (b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \ - (b)[(i) + 3] = (unsigned char) ( (n) ); \ -} -#endif - -/* - * SHA-1 context setup - */ -void sha1_starts( sha1_context *ctx ) -{ - ctx->total[0] = 0; - ctx->total[1] = 0; - - ctx->state[0] = 0x67452301; - ctx->state[1] = 0xEFCDAB89; - ctx->state[2] = 0x98BADCFE; - ctx->state[3] = 0x10325476; - ctx->state[4] = 0xC3D2E1F0; -} - -static void sha1_process( sha1_context *ctx, unsigned char data[64] ) -{ - unsigned long temp, W[16], A, B, C, D, E; - - GET_ULONG_BE( W[ 0], data, 0 ); - GET_ULONG_BE( W[ 1], data, 4 ); - GET_ULONG_BE( W[ 2], data, 8 ); - GET_ULONG_BE( W[ 3], data, 12 ); - GET_ULONG_BE( W[ 4], data, 16 ); - GET_ULONG_BE( W[ 5], data, 20 ); - GET_ULONG_BE( W[ 6], data, 24 ); - GET_ULONG_BE( W[ 7], data, 28 ); - GET_ULONG_BE( W[ 8], data, 32 ); - GET_ULONG_BE( W[ 9], data, 36 ); - GET_ULONG_BE( W[10], data, 40 ); - GET_ULONG_BE( W[11], data, 44 ); - GET_ULONG_BE( W[12], data, 48 ); - GET_ULONG_BE( W[13], data, 52 ); - GET_ULONG_BE( W[14], data, 56 ); - GET_ULONG_BE( W[15], data, 60 ); - -#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) - -#define R(t) \ -( \ - temp = W[(t - 3) & 0x0F] ^ W[(t - 8) & 0x0F] ^ \ - W[(t - 14) & 0x0F] ^ W[ t & 0x0F], \ - ( W[t & 0x0F] = S(temp,1) ) \ -) - -#define P(a,b,c,d,e,x) \ -{ \ - e += S(a,5) + F(b,c,d) + K + x; b = S(b,30); \ -} - - A = ctx->state[0]; - B = ctx->state[1]; - C = ctx->state[2]; - D = ctx->state[3]; - E = ctx->state[4]; - -#define F(x,y,z) (z ^ (x & (y ^ z))) -#define K 0x5A827999 - - P( A, B, C, D, E, W[0] ); - P( E, A, B, C, D, W[1] ); - P( D, E, A, B, C, W[2] ); - P( C, D, E, A, B, W[3] ); - P( B, C, D, E, A, W[4] ); - P( A, B, C, D, E, W[5] ); - P( E, A, B, C, D, W[6] ); - P( D, E, A, B, C, W[7] ); - P( C, D, E, A, B, W[8] ); - P( B, C, D, E, A, W[9] ); - P( A, B, C, D, E, W[10] ); - P( E, A, B, C, D, W[11] ); - P( D, E, A, B, C, W[12] ); - P( C, D, E, A, B, W[13] ); - P( B, C, D, E, A, W[14] ); - P( A, B, C, D, E, W[15] ); - P( E, A, B, C, D, R(16) ); - P( D, E, A, B, C, R(17) ); - P( C, D, E, A, B, R(18) ); - P( B, C, D, E, A, R(19) ); - -#undef K -#undef F - -#define F(x,y,z) (x ^ y ^ z) -#define K 0x6ED9EBA1 - - P( A, B, C, D, E, R(20) ); - P( E, A, B, C, D, R(21) ); - P( D, E, A, B, C, R(22) ); - P( C, D, E, A, B, R(23) ); - P( B, C, D, E, A, R(24) ); - P( A, B, C, D, E, R(25) ); - P( E, A, B, C, D, R(26) ); - P( D, E, A, B, C, R(27) ); - P( C, D, E, A, B, R(28) ); - P( B, C, D, E, A, R(29) ); - P( A, B, C, D, E, R(30) ); - P( E, A, B, C, D, R(31) ); - P( D, E, A, B, C, R(32) ); - P( C, D, E, A, B, R(33) ); - P( B, C, D, E, A, R(34) ); - P( A, B, C, D, E, R(35) ); - P( E, A, B, C, D, R(36) ); - P( D, E, A, B, C, R(37) ); - P( C, D, E, A, B, R(38) ); - P( B, C, D, E, A, R(39) ); - -#undef K -#undef F - -#define F(x,y,z) ((x & y) | (z & (x | y))) -#define K 0x8F1BBCDC - - P( A, B, C, D, E, R(40) ); - P( E, A, B, C, D, R(41) ); - P( D, E, A, B, C, R(42) ); - P( C, D, E, A, B, R(43) ); - P( B, C, D, E, A, R(44) ); - P( A, B, C, D, E, R(45) ); - P( E, A, B, C, D, R(46) ); - P( D, E, A, B, C, R(47) ); - P( C, D, E, A, B, R(48) ); - P( B, C, D, E, A, R(49) ); - P( A, B, C, D, E, R(50) ); - P( E, A, B, C, D, R(51) ); - P( D, E, A, B, C, R(52) ); - P( C, D, E, A, B, R(53) ); - P( B, C, D, E, A, R(54) ); - P( A, B, C, D, E, R(55) ); - P( E, A, B, C, D, R(56) ); - P( D, E, A, B, C, R(57) ); - P( C, D, E, A, B, R(58) ); - P( B, C, D, E, A, R(59) ); - -#undef K -#undef F - -#define F(x,y,z) (x ^ y ^ z) -#define K 0xCA62C1D6 - - P( A, B, C, D, E, R(60) ); - P( E, A, B, C, D, R(61) ); - P( D, E, A, B, C, R(62) ); - P( C, D, E, A, B, R(63) ); - P( B, C, D, E, A, R(64) ); - P( A, B, C, D, E, R(65) ); - P( E, A, B, C, D, R(66) ); - P( D, E, A, B, C, R(67) ); - P( C, D, E, A, B, R(68) ); - P( B, C, D, E, A, R(69) ); - P( A, B, C, D, E, R(70) ); - P( E, A, B, C, D, R(71) ); - P( D, E, A, B, C, R(72) ); - P( C, D, E, A, B, R(73) ); - P( B, C, D, E, A, R(74) ); - P( A, B, C, D, E, R(75) ); - P( E, A, B, C, D, R(76) ); - P( D, E, A, B, C, R(77) ); - P( C, D, E, A, B, R(78) ); - P( B, C, D, E, A, R(79) ); - -#undef K -#undef F - - ctx->state[0] += A; - ctx->state[1] += B; - ctx->state[2] += C; - ctx->state[3] += D; - ctx->state[4] += E; -} - -/* - * SHA-1 process buffer - */ -void sha1_update( sha1_context *ctx, unsigned char *input, int ilen ) -{ - int fill; - unsigned long left; - - if( ilen <= 0 ) - return; - - left = ctx->total[0] & 0x3F; - fill = 64 - left; - - ctx->total[0] += ilen; - ctx->total[0] &= 0xFFFFFFFF; - - if( ctx->total[0] < (unsigned long) ilen ) - ctx->total[1]++; - - if( left && ilen >= fill ) - { - memcpy( (void *) (ctx->buffer + left), - (void *) input, fill ); - sha1_process( ctx, ctx->buffer ); - input += fill; - ilen -= fill; - left = 0; - } - - while( ilen >= 64 ) - { - sha1_process( ctx, input ); - input += 64; - ilen -= 64; - } - - if( ilen > 0 ) - { - memcpy( (void *) (ctx->buffer + left), - (void *) input, ilen ); - } -} - -static const unsigned char sha1_padding[64] = -{ - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -/* - * SHA-1 final digest - */ -void sha1_finish( sha1_context *ctx, unsigned char output[20] ) -{ - unsigned long last, padn; - unsigned long high, low; - unsigned char msglen[8]; - - high = ( ctx->total[0] >> 29 ) - | ( ctx->total[1] << 3 ); - low = ( ctx->total[0] << 3 ); - - PUT_ULONG_BE( high, msglen, 0 ); - PUT_ULONG_BE( low, msglen, 4 ); - - last = ctx->total[0] & 0x3F; - padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last ); - - sha1_update( ctx, (unsigned char *) sha1_padding, padn ); - sha1_update( ctx, msglen, 8 ); - - PUT_ULONG_BE( ctx->state[0], output, 0 ); - PUT_ULONG_BE( ctx->state[1], output, 4 ); - PUT_ULONG_BE( ctx->state[2], output, 8 ); - PUT_ULONG_BE( ctx->state[3], output, 12 ); - PUT_ULONG_BE( ctx->state[4], output, 16 ); -} - -/* - * output = SHA-1( input buffer ) - */ -void sha1( unsigned char *input, int ilen, unsigned char output[20] ) -{ - sha1_context ctx; - - sha1_starts( &ctx ); - sha1_update( &ctx, input, ilen ); - sha1_finish( &ctx, output ); - - memset( &ctx, 0, sizeof( sha1_context ) ); -} - -/* - * output = SHA-1( file contents ) - */ -int sha1_file( char *path, unsigned char output[20] ) -{ - FILE *f; - size_t n; - sha1_context ctx; - unsigned char buf[1024]; - - if( ( f = fopen( path, "rb" ) ) == NULL ) - return( 1 ); - - sha1_starts( &ctx ); - - while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 ) - sha1_update( &ctx, buf, (int) n ); - - sha1_finish( &ctx, output ); - - memset( &ctx, 0, sizeof( sha1_context ) ); - - if( ferror( f ) != 0 ) - { - fclose( f ); - return( 2 ); - } - - fclose( f ); - return( 0 ); -} - -/* - * SHA-1 HMAC context setup - */ -void sha1_hmac_starts( sha1_context *ctx, unsigned char *key, int keylen ) -{ - int i; - unsigned char sum[20]; - - if( keylen > 64 ) - { - sha1( key, keylen, sum ); - keylen = 20; - key = sum; - } - - memset( ctx->ipad, 0x36, 64 ); - memset( ctx->opad, 0x5C, 64 ); - - for( i = 0; i < keylen; i++ ) - { - ctx->ipad[i] = (unsigned char)( ctx->ipad[i] ^ key[i] ); - ctx->opad[i] = (unsigned char)( ctx->opad[i] ^ key[i] ); - } - - sha1_starts( ctx ); - sha1_update( ctx, ctx->ipad, 64 ); - - memset( sum, 0, sizeof( sum ) ); -} - -/* - * SHA-1 HMAC process buffer - */ -void sha1_hmac_update( sha1_context *ctx, unsigned char *input, int ilen ) -{ - sha1_update( ctx, input, ilen ); -} - -/* - * SHA-1 HMAC final digest - */ -void sha1_hmac_finish( sha1_context *ctx, unsigned char output[20] ) -{ - unsigned char tmpbuf[20]; - - sha1_finish( ctx, tmpbuf ); - sha1_starts( ctx ); - sha1_update( ctx, ctx->opad, 64 ); - sha1_update( ctx, tmpbuf, 20 ); - sha1_finish( ctx, output ); - - memset( tmpbuf, 0, sizeof( tmpbuf ) ); -} - -/* - * output = HMAC-SHA-1( hmac key, input buffer ) - */ -void sha1_hmac( unsigned char *key, int keylen, - unsigned char *input, int ilen, - unsigned char output[20] ) -{ - sha1_context ctx; - - sha1_hmac_starts( &ctx, key, keylen ); - sha1_hmac_update( &ctx, input, ilen ); - sha1_hmac_finish( &ctx, output ); - - memset( &ctx, 0, sizeof( sha1_context ) ); -} - -#if defined(POLARSSL_SELF_TEST) -/* - * FIPS-180-1 test vectors - */ -static unsigned char sha1_test_buf[3][57] = -{ - { "abc" }, - { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" }, - { "" } -}; - -static const int sha1_test_buflen[3] = -{ - 3, 56, 1000 -}; - -static const unsigned char sha1_test_sum[3][20] = -{ - { 0xA9, 0x99, 0x3E, 0x36, 0x47, 0x06, 0x81, 0x6A, 0xBA, 0x3E, - 0x25, 0x71, 0x78, 0x50, 0xC2, 0x6C, 0x9C, 0xD0, 0xD8, 0x9D }, - { 0x84, 0x98, 0x3E, 0x44, 0x1C, 0x3B, 0xD2, 0x6E, 0xBA, 0xAE, - 0x4A, 0xA1, 0xF9, 0x51, 0x29, 0xE5, 0xE5, 0x46, 0x70, 0xF1 }, - { 0x34, 0xAA, 0x97, 0x3C, 0xD4, 0xC4, 0xDA, 0xA4, 0xF6, 0x1E, - 0xEB, 0x2B, 0xDB, 0xAD, 0x27, 0x31, 0x65, 0x34, 0x01, 0x6F } -}; - -/* - * RFC 2202 test vectors - */ -static unsigned char sha1_hmac_test_key[7][26] = -{ - { "\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B" - "\x0B\x0B\x0B\x0B" }, - { "Jefe" }, - { "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA" - "\xAA\xAA\xAA\xAA" }, - { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10" - "\x11\x12\x13\x14\x15\x16\x17\x18\x19" }, - { "\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C" - "\x0C\x0C\x0C\x0C" }, - { "" }, /* 0xAA 80 times */ - { "" } -}; - -static const int sha1_hmac_test_keylen[7] = -{ - 20, 4, 20, 25, 20, 80, 80 -}; - -static unsigned char sha1_hmac_test_buf[7][74] = -{ - { "Hi There" }, - { "what do ya want for nothing?" }, - { "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" - "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" }, - { "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" - "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" - "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" - "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" - "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" }, - { "Test With Truncation" }, - { "Test Using Larger Than Block-Size Key - Hash Key First" }, - { "Test Using Larger Than Block-Size Key and Larger" - " Than One Block-Size Data" } -}; - -static const int sha1_hmac_test_buflen[7] = -{ - 8, 28, 50, 50, 20, 54, 73 -}; - -static const unsigned char sha1_hmac_test_sum[7][20] = -{ - { 0xB6, 0x17, 0x31, 0x86, 0x55, 0x05, 0x72, 0x64, 0xE2, 0x8B, - 0xC0, 0xB6, 0xFB, 0x37, 0x8C, 0x8E, 0xF1, 0x46, 0xBE, 0x00 }, - { 0xEF, 0xFC, 0xDF, 0x6A, 0xE5, 0xEB, 0x2F, 0xA2, 0xD2, 0x74, - 0x16, 0xD5, 0xF1, 0x84, 0xDF, 0x9C, 0x25, 0x9A, 0x7C, 0x79 }, - { 0x12, 0x5D, 0x73, 0x42, 0xB9, 0xAC, 0x11, 0xCD, 0x91, 0xA3, - 0x9A, 0xF4, 0x8A, 0xA1, 0x7B, 0x4F, 0x63, 0xF1, 0x75, 0xD3 }, - { 0x4C, 0x90, 0x07, 0xF4, 0x02, 0x62, 0x50, 0xC6, 0xBC, 0x84, - 0x14, 0xF9, 0xBF, 0x50, 0xC8, 0x6C, 0x2D, 0x72, 0x35, 0xDA }, - { 0x4C, 0x1A, 0x03, 0x42, 0x4B, 0x55, 0xE0, 0x7F, 0xE7, 0xF2, - 0x7B, 0xE1 }, - { 0xAA, 0x4A, 0xE5, 0xE1, 0x52, 0x72, 0xD0, 0x0E, 0x95, 0x70, - 0x56, 0x37, 0xCE, 0x8A, 0x3B, 0x55, 0xED, 0x40, 0x21, 0x12 }, - { 0xE8, 0xE9, 0x9D, 0x0F, 0x45, 0x23, 0x7D, 0x78, 0x6D, 0x6B, - 0xBA, 0xA7, 0x96, 0x5C, 0x78, 0x08, 0xBB, 0xFF, 0x1A, 0x91 } -}; - -/* - * Checkup routine - */ -int sha1_self_test( int verbose ) -{ - int i, j, buflen; - unsigned char buf[1024]; - unsigned char sha1sum[20]; - sha1_context ctx; - - /* - * SHA-1 - */ - for( i = 0; i < 3; i++ ) - { - if( verbose != 0 ) - printf( " SHA-1 test #%d: ", i + 1 ); - - sha1_starts( &ctx ); - - if( i == 2 ) - { - memset( buf, 'a', buflen = 1000 ); - - for( j = 0; j < 1000; j++ ) - sha1_update( &ctx, buf, buflen ); - } - else - sha1_update( &ctx, sha1_test_buf[i], - sha1_test_buflen[i] ); - - sha1_finish( &ctx, sha1sum ); - - if( memcmp( sha1sum, sha1_test_sum[i], 20 ) != 0 ) - { - if( verbose != 0 ) - printf( "failed\n" ); - - return( 1 ); - } - - if( verbose != 0 ) - printf( "passed\n" ); - } - - if( verbose != 0 ) - printf( "\n" ); - - for( i = 0; i < 7; i++ ) - { - if( verbose != 0 ) - printf( " HMAC-SHA-1 test #%d: ", i + 1 ); - - if( i == 5 || i == 6 ) - { - memset( buf, '\xAA', buflen = 80 ); - sha1_hmac_starts( &ctx, buf, buflen ); - } - else - sha1_hmac_starts( &ctx, sha1_hmac_test_key[i], - sha1_hmac_test_keylen[i] ); - - sha1_hmac_update( &ctx, sha1_hmac_test_buf[i], - sha1_hmac_test_buflen[i] ); - - sha1_hmac_finish( &ctx, sha1sum ); - - buflen = ( i == 4 ) ? 12 : 20; - - if( memcmp( sha1sum, sha1_hmac_test_sum[i], buflen ) != 0 ) - { - if( verbose != 0 ) - printf( "failed\n" ); - - return( 1 ); - } - - if( verbose != 0 ) - printf( "passed\n" ); - } - - if( verbose != 0 ) - printf( "\n" ); - - return( 0 ); -} - -#endif - -#endif diff --git a/package/utils/px5g-standalone/src/library/timing.c b/package/utils/px5g-standalone/src/library/timing.c deleted file mode 100644 index 6b7ab740e1..0000000000 --- a/package/utils/px5g-standalone/src/library/timing.c +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Portable interface to the CPU cycle counter - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the names of PolarSSL or XySSL nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "polarssl/config.h" - -#if defined(POLARSSL_TIMING_C) - -#include "polarssl/timing.h" - -#if defined(WIN32) - -#include -#include - -struct _hr_time -{ - LARGE_INTEGER start; -}; - -#else - -#include -#include -#include -#include -#include - -struct _hr_time -{ - struct timeval start; -}; - -#endif - -#if (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) - -unsigned long hardclock( void ) -{ - unsigned long tsc; - __asm rdtsc - __asm mov [tsc], eax - return( tsc ); -} - -#else -#if defined(__GNUC__) && defined(__i386__) - -unsigned long hardclock( void ) -{ - unsigned long tsc; - asm( "rdtsc" : "=a" (tsc) ); - return( tsc ); -} - -#else -#if defined(__GNUC__) && (defined(__amd64__) || defined(__x86_64__)) - -unsigned long hardclock( void ) -{ - unsigned long lo, hi; - asm( "rdtsc" : "=a" (lo), "=d" (hi) ); - return( lo | (hi << 32) ); -} - -#else -#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) - -unsigned long hardclock( void ) -{ - unsigned long tbl, tbu0, tbu1; - - do - { - asm( "mftbu %0" : "=r" (tbu0) ); - asm( "mftb %0" : "=r" (tbl ) ); - asm( "mftbu %0" : "=r" (tbu1) ); - } - while( tbu0 != tbu1 ); - - return( tbl ); -} - -#else -#if defined(__GNUC__) && defined(__sparc__) - -unsigned long hardclock( void ) -{ - unsigned long tick; - asm( ".byte 0x83, 0x41, 0x00, 0x00" ); - asm( "mov %%g1, %0" : "=r" (tick) ); - return( tick ); -} - -#else -#if defined(__GNUC__) && defined(__alpha__) - -unsigned long hardclock( void ) -{ - unsigned long cc; - asm( "rpcc %0" : "=r" (cc) ); - return( cc & 0xFFFFFFFF ); -} - -#else -#if defined(__GNUC__) && defined(__ia64__) - -unsigned long hardclock( void ) -{ - unsigned long itc; - asm( "mov %0 = ar.itc" : "=r" (itc) ); - return( itc ); -} - -#else - -static int hardclock_init = 0; -static struct timeval tv_init; - -unsigned long hardclock( void ) -{ - struct timeval tv_cur; - - if( hardclock_init == 0 ) - { - gettimeofday( &tv_init, NULL ); - hardclock_init = 1; - } - - gettimeofday( &tv_cur, NULL ); - return( ( tv_cur.tv_sec - tv_init.tv_sec ) * 1000000 - + ( tv_cur.tv_usec - tv_init.tv_usec ) ); -} - -#endif /* generic */ -#endif /* IA-64 */ -#endif /* Alpha */ -#endif /* SPARC8 */ -#endif /* PowerPC */ -#endif /* AMD64 */ -#endif /* i586+ */ - -int alarmed = 0; - -#if defined(WIN32) - -unsigned long get_timer( struct hr_time *val, int reset ) -{ - unsigned long delta; - LARGE_INTEGER offset, hfreq; - struct _hr_time *t = (struct _hr_time *) val; - - QueryPerformanceCounter( &offset ); - QueryPerformanceFrequency( &hfreq ); - - delta = (unsigned long)( ( 1000 * - ( offset.QuadPart - t->start.QuadPart ) ) / - hfreq.QuadPart ); - - if( reset ) - QueryPerformanceCounter( &t->start ); - - return( delta ); -} - -DWORD WINAPI TimerProc( LPVOID uElapse ) -{ - Sleep( (DWORD) uElapse ); - alarmed = 1; - return( TRUE ); -} - -void set_alarm( int seconds ) -{ - DWORD ThreadId; - - alarmed = 0; - CloseHandle( CreateThread( NULL, 0, TimerProc, - (LPVOID) ( seconds * 1000 ), 0, &ThreadId ) ); -} - -void m_sleep( int milliseconds ) -{ - Sleep( milliseconds ); -} - -#else - -unsigned long get_timer( struct hr_time *val, int reset ) -{ - unsigned long delta; - struct timeval offset; - struct _hr_time *t = (struct _hr_time *) val; - - gettimeofday( &offset, NULL ); - - delta = ( offset.tv_sec - t->start.tv_sec ) * 1000 - + ( offset.tv_usec - t->start.tv_usec ) / 1000; - - if( reset ) - { - t->start.tv_sec = offset.tv_sec; - t->start.tv_usec = offset.tv_usec; - } - - return( delta ); -} - -static void sighandler( int signum ) -{ - alarmed = 1; - signal( signum, sighandler ); -} - -void set_alarm( int seconds ) -{ - alarmed = 0; - signal( SIGALRM, sighandler ); - alarm( seconds ); -} - -void m_sleep( int milliseconds ) -{ - struct timeval tv; - - tv.tv_sec = milliseconds / 1000; - tv.tv_usec = milliseconds * 1000; - - select( 0, NULL, NULL, NULL, &tv ); -} - -#endif - -#endif diff --git a/package/utils/px5g-standalone/src/library/x509write.c b/package/utils/px5g-standalone/src/library/x509write.c deleted file mode 100644 index 2b0eb71563..0000000000 --- a/package/utils/px5g-standalone/src/library/x509write.c +++ /dev/null @@ -1,1162 +0,0 @@ -/* - * X.509 certificate and private key writing - * - * Copyright (C) 2006-2007 Pascal Vizeli - * Modifications (C) 2009 Steven Barth - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License, version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301 USA - */ -/* - * The ITU-T X.509 standard defines a certificat format for PKI. - * - * http://www.ietf.org/rfc/rfc2459.txt - * http://www.ietf.org/rfc/rfc3279.txt - * - * ftp://ftp.rsasecurity.com/pub/pkcs/ascii/pkcs-1v2.asc - * - * http://www.itu.int/ITU-T/studygroups/com17/languages/X.680-0207.pdf - * http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf - * - * For CRS: - * http://www.faqs.org/rfcs/rfc2314.html - */ -#include "polarssl/config.h" -#include "polarssl/x509.h" -#include "polarssl/base64.h" -#include "polarssl/sha1.h" - -#include -#include -#include -#include -#include - -#define and && -#define or || - -#if defined _MSC_VER && !defined snprintf -#define snprintf _snprintf -#endif - -static int x509write_realloc_node(x509_node *node, size_t larger); -static int x509write_file(x509_node *node, char *path, int format, const char* pem_prolog, const char* pem_epilog); - -/* - * evaluate how mani octet have this integer - */ -static int asn1_eval_octet(unsigned int digit) -{ - int i, byte; - - for (byte = 4, i = 24; i >= 0; i -= 8, --byte) - if (((digit >> i) & 0xFF) != 0) - return byte; - - return 0; -} - -/* - * write the asn.1 lenght form into p - */ -static int asn1_add_len(unsigned int size, x509_node *node) -{ - if (size > 127) { - - /* long size */ - int byte = asn1_eval_octet(size); - int i = 0; - - *(node->p) = (0x80 | byte) & 0xFF; - ++node->p; - - for (i = byte; i > 0; --i) { - - *(node->p) = (size >> ((i - 1) * 8)) & 0xFF; - ++node->p; - } - - } else { - - /* short size */ - *(node->p) = size & 0xFF; - if (size != 0) - ++node->p; - } - - return 0; -} - -/* - * write a ans.1 object into p - */ -static int asn1_add_obj(unsigned char *value, unsigned int size, int tag, - x509_node *node) -{ - int tl = 2; - - if (tag == ASN1_BIT_STRING) - ++tl; - - if (size > 127) - x509write_realloc_node(node, (size_t) size + tl + - asn1_eval_octet(size)); - else - x509write_realloc_node(node, (size_t) size + tl); - - if (node->data == NULL) - return 1; - - /* tag */ - *(node->p) = tag & 0xFF; - ++node->p; - - /* len */ - if (tag == ASN1_BIT_STRING) { - asn1_add_len((unsigned int) size + 1, node); - *(node->p) = 0x00; - ++node->p; - } else { - asn1_add_len((unsigned int) size, node); - } - - /* value */ - if (size > 0) { - - memcpy(node->p, value, (size_t) size); - if ((node->p += size -1) != node->end) - return POLARSSL_ERR_X509_POINT_ERROR; - } else { - /* make nothing -> NULL */ - } - - return 0; -} - -/* - * write a asn.1 conform integer object - */ -static int asn1_add_int(signed int value, x509_node *node) -{ - signed int i = 0, neg = 1; - unsigned int byte, u_val = 0, tmp_val = 0; - - /* if negate? */ - if (value < 0) { - neg = -1; - u_val = ~value; - } else { - u_val = value; - } - - byte = asn1_eval_octet(u_val); - /* 0 isn't NULL */ - if (byte == 0) - byte = 1; - - /* ASN.1 integer is signed! */ - if (byte < 4 and ((u_val >> ((byte -1) * 8)) & 0xFF) == 0x80) - byte += 1; - - if (x509write_realloc_node(node, (size_t) byte + 2) != 0) - return 1; - - /* tag */ - *(node->p) = ASN1_INTEGER; - ++node->p; - - /* len */ - asn1_add_len(byte, node); - - /* value */ - for (i = byte; i > 0; --i) { - - tmp_val = (u_val >> ((i - 1) * 8)) & 0xFF; - if (neg == 1) - *(node->p) = tmp_val; - else - *(node->p) = ~tmp_val; - - if (i > 1) - ++node->p; - } - - if (node->p != node->end) - return POLARSSL_ERR_X509_POINT_ERROR; - - return 0; -} - -/* - * write a asn.1 conform mpi object - */ -static int asn1_add_mpi(mpi *value, int tag, x509_node *node) -{ - size_t size = (mpi_msb(value) / 8) + 1; - unsigned char *buf; - int buf_len = (int) size, tl = 2; - - if (tag == ASN1_BIT_STRING) - ++tl; - - if (size > 127) - x509write_realloc_node(node, size + (size_t) tl + - asn1_eval_octet((unsigned int)size)); - else - x509write_realloc_node(node, size + (size_t) tl); - - if (node->data == NULL) - return 1; - - buf = (unsigned char*) malloc(size); - if (mpi_write_binary(value, buf, buf_len) != 0) - return POLARSSL_ERR_MPI_BUFFER_TOO_SMALL; - - /* tag */ - *(node->p) = tag & 0xFF; - ++node->p; - - /* len */ - if (tag == ASN1_BIT_STRING) { - asn1_add_len((unsigned int) size + 1, node); - *(node->p) = 0x00; - ++node->p; - } else { - asn1_add_len((unsigned int) size, node); - } - - /* value */ - memcpy(node->p, buf, size); - free(buf); - - if ((node->p += (int) size -1) != node->end) - return POLARSSL_ERR_X509_POINT_ERROR; - - return 0; -} - -/* - * write a node into asn.1 conform object - */ -static int asn1_append_tag(x509_node *node, int tag) -{ - int tl = 2; - - x509_node tmp; - x509write_init_node(&tmp); - - if (tag == ASN1_BIT_STRING) - ++tl; - - if (node->len > 127) - x509write_realloc_node(&tmp, node->len + (size_t) tl + - asn1_eval_octet((unsigned int)node->len)); - else - x509write_realloc_node(&tmp, node->len + (size_t) tl); - - if (tmp.data == NULL) { - x509write_free_node(&tmp); - return 1; - } - - /* tag */ - *(tmp.p) = tag & 0xFF; - ++tmp.p; - - /* len */ - if (tag == ASN1_BIT_STRING) { - asn1_add_len((unsigned int) node->len + 1, &tmp); - *(tmp.p) = 0x00; - ++tmp.p; - } else { - asn1_add_len((unsigned int) node->len, &tmp); - } - - /* value */ - memcpy(tmp.p, node->data, node->len); - - /* good? */ - if ((tmp.p += (int) node->len -1) != tmp.end) { - x509write_free_node(&tmp); - return POLARSSL_ERR_X509_POINT_ERROR; - } - - free(node->data); - node->data = tmp.data; - node->p = tmp.p; - node->end = tmp.end; - node->len = tmp.len; - - return 0; -} - -/* - * write nodes into a asn.1 object - */ -static int asn1_append_nodes(x509_node *node, int tag, int anz, ...) -{ - va_list ap; - size_t size = 0; - x509_node *tmp; - int count; - - va_start(ap, anz); - count = anz; - - while (count--) { - - tmp = va_arg(ap, x509_node*); - if (tmp->data != NULL) - size += tmp->len; - } - - if ( size > 127) { - if (x509write_realloc_node(node, size + (size_t) 2 + - asn1_eval_octet(size)) != 0) - return 1; - } else { - if (x509write_realloc_node(node, size + (size_t) 2) != 0) - return 1; - } - - /* tag */ - *(node->p) = tag & 0xFF; - ++node->p; - - /* len */ - asn1_add_len(size, node); - - /* value */ - va_start(ap, anz); - count = anz; - - while (count--) { - - tmp = va_arg(ap, x509_node*); - if (tmp->data != NULL) { - - memcpy(node->p, tmp->data, tmp->len); - if ((node->p += (int) tmp->len -1) != node->end) - ++node->p; - } - } - - va_end(ap); - return 0; -} - -/* - * write a ASN.1 conform object identifiere include a "tag" - */ -static int asn1_add_oid(x509_node *node, unsigned char *oid, size_t len, - int tag, int tag_val, unsigned char *value, size_t val_len) -{ - int ret; - x509_node tmp; - - x509write_init_node(&tmp); - - /* OBJECT IDENTIFIER */ - if ((ret = asn1_add_obj(oid, len, ASN1_OID, &tmp)) != 0) { - x509write_free_node(&tmp); - return ret; - } - - /* value */ - if ((ret = asn1_add_obj(value, val_len, tag_val, &tmp)) != 0) { - x509write_free_node(&tmp); - return ret; - } - - /* SET/SEQUENCE */ - if ((ret = asn1_append_nodes(node, tag, 1, &tmp)) != 0) { - x509write_free_node(&tmp); - return ret; - } - - x509write_free_node(&tmp); - return 0; -} - -/* - * utcTime UTCTime - */ -static int asn1_add_date_utc(unsigned char *time, x509_node *node) -{ - unsigned char date[13], *sp; - x509_time xtime; - int ret; - - sscanf((char*)time, "%d-%d-%d %d:%d:%d", &xtime.year, &xtime.mon, - &xtime.day, &xtime.hour, &xtime.min, &xtime.sec); - - /* convert to YY */ - if (xtime.year > 2000) - xtime.year -= 2000; - else - xtime.year -= 1900; - - snprintf((char*)date, 13, "%2d%2d%2d%2d%2d%2d", xtime.year, xtime.mon, xtime.day, - xtime.hour, xtime.min, xtime.sec); - - /* replace ' ' to '0' */ - for (sp = date; *sp != '\0'; ++sp) - if (*sp == '\x20') - *sp = '\x30'; - - date[12] = 'Z'; - - if ((ret = asn1_add_obj(date, 13, ASN1_UTC_TIME, node)) != 0) - return ret; - - return 0; -} - -/* - * serialize an rsa key into DER - */ - -int x509write_serialize_key(rsa_context *rsa, x509_node *node) -{ - int ret = 0; - x509write_init_node(node); - - /* vers, n, e, d, p, q, dp, dq, pq */ - if ((ret = asn1_add_int(rsa->ver, node)) != 0) - return ret; - if ((ret = asn1_add_mpi(&rsa->N, ASN1_INTEGER, node)) != 0) - return ret; - if ((ret = asn1_add_mpi(&rsa->E, ASN1_INTEGER, node)) != 0) - return ret; - if ((ret = asn1_add_mpi(&rsa->D, ASN1_INTEGER, node)) != 0) - return ret; - if ((ret = asn1_add_mpi(&rsa->P, ASN1_INTEGER, node)) != 0) - return ret; - if ((ret = asn1_add_mpi(&rsa->Q, ASN1_INTEGER, node)) != 0) - return ret; - if ((ret = asn1_add_mpi(&rsa->DP, ASN1_INTEGER, node)) != 0) - return ret; - if ((ret = asn1_add_mpi(&rsa->DQ, ASN1_INTEGER, node)) != 0) - return ret; - if ((ret = asn1_add_mpi(&rsa->QP, ASN1_INTEGER, node)) != 0) - return ret; - if ((ret = asn1_append_tag(node, ASN1_CONSTRUCTED | ASN1_SEQUENCE)) != 0) - return ret; - - return 0; -} - -/* - * write a der/pem encoded rsa private key into a file - */ -int x509write_keyfile(rsa_context *rsa, char *path, int out_flag) -{ - int ret = 0; - const char key_beg[] = "-----BEGIN RSA PRIVATE KEY-----\n", - key_end[] = "-----END RSA PRIVATE KEY-----\n"; - x509_node node; - - x509write_init_node(&node); - if ((ret = x509write_serialize_key(rsa,&node)) != 0) { - x509write_free_node(&node); - return ret; - } - - ret = x509write_file(&node,path,out_flag,key_beg,key_end); - x509write_free_node(&node); - - return ret; -} - - -/* - * reasize the memory for node - */ -static int x509write_realloc_node(x509_node *node, size_t larger) -{ - /* init len */ - if (node->data == NULL) { - node->len = 0; - node->data = malloc(larger); - if(node->data == NULL) - return 1; - } else { - /* realloc memory */ - if ((node->data = realloc(node->data, node->len + larger)) == NULL) - return 1; - } - - /* init pointer */ - node->p = &node->data[node->len]; - node->len += larger; - node->end = &node->data[node->len -1]; - - return 0; -} - -/* - * init node - */ -void x509write_init_node(x509_node *node) -{ - memset(node, 0, sizeof(x509_node)); -} - -/* - * clean memory - */ -void x509write_free_node(x509_node *node) -{ - if (node->data != NULL) - free(node->data); - node->p = NULL; - node->end = NULL; - node->len = 0; -} - -/* - * write a x509 certificate into file - */ -int x509write_crtfile(x509_raw *chain, unsigned char *path, int out_flag) -{ - const char cer_beg[] = "-----BEGIN CERTIFICATE-----\n", - cer_end[] = "-----END CERTIFICATE-----\n"; - - return x509write_file(&chain->raw, (char*)path, out_flag, cer_beg, cer_end); -} - -/* - * write a x509 certificate into file - */ -int x509write_csrfile(x509_raw *chain, unsigned char *path, int out_flag) -{ - const char cer_beg[] = "-----BEGIN CERTIFICATE REQUEST-----\n", - cer_end[] = "-----END CERTIFICATE REQUEST-----\n"; - - return x509write_file(&chain->raw, (char*)path, out_flag, cer_beg, cer_end); -} - -/* - * write an x509 file - */ -static int x509write_file(x509_node *node, char *path, int format, - const char* pem_prolog, const char* pem_epilog) -{ - FILE *ofstream = stdout; - int is_err = 1, buf_len, i, n; - unsigned char* base_buf; - - if (path) { - if ((ofstream = fopen(path, "wb")) == NULL) - return 1; - } - - switch (format) { - case X509_OUTPUT_DER: - if (fwrite(node->data, 1, node->len, ofstream) - != node->len) - is_err = -1; - break; - - case X509_OUTPUT_PEM: - if (fprintf(ofstream, "%s", pem_prolog)<0) { - is_err = -1; - break; - } - - buf_len = node->len << 1; - base_buf = (unsigned char*) malloc((size_t)buf_len); - memset(base_buf,0,buf_len); - if (base64_encode(base_buf, &buf_len, node->data, - (int) node->len) != 0) { - is_err = -1; - break; - } - - n=strlen((char*)base_buf); - for(i=0;isubpubkey; - - x509write_init_node(&n_tmp); - x509write_init_node(&n_tmp2); - - /* - * RSAPublicKey ::= SEQUENCE { - * modulus INTEGER, -- n - * publicExponent INTEGER -- e - * } - */ - if ((ret = asn1_add_mpi(&pubkey->N, ASN1_INTEGER, &n_tmp)) != 0) { - x509write_free_node(&n_tmp); - x509write_free_node(&n_tmp2); - return ret; - } - if ((ret = asn1_add_mpi(&pubkey->E, ASN1_INTEGER, &n_tmp)) != 0) { - x509write_free_node(&n_tmp); - x509write_free_node(&n_tmp2); - return ret; - } - if ((ret = asn1_append_tag(&n_tmp, ASN1_CONSTRUCTED | ASN1_SEQUENCE)) - != 0) { - x509write_free_node(&n_tmp); - x509write_free_node(&n_tmp2); - return ret; - } - - /* - * SubjectPublicKeyInfo ::= SEQUENCE { - * algorithm AlgorithmIdentifier, - * subjectPublicKey BIT STRING } - */ - if ((ret = asn1_append_tag(&n_tmp, ASN1_BIT_STRING)) != 0) { - x509write_free_node(&n_tmp); - x509write_free_node(&n_tmp2); - return ret; - } - if ((ret = asn1_add_oid(&n_tmp2, (unsigned char*)OID_PKCS1_RSA, 9, - ASN1_CONSTRUCTED | ASN1_SEQUENCE, ASN1_NULL, - (unsigned char *)"", 0)) != 0) { - x509write_free_node(&n_tmp); - x509write_free_node(&n_tmp2); - return ret; - } - - if ((ret = asn1_append_nodes(node, ASN1_CONSTRUCTED | ASN1_SEQUENCE, 2, - &n_tmp2, &n_tmp))) { - x509write_free_node(&n_tmp); - x509write_free_node(&n_tmp2); - return ret; - } - - x509write_free_node(&n_tmp); - x509write_free_node(&n_tmp2); - return 0; -} - -/* - * RelativeDistinguishedName ::= - * SET OF AttributeTypeAndValue - * - * AttributeTypeAndValue ::= SEQUENCE { - * type AttributeType, - * value AttributeValue } - */ -static int x509write_add_name(x509_node *node, unsigned char *oid, - unsigned int oid_len, unsigned char *value, int len, int value_tag) -{ - int ret; - x509_node n_tmp; - - x509write_init_node(&n_tmp); - - if ((ret = asn1_add_oid(&n_tmp, oid, oid_len, - ASN1_CONSTRUCTED | ASN1_SEQUENCE, value_tag, - value, len))) { - x509write_free_node(&n_tmp); - return ret; - } - - if ((asn1_append_nodes(node, ASN1_CONSTRUCTED | ASN1_SET, 1, &n_tmp)) - != 0) { - x509write_free_node(&n_tmp); - return ret; - } - - x509write_free_node(&n_tmp); - return 0; -} - -/* - * Parse the name string and add to node - */ -static int x509write_parse_names(x509_node *node, unsigned char *names) -{ - unsigned char *sp, *begin = NULL; - unsigned char oid[3] = OID_X520, tag[4], *tag_sp = tag; - unsigned char *C = NULL, *CN = NULL, *O = NULL, *OU = NULL, - *ST = NULL, *L = NULL, *R = NULL; - int C_len = 0, CN_len = 0, O_len = 0, OU_len = 0, ST_len = 0, - L_len = 0, R_len = 0; - int ret = 0, is_tag = 1, is_begin = -1, len = 0; - - - for (sp = names; ; ++sp) { - - /* filter tag */ - if (is_tag == 1) { - - if (tag_sp == &tag[3]) - return POLARSSL_ERR_X509_VALUE_TO_LENGTH; - - /* is tag end? */ - if (*sp == '=') { - is_tag = -1; - *tag_sp = '\0'; - is_begin = 1; - /* set len 0 (reset) */ - len = 0; - } else { - /* tag hasn't ' '! */ - if (*sp != ' ') { - *tag_sp = *sp; - ++tag_sp; - } - } - /* filter value */ - } else { - - /* set pointer of value begin */ - if (is_begin == 1) { - begin = sp; - is_begin = -1; - } - - /* is value at end? */ - if (*sp == ';' or *sp == '\0') { - is_tag = 1; - - /* common name */ - if (tag[0] == 'C' and tag[1] == 'N') { - CN = begin; - CN_len = len; - - /* organization */ - } else if (tag[0] == 'O' and tag[1] == '\0') { - O = begin; - O_len = len; - - /* country */ - } else if (tag[0] == 'C' and tag[1] == '\0') { - C = begin; - C_len = len; - - /* organisation unit */ - } else if (tag[0] == 'O' and tag[1] == 'U') { - OU = begin; - OU_len = len; - - /* state */ - } else if (tag[0] == 'S' and tag[1] == 'T') { - ST = begin; - ST_len = len; - - /* locality */ - } else if (tag[0] == 'L' and tag[1] == '\0') { - L = begin; - L_len = len; - - /* email */ - } else if (tag[0] == 'R' and tag[1] == '\0') { - R = begin; - R_len = len; - } - - /* set tag poiner to begin */ - tag_sp = tag; - - /* is at end? */ - if (*sp == '\0' or *(sp +1) == '\0') - break; - } else { - ++len; - } - } - - /* make saver */ - if (*sp == '\0') - break; - } /* end for */ - - /* country */ - if (C != NULL) { - oid[2] = X520_COUNTRY; - if ((ret = x509write_add_name(node, oid, 3, C, C_len, - ASN1_PRINTABLE_STRING)) != 0) - return ret; - } - - /* state */ - if (ST != NULL) { - oid[2] = X520_STATE; - if ((ret = x509write_add_name(node, oid, 3, ST, ST_len, - ASN1_PRINTABLE_STRING)) != 0) - return ret; - } - - /* locality */ - if (L != NULL) { - oid[2] = X520_LOCALITY; - if ((ret = x509write_add_name(node, oid, 3, L, L_len, - ASN1_PRINTABLE_STRING)) != 0) - return ret; - } - - /* organization */ - if (O != NULL) { - oid[2] = X520_ORGANIZATION; - if ((ret = x509write_add_name(node, oid, 3, O, O_len, - ASN1_PRINTABLE_STRING)) != 0) - return ret; - } - - /* organisation unit */ - if (OU != NULL) { - oid[2] = X520_ORG_UNIT; - if ((ret = x509write_add_name(node, oid, 3, OU, OU_len, - ASN1_PRINTABLE_STRING)) != 0) - return ret; - } - - /* common name */ - if (CN != NULL) { - oid[2] = X520_COMMON_NAME; - if ((ret = x509write_add_name(node, oid, 3, CN, CN_len, - ASN1_PRINTABLE_STRING)) != 0) - return ret; - } - - /* email */ - if (R != NULL) { - if ((ret = x509write_add_name(node, (unsigned char*)OID_PKCS9_EMAIL, - 9, R, R_len, ASN1_IA5_STRING)) != 0) - return ret; - } - - if ((asn1_append_tag(node, ASN1_CONSTRUCTED | ASN1_SEQUENCE)) != 0) - return ret; - - return 0; -} - -/* - * Copy raw data from orginal ca to node - */ -static int x509write_copy_from_raw(x509_node *node, x509_buf *raw) -{ - if (x509write_realloc_node(node, raw->len) != 0) - return 1; - - memcpy(node->p, raw->p, (size_t)raw->len); - if ((node->p += raw->len -1) != node->end) - return POLARSSL_ERR_X509_POINT_ERROR; - - return 0; -} - -/* - * Add the issuer - */ - -int x509write_add_issuer(x509_raw *crt, unsigned char *issuer) -{ - return x509write_parse_names(&crt->issuer, issuer); -} - -/* - * Add the subject - */ -int x509write_add_subject(x509_raw *crt, unsigned char *subject) -{ - return x509write_parse_names(&crt->subject, subject); -} - -/* - * Copy issuer line from another cert to issuer - */ -int x509write_copy_issuer(x509_raw *crt, x509_cert *from_crt) -{ - return x509write_copy_from_raw(&crt->issuer, &from_crt->issuer_raw); -} - -/* - * Copy subject line from another cert - */ -int x509write_copy_subject(x509_raw *crt, x509_cert *from_crt) -{ - return x509write_copy_from_raw(&crt->subject, &from_crt->subject_raw); -} - -/* - * Copy subject line form antoher cert into issuer - */ -int x509write_copy_issuer_form_subject(x509_raw *crt, - x509_cert *from_crt) -{ - return x509write_copy_from_raw(&crt->issuer, &from_crt->subject_raw); -} - -/* - * Copy issuer line from another cert into subject - */ -int x509write_copy_subject_from_issuer(x509_raw *crt, - x509_cert * from_crt) -{ - return x509write_copy_from_raw(&crt->subject, &from_crt->issuer_raw); -} - -/* - * Validity ::= SEQUENCE { - * notBefore Time, - * notAfter Time } - * - * Time ::= CHOICE { - * utcTime UTCTime, - * generalTime GeneralizedTime } - */ -/* TODO: No handle GeneralizedTime! */ -int x509write_add_validity(x509_raw *chain, unsigned char *befor, - unsigned char *after) -{ - int ret; - - x509_node *node = &chain->validity; - - /* notBefore */ - if ((ret = asn1_add_date_utc(befor, node)) != 0) - return ret; - - /* notAfter */ - if ((ret = asn1_add_date_utc(after, node)) != 0) - return ret; - - if ((ret = asn1_append_tag(node, ASN1_CONSTRUCTED | ASN1_SEQUENCE)) != 0) - return ret; - - return 0; -} - -/* - * make hash from tbs and sign that with private key - */ -static int x509write_make_sign(x509_raw *chain, rsa_context *privkey) -{ - int ret; - unsigned char hash[20], *sign; - size_t sign_len = (size_t) mpi_size(&privkey->N); - - /* make hash */ - sha1(chain->tbs.data, chain->tbs.len, hash); - - /* create sign */ - sign = (unsigned char *) malloc(sign_len); - if (sign == NULL) - return 1; - - if ((ret = rsa_pkcs1_sign(privkey, RSA_PRIVATE, RSA_SHA1, 20, hash, - sign)) != 0) - return ret; - - if ((ret = asn1_add_obj(sign, sign_len, ASN1_BIT_STRING, - &chain->sign)) != 0) - return ret; - - /* - * AlgorithmIdentifier ::= SEQUENCE { - * algorithm OBJECT IDENTIFIER, - * parameters ANY DEFINED BY algorithm OPTIONAL } - */ - return asn1_add_oid(&chain->signalg, (unsigned char*)OID_PKCS1_RSA_SHA, 9, - ASN1_CONSTRUCTED | ASN1_SEQUENCE, ASN1_NULL, - (unsigned char*)"", 0); -} - -/* - * Create a random serial - */ -static int get_random_serial(void) -{ - int random = 0; - FILE *fd; - - fd = fopen("/dev/urandom", "r"); - - if (fd) { - if (fread(&random, 1, sizeof(random), fd) != sizeof(random)) - random = 0; - - fclose(fd); - } - - return random; -} - -/* - * Create a self signed certificate - */ -int x509write_create_sign(x509_raw *chain, rsa_context *privkey) -{ - int ret, serial; - - /* - * Version ::= INTEGER { v1(0), v2(1), v3(2) } - */ - if ((ret = asn1_add_int(2, &chain->version)) != 0) - return ret; - - if ((ret = asn1_append_tag(&chain->version, ASN1_CONTEXT_SPECIFIC | - ASN1_CONSTRUCTED)) != 0) - return ret; - - - /* - * CertificateSerialNumber ::= INTEGER - */ - serial = get_random_serial(); - - if (serial == 0) - return 1; - - if ((ret = asn1_add_int(serial, &chain->serial)) != 0) - return ret; - - /* - * AlgorithmIdentifier ::= SEQUENCE { - * algorithm OBJECT IDENTIFIER, - * parameters ANY DEFINED BY algorithm OPTIONAL } - */ - if ((ret = asn1_add_oid(&chain->tbs_signalg, - (unsigned char*)OID_PKCS1_RSA_SHA, 9, ASN1_CONSTRUCTED | - ASN1_SEQUENCE, ASN1_NULL, (unsigned char*)"", 0)) != 0) - return ret; - - /* - * Create the tbs - */ - if ((ret = asn1_append_nodes(&chain->tbs, ASN1_CONSTRUCTED | - ASN1_SEQUENCE, 7, &chain->version, &chain->serial, - &chain->tbs_signalg, &chain->issuer, &chain->validity, - &chain->subject, &chain->subpubkey)) != 0) - return ret; - - /* make signing */ - if ((ret = x509write_make_sign(chain, privkey)) != 0) - return ret; - - /* finishing */ - if ((ret = asn1_append_nodes(&chain->raw, ASN1_CONSTRUCTED | - ASN1_SEQUENCE, 3, &chain->tbs, &chain->signalg, - &chain->sign)) != 0) - return ret; - - return 0; -} - -int x509write_create_selfsign(x509_raw *chain, rsa_context *privkey) -{ - /* - * On self signed certificate are subject and issuer the same - */ - x509write_free_node(&chain->issuer); - chain->issuer = chain->subject; - return x509write_create_sign(chain, privkey); -} - -/* - * CertificationRequestInfo ::= SEQUENCE { - * version Version, - * subject Name, - * subjectPublicKeyInfo SubjectPublicKeyInfo, - * attributes [0] IMPLICIT Attributes } - * - * CertificationRequest ::= SEQUENCE { - * certificationRequestInfo CertificationRequestInfo, - * signatureAlgorithm SignatureAlgorithmIdentifier, - * signature Signature } - * - * It use chain.serail for attributes! - * - */ -int x509write_create_csr(x509_raw *chain, rsa_context *privkey) -{ - int ret; - - /* version ::= INTEGER */ - if ((ret = asn1_add_int(0, &chain->version)) != 0) - return ret; - - /* write attributes */ - if ((ret = asn1_add_obj((unsigned char*)"", 0, ASN1_CONTEXT_SPECIFIC | - ASN1_CONSTRUCTED, &chain->serial)) != 0) - return ret; - - /* create CertificationRequestInfo */ - if ((ret = asn1_append_nodes(&chain->tbs, ASN1_CONSTRUCTED | - ASN1_SEQUENCE, 4, &chain->version, &chain->subject, - &chain->subpubkey, &chain->serial)) != 0) - return ret; - - /* make signing */ - if ((ret = x509write_make_sign(chain, privkey)) != 0) - return ret; - - /* finish */ - if ((ret = asn1_append_nodes(&chain->raw, ASN1_CONSTRUCTED | ASN1_SEQUENCE, - 3, &chain->tbs, &chain->signalg, &chain->sign)) != 0) - return ret; - - return ret; -} - -/* - * Free memory - */ -void x509write_free_raw(x509_raw *chain) -{ - x509write_free_node(&chain->raw); - x509write_free_node(&chain->tbs); - x509write_free_node(&chain->version); - x509write_free_node(&chain->serial); - x509write_free_node(&chain->tbs_signalg); - x509write_free_node(&chain->issuer); - x509write_free_node(&chain->validity); - if (chain->subject.data != chain->issuer.data) - x509write_free_node(&chain->subject); - x509write_free_node(&chain->subpubkey); - x509write_free_node(&chain->signalg); - x509write_free_node(&chain->sign); -} - -void x509write_init_raw(x509_raw *chain) -{ - memset((void *) chain, 0, sizeof(x509_raw)); -} - diff --git a/package/utils/px5g-standalone/src/polarssl/base64.h b/package/utils/px5g-standalone/src/polarssl/base64.h deleted file mode 100644 index c48267b1b5..0000000000 --- a/package/utils/px5g-standalone/src/polarssl/base64.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - * \file base64.h - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the names of PolarSSL or XySSL nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef POLARSSL_BASE64_H -#define POLARSSL_BASE64_H - -#define POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL -0x0010 -#define POLARSSL_ERR_BASE64_INVALID_CHARACTER -0x0012 - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Encode a buffer into base64 format - * - * \param dst destination buffer - * \param dlen size of the buffer - * \param src source buffer - * \param slen amount of data to be encoded - * - * \return 0 if successful, or POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL. - * *dlen is always updated to reflect the amount - * of data that has (or would have) been written. - * - * \note Call this function with *dlen = 0 to obtain the - * required buffer size in *dlen - */ -int base64_encode( unsigned char *dst, int *dlen, - unsigned char *src, int slen ); - -/** - * \brief Decode a base64-formatted buffer - * - * \param dst destination buffer - * \param dlen size of the buffer - * \param src source buffer - * \param slen amount of data to be decoded - * - * \return 0 if successful, POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL, or - * POLARSSL_ERR_BASE64_INVALID_DATA if the input data is not - * correct. *dlen is always updated to reflect the amount - * of data that has (or would have) been written. - * - * \note Call this function with *dlen = 0 to obtain the - * required buffer size in *dlen - */ -int base64_decode( unsigned char *dst, int *dlen, - unsigned char *src, int slen ); - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int base64_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* base64.h */ diff --git a/package/utils/px5g-standalone/src/polarssl/bignum.h b/package/utils/px5g-standalone/src/polarssl/bignum.h deleted file mode 100644 index c667303329..0000000000 --- a/package/utils/px5g-standalone/src/polarssl/bignum.h +++ /dev/null @@ -1,437 +0,0 @@ -/** - * \file bignum.h - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the names of PolarSSL or XySSL nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef POLARSSL_BIGNUM_H -#define POLARSSL_BIGNUM_H - -#include - -#define POLARSSL_ERR_MPI_FILE_IO_ERROR -0x0002 -#define POLARSSL_ERR_MPI_BAD_INPUT_DATA -0x0004 -#define POLARSSL_ERR_MPI_INVALID_CHARACTER -0x0006 -#define POLARSSL_ERR_MPI_BUFFER_TOO_SMALL -0x0008 -#define POLARSSL_ERR_MPI_NEGATIVE_VALUE -0x000A -#define POLARSSL_ERR_MPI_DIVISION_BY_ZERO -0x000C -#define POLARSSL_ERR_MPI_NOT_ACCEPTABLE -0x000E - -#define MPI_CHK(f) if( ( ret = f ) != 0 ) goto cleanup - -/* - * Define the base integer type, architecture-wise - */ -#if defined(POLARSSL_HAVE_INT8) -typedef unsigned char t_int; -typedef unsigned short t_dbl; -#else -#if defined(POLARSSL_HAVE_INT16) -typedef unsigned short t_int; -typedef unsigned long t_dbl; -#else - typedef unsigned long t_int; - #if defined(_MSC_VER) && defined(_M_IX86) - typedef unsigned __int64 t_dbl; - #else - #if defined(__amd64__) || defined(__x86_64__) || \ - defined(__ppc64__) || defined(__powerpc64__) || \ - defined(__ia64__) || defined(__alpha__) - typedef unsigned int t_dbl __attribute__((mode(TI))); - #else - typedef unsigned long long t_dbl; - #endif - #endif -#endif -#endif - -/** - * \brief MPI structure - */ -typedef struct -{ - int s; /*!< integer sign */ - int n; /*!< total # of limbs */ - t_int *p; /*!< pointer to limbs */ -} -mpi; - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Initialize one or more mpi - */ -void mpi_init( mpi *X, ... ); - -/** - * \brief Unallocate one or more mpi - */ -void mpi_free( mpi *X, ... ); - -/** - * \brief Enlarge to the specified number of limbs - * - * \return 0 if successful, - * 1 if memory allocation failed - */ -int mpi_grow( mpi *X, int nblimbs ); - -/** - * \brief Copy the contents of Y into X - * - * \return 0 if successful, - * 1 if memory allocation failed - */ -int mpi_copy( mpi *X, mpi *Y ); - -/** - * \brief Swap the contents of X and Y - */ -void mpi_swap( mpi *X, mpi *Y ); - -/** - * \brief Set value from integer - * - * \return 0 if successful, - * 1 if memory allocation failed - */ -int mpi_lset( mpi *X, int z ); - -/** - * \brief Return the number of least significant bits - */ -int mpi_lsb( mpi *X ); - -/** - * \brief Return the number of most significant bits - */ -int mpi_msb( mpi *X ); - -/** - * \brief Return the total size in bytes - */ -int mpi_size( mpi *X ); - -/** - * \brief Import from an ASCII string - * - * \param X destination mpi - * \param radix input numeric base - * \param s null-terminated string buffer - * - * \return 0 if successful, or an POLARSSL_ERR_MPI_XXX error code - */ -int mpi_read_string( mpi *X, int radix, char *s ); - -/** - * \brief Export into an ASCII string - * - * \param X source mpi - * \param radix output numeric base - * \param s string buffer - * \param slen string buffer size - * - * \return 0 if successful, or an POLARSSL_ERR_MPI_XXX error code - * - * \note Call this function with *slen = 0 to obtain the - * minimum required buffer size in *slen. - */ -int mpi_write_string( mpi *X, int radix, char *s, int *slen ); - -/** - * \brief Read X from an opened file - * - * \param X destination mpi - * \param radix input numeric base - * \param fin input file handle - * - * \return 0 if successful, or an POLARSSL_ERR_MPI_XXX error code - */ -int mpi_read_file( mpi *X, int radix, FILE *fin ); - -/** - * \brief Write X into an opened file, or stdout - * - * \param p prefix, can be NULL - * \param X source mpi - * \param radix output numeric base - * \param fout output file handle - * - * \return 0 if successful, or an POLARSSL_ERR_MPI_XXX error code - * - * \note Set fout == NULL to print X on the console. - */ -int mpi_write_file( char *p, mpi *X, int radix, FILE *fout ); - -/** - * \brief Import X from unsigned binary data, big endian - * - * \param X destination mpi - * \param buf input buffer - * \param buflen input buffer size - * - * \return 0 if successful, - * 1 if memory allocation failed - */ -int mpi_read_binary( mpi *X, unsigned char *buf, int buflen ); - -/** - * \brief Export X into unsigned binary data, big endian - * - * \param X source mpi - * \param buf output buffer - * \param buflen output buffer size - * - * \return 0 if successful, - * POLARSSL_ERR_MPI_BUFFER_TOO_SMALL if buf isn't large enough - * - * \note Call this function with *buflen = 0 to obtain the - * minimum required buffer size in *buflen. - */ -int mpi_write_binary( mpi *X, unsigned char *buf, int buflen ); - -/** - * \brief Left-shift: X <<= count - * - * \return 0 if successful, - * 1 if memory allocation failed - */ -int mpi_shift_l( mpi *X, int count ); - -/** - * \brief Right-shift: X >>= count - * - * \return 0 if successful, - * 1 if memory allocation failed - */ -int mpi_shift_r( mpi *X, int count ); - -/** - * \brief Compare unsigned values - * - * \return 1 if |X| is greater than |Y|, - * -1 if |X| is lesser than |Y| or - * 0 if |X| is equal to |Y| - */ -int mpi_cmp_abs( mpi *X, mpi *Y ); - -/** - * \brief Compare signed values - * - * \return 1 if X is greater than Y, - * -1 if X is lesser than Y or - * 0 if X is equal to Y - */ -int mpi_cmp_mpi( mpi *X, mpi *Y ); - -/** - * \brief Compare signed values - * - * \return 1 if X is greater than z, - * -1 if X is lesser than z or - * 0 if X is equal to z - */ -int mpi_cmp_int( mpi *X, int z ); - -/** - * \brief Unsigned addition: X = |A| + |B| - * - * \return 0 if successful, - * 1 if memory allocation failed - */ -int mpi_add_abs( mpi *X, mpi *A, mpi *B ); - -/** - * \brief Unsigned substraction: X = |A| - |B| - * - * \return 0 if successful, - * POLARSSL_ERR_MPI_NEGATIVE_VALUE if B is greater than A - */ -int mpi_sub_abs( mpi *X, mpi *A, mpi *B ); - -/** - * \brief Signed addition: X = A + B - * - * \return 0 if successful, - * 1 if memory allocation failed - */ -int mpi_add_mpi( mpi *X, mpi *A, mpi *B ); - -/** - * \brief Signed substraction: X = A - B - * - * \return 0 if successful, - * 1 if memory allocation failed - */ -int mpi_sub_mpi( mpi *X, mpi *A, mpi *B ); - -/** - * \brief Signed addition: X = A + b - * - * \return 0 if successful, - * 1 if memory allocation failed - */ -int mpi_add_int( mpi *X, mpi *A, int b ); - -/** - * \brief Signed substraction: X = A - b - * - * \return 0 if successful, - * 1 if memory allocation failed - */ -int mpi_sub_int( mpi *X, mpi *A, int b ); - -/** - * \brief Baseline multiplication: X = A * B - * - * \return 0 if successful, - * 1 if memory allocation failed - */ -int mpi_mul_mpi( mpi *X, mpi *A, mpi *B ); - -/** - * \brief Baseline multiplication: X = A * b - * - * \return 0 if successful, - * 1 if memory allocation failed - */ -int mpi_mul_int( mpi *X, mpi *A, t_int b ); - -/** - * \brief Division by mpi: A = Q * B + R - * - * \return 0 if successful, - * 1 if memory allocation failed, - * POLARSSL_ERR_MPI_DIVISION_BY_ZERO if B == 0 - * - * \note Either Q or R can be NULL. - */ -int mpi_div_mpi( mpi *Q, mpi *R, mpi *A, mpi *B ); - -/** - * \brief Division by int: A = Q * b + R - * - * \return 0 if successful, - * 1 if memory allocation failed, - * POLARSSL_ERR_MPI_DIVISION_BY_ZERO if b == 0 - * - * \note Either Q or R can be NULL. - */ -int mpi_div_int( mpi *Q, mpi *R, mpi *A, int b ); - -/** - * \brief Modulo: R = A mod B - * - * \return 0 if successful, - * 1 if memory allocation failed, - * POLARSSL_ERR_MPI_DIVISION_BY_ZERO if B == 0 - */ -int mpi_mod_mpi( mpi *R, mpi *A, mpi *B ); - -/** - * \brief Modulo: r = A mod b - * - * \return 0 if successful, - * 1 if memory allocation failed, - * POLARSSL_ERR_MPI_DIVISION_BY_ZERO if b == 0 - */ -int mpi_mod_int( t_int *r, mpi *A, int b ); - -/** - * \brief Sliding-window exponentiation: X = A^E mod N - * - * \return 0 if successful, - * 1 if memory allocation failed, - * POLARSSL_ERR_MPI_BAD_INPUT_DATA if N is negative or even - * - * \note _RR is used to avoid re-computing R*R mod N across - * multiple calls, which speeds up things a bit. It can - * be set to NULL if the extra performance is unneeded. - */ -int mpi_exp_mod( mpi *X, mpi *A, mpi *E, mpi *N, mpi *_RR ); - -/** - * \brief Greatest common divisor: G = gcd(A, B) - * - * \return 0 if successful, - * 1 if memory allocation failed - */ -int mpi_gcd( mpi *G, mpi *A, mpi *B ); - -/** - * \brief Modular inverse: X = A^-1 mod N - * - * \return 0 if successful, - * 1 if memory allocation failed, - * POLARSSL_ERR_MPI_BAD_INPUT_DATA if N is negative or nil - * POLARSSL_ERR_MPI_NOT_ACCEPTABLE if A has no inverse mod N - */ -int mpi_inv_mod( mpi *X, mpi *A, mpi *N ); - -/** - * \brief Miller-Rabin primality test - * - * \return 0 if successful (probably prime), - * 1 if memory allocation failed, - * POLARSSL_ERR_MPI_NOT_ACCEPTABLE if X is not prime - */ -int mpi_is_prime( mpi *X, int (*f_rng)(void *), void *p_rng ); - -/** - * \brief Prime number generation - * - * \param X destination mpi - * \param nbits required size of X in bits - * \param dh_flag if 1, then (X-1)/2 will be prime too - * \param f_rng RNG function - * \param p_rng RNG parameter - * - * \return 0 if successful (probably prime), - * 1 if memory allocation failed, - * POLARSSL_ERR_MPI_BAD_INPUT_DATA if nbits is < 3 - */ -int mpi_gen_prime( mpi *X, int nbits, int dh_flag, - int (*f_rng)(void *), void *p_rng ); - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mpi_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* bignum.h */ diff --git a/package/utils/px5g-standalone/src/polarssl/bn_mul.h b/package/utils/px5g-standalone/src/polarssl/bn_mul.h deleted file mode 100644 index f6d34da58a..0000000000 --- a/package/utils/px5g-standalone/src/polarssl/bn_mul.h +++ /dev/null @@ -1,731 +0,0 @@ -/** - * \file bn_mul.h - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the names of PolarSSL or XySSL nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/* - * Multiply source vector [s] with b, add result - * to destination vector [d] and set carry c. - * - * Currently supports: - * - * . IA-32 (386+) . AMD64 / EM64T - * . IA-32 (SSE2) . Motorola 68000 - * . PowerPC, 32-bit . MicroBlaze - * . PowerPC, 64-bit . TriCore - * . SPARC v8 . ARM v3+ - * . Alpha . MIPS32 - * . C, longlong . C, generic - */ -#ifndef POLARSSL_BN_MUL_H -#define POLARSSL_BN_MUL_H - -#include "polarssl/config.h" - -#if defined(POLARSSL_HAVE_ASM) - -#if defined(__GNUC__) -#if defined(__i386__) - -#define MULADDC_INIT \ - asm( "movl %%ebx, %0 " : "=m" (t)); \ - asm( "movl %0, %%esi " :: "m" (s)); \ - asm( "movl %0, %%edi " :: "m" (d)); \ - asm( "movl %0, %%ecx " :: "m" (c)); \ - asm( "movl %0, %%ebx " :: "m" (b)); - -#define MULADDC_CORE \ - asm( "lodsl " ); \ - asm( "mull %ebx " ); \ - asm( "addl %ecx, %eax " ); \ - asm( "adcl $0, %edx " ); \ - asm( "addl (%edi), %eax " ); \ - asm( "adcl $0, %edx " ); \ - asm( "movl %edx, %ecx " ); \ - asm( "stosl " ); - -#if defined(POLARSSL_HAVE_SSE2) - -#define MULADDC_HUIT \ - asm( "movd %ecx, %mm1 " ); \ - asm( "movd %ebx, %mm0 " ); \ - asm( "movd (%edi), %mm3 " ); \ - asm( "paddq %mm3, %mm1 " ); \ - asm( "movd (%esi), %mm2 " ); \ - asm( "pmuludq %mm0, %mm2 " ); \ - asm( "movd 4(%esi), %mm4 " ); \ - asm( "pmuludq %mm0, %mm4 " ); \ - asm( "movd 8(%esi), %mm6 " ); \ - asm( "pmuludq %mm0, %mm6 " ); \ - asm( "movd 12(%esi), %mm7 " ); \ - asm( "pmuludq %mm0, %mm7 " ); \ - asm( "paddq %mm2, %mm1 " ); \ - asm( "movd 4(%edi), %mm3 " ); \ - asm( "paddq %mm4, %mm3 " ); \ - asm( "movd 8(%edi), %mm5 " ); \ - asm( "paddq %mm6, %mm5 " ); \ - asm( "movd 12(%edi), %mm4 " ); \ - asm( "paddq %mm4, %mm7 " ); \ - asm( "movd %mm1, (%edi) " ); \ - asm( "movd 16(%esi), %mm2 " ); \ - asm( "pmuludq %mm0, %mm2 " ); \ - asm( "psrlq $32, %mm1 " ); \ - asm( "movd 20(%esi), %mm4 " ); \ - asm( "pmuludq %mm0, %mm4 " ); \ - asm( "paddq %mm3, %mm1 " ); \ - asm( "movd 24(%esi), %mm6 " ); \ - asm( "pmuludq %mm0, %mm6 " ); \ - asm( "movd %mm1, 4(%edi) " ); \ - asm( "psrlq $32, %mm1 " ); \ - asm( "movd 28(%esi), %mm3 " ); \ - asm( "pmuludq %mm0, %mm3 " ); \ - asm( "paddq %mm5, %mm1 " ); \ - asm( "movd 16(%edi), %mm5 " ); \ - asm( "paddq %mm5, %mm2 " ); \ - asm( "movd %mm1, 8(%edi) " ); \ - asm( "psrlq $32, %mm1 " ); \ - asm( "paddq %mm7, %mm1 " ); \ - asm( "movd 20(%edi), %mm5 " ); \ - asm( "paddq %mm5, %mm4 " ); \ - asm( "movd %mm1, 12(%edi) " ); \ - asm( "psrlq $32, %mm1 " ); \ - asm( "paddq %mm2, %mm1 " ); \ - asm( "movd 24(%edi), %mm5 " ); \ - asm( "paddq %mm5, %mm6 " ); \ - asm( "movd %mm1, 16(%edi) " ); \ - asm( "psrlq $32, %mm1 " ); \ - asm( "paddq %mm4, %mm1 " ); \ - asm( "movd 28(%edi), %mm5 " ); \ - asm( "paddq %mm5, %mm3 " ); \ - asm( "movd %mm1, 20(%edi) " ); \ - asm( "psrlq $32, %mm1 " ); \ - asm( "paddq %mm6, %mm1 " ); \ - asm( "movd %mm1, 24(%edi) " ); \ - asm( "psrlq $32, %mm1 " ); \ - asm( "paddq %mm3, %mm1 " ); \ - asm( "movd %mm1, 28(%edi) " ); \ - asm( "addl $32, %edi " ); \ - asm( "addl $32, %esi " ); \ - asm( "psrlq $32, %mm1 " ); \ - asm( "movd %mm1, %ecx " ); - -#define MULADDC_STOP \ - asm( "emms " ); \ - asm( "movl %0, %%ebx " :: "m" (t)); \ - asm( "movl %%ecx, %0 " : "=m" (c)); \ - asm( "movl %%edi, %0 " : "=m" (d)); \ - asm( "movl %%esi, %0 " : "=m" (s) :: \ - "eax", "ecx", "edx", "esi", "edi" ); - -#else - -#define MULADDC_STOP \ - asm( "movl %0, %%ebx " :: "m" (t)); \ - asm( "movl %%ecx, %0 " : "=m" (c)); \ - asm( "movl %%edi, %0 " : "=m" (d)); \ - asm( "movl %%esi, %0 " : "=m" (s) :: \ - "eax", "ecx", "edx", "esi", "edi" ); - -#endif /* SSE2 */ -#endif /* i386 */ - -#if defined(__amd64__) || defined (__x86_64__) - -#define MULADDC_INIT \ - asm( "movq %0, %%rsi " :: "m" (s)); \ - asm( "movq %0, %%rdi " :: "m" (d)); \ - asm( "movq %0, %%rcx " :: "m" (c)); \ - asm( "movq %0, %%rbx " :: "m" (b)); \ - asm( "xorq %r8, %r8 " ); - -#define MULADDC_CORE \ - asm( "movq (%rsi),%rax " ); \ - asm( "mulq %rbx " ); \ - asm( "addq $8, %rsi " ); \ - asm( "addq %rcx, %rax " ); \ - asm( "movq %r8, %rcx " ); \ - asm( "adcq $0, %rdx " ); \ - asm( "nop " ); \ - asm( "addq %rax, (%rdi) " ); \ - asm( "adcq %rdx, %rcx " ); \ - asm( "addq $8, %rdi " ); - -#define MULADDC_STOP \ - asm( "movq %%rcx, %0 " : "=m" (c)); \ - asm( "movq %%rdi, %0 " : "=m" (d)); \ - asm( "movq %%rsi, %0 " : "=m" (s) :: \ - "rax", "rcx", "rdx", "rbx", "rsi", "rdi", "r8" ); - -#endif /* AMD64 */ - -#if defined(__mc68020__) || defined(__mcpu32__) - -#define MULADDC_INIT \ - asm( "movl %0, %%a2 " :: "m" (s)); \ - asm( "movl %0, %%a3 " :: "m" (d)); \ - asm( "movl %0, %%d3 " :: "m" (c)); \ - asm( "movl %0, %%d2 " :: "m" (b)); \ - asm( "moveq #0, %d0 " ); - -#define MULADDC_CORE \ - asm( "movel %a2@+, %d1 " ); \ - asm( "mulul %d2, %d4:%d1 " ); \ - asm( "addl %d3, %d1 " ); \ - asm( "addxl %d0, %d4 " ); \ - asm( "moveq #0, %d3 " ); \ - asm( "addl %d1, %a3@+ " ); \ - asm( "addxl %d4, %d3 " ); - -#define MULADDC_STOP \ - asm( "movl %%d3, %0 " : "=m" (c)); \ - asm( "movl %%a3, %0 " : "=m" (d)); \ - asm( "movl %%a2, %0 " : "=m" (s) :: \ - "d0", "d1", "d2", "d3", "d4", "a2", "a3" ); - -#define MULADDC_HUIT \ - asm( "movel %a2@+, %d1 " ); \ - asm( "mulul %d2, %d4:%d1 " ); \ - asm( "addxl %d3, %d1 " ); \ - asm( "addxl %d0, %d4 " ); \ - asm( "addl %d1, %a3@+ " ); \ - asm( "movel %a2@+, %d1 " ); \ - asm( "mulul %d2, %d3:%d1 " ); \ - asm( "addxl %d4, %d1 " ); \ - asm( "addxl %d0, %d3 " ); \ - asm( "addl %d1, %a3@+ " ); \ - asm( "movel %a2@+, %d1 " ); \ - asm( "mulul %d2, %d4:%d1 " ); \ - asm( "addxl %d3, %d1 " ); \ - asm( "addxl %d0, %d4 " ); \ - asm( "addl %d1, %a3@+ " ); \ - asm( "movel %a2@+, %d1 " ); \ - asm( "mulul %d2, %d3:%d1 " ); \ - asm( "addxl %d4, %d1 " ); \ - asm( "addxl %d0, %d3 " ); \ - asm( "addl %d1, %a3@+ " ); \ - asm( "movel %a2@+, %d1 " ); \ - asm( "mulul %d2, %d4:%d1 " ); \ - asm( "addxl %d3, %d1 " ); \ - asm( "addxl %d0, %d4 " ); \ - asm( "addl %d1, %a3@+ " ); \ - asm( "movel %a2@+, %d1 " ); \ - asm( "mulul %d2, %d3:%d1 " ); \ - asm( "addxl %d4, %d1 " ); \ - asm( "addxl %d0, %d3 " ); \ - asm( "addl %d1, %a3@+ " ); \ - asm( "movel %a2@+, %d1 " ); \ - asm( "mulul %d2, %d4:%d1 " ); \ - asm( "addxl %d3, %d1 " ); \ - asm( "addxl %d0, %d4 " ); \ - asm( "addl %d1, %a3@+ " ); \ - asm( "movel %a2@+, %d1 " ); \ - asm( "mulul %d2, %d3:%d1 " ); \ - asm( "addxl %d4, %d1 " ); \ - asm( "addxl %d0, %d3 " ); \ - asm( "addl %d1, %a3@+ " ); \ - asm( "addxl %d0, %d3 " ); - -#endif /* MC68000 */ - -#if defined(__powerpc__) || defined(__ppc__) -#if defined(__powerpc64__) || defined(__ppc64__) - -#if defined(__MACH__) && defined(__APPLE__) - -#define MULADDC_INIT \ - asm( "ld r3, %0 " :: "m" (s)); \ - asm( "ld r4, %0 " :: "m" (d)); \ - asm( "ld r5, %0 " :: "m" (c)); \ - asm( "ld r6, %0 " :: "m" (b)); \ - asm( "addi r3, r3, -8 " ); \ - asm( "addi r4, r4, -8 " ); \ - asm( "addic r5, r5, 0 " ); - -#define MULADDC_CORE \ - asm( "ldu r7, 8(r3) " ); \ - asm( "mulld r8, r7, r6 " ); \ - asm( "mulhdu r9, r7, r6 " ); \ - asm( "adde r8, r8, r5 " ); \ - asm( "ld r7, 8(r4) " ); \ - asm( "addze r5, r9 " ); \ - asm( "addc r8, r8, r7 " ); \ - asm( "stdu r8, 8(r4) " ); - -#define MULADDC_STOP \ - asm( "addze r5, r5 " ); \ - asm( "addi r4, r4, 8 " ); \ - asm( "addi r3, r3, 8 " ); \ - asm( "std r5, %0 " : "=m" (c)); \ - asm( "std r4, %0 " : "=m" (d)); \ - asm( "std r3, %0 " : "=m" (s) :: \ - "r3", "r4", "r5", "r6", "r7", "r8", "r9" ); - -#else - -#define MULADDC_INIT \ - asm( "ld %%r3, %0 " :: "m" (s)); \ - asm( "ld %%r4, %0 " :: "m" (d)); \ - asm( "ld %%r5, %0 " :: "m" (c)); \ - asm( "ld %%r6, %0 " :: "m" (b)); \ - asm( "addi %r3, %r3, -8 " ); \ - asm( "addi %r4, %r4, -8 " ); \ - asm( "addic %r5, %r5, 0 " ); - -#define MULADDC_CORE \ - asm( "ldu %r7, 8(%r3) " ); \ - asm( "mulld %r8, %r7, %r6 " ); \ - asm( "mulhdu %r9, %r7, %r6 " ); \ - asm( "adde %r8, %r8, %r5 " ); \ - asm( "ld %r7, 8(%r4) " ); \ - asm( "addze %r5, %r9 " ); \ - asm( "addc %r8, %r8, %r7 " ); \ - asm( "stdu %r8, 8(%r4) " ); - -#define MULADDC_STOP \ - asm( "addze %r5, %r5 " ); \ - asm( "addi %r4, %r4, 8 " ); \ - asm( "addi %r3, %r3, 8 " ); \ - asm( "std %%r5, %0 " : "=m" (c)); \ - asm( "std %%r4, %0 " : "=m" (d)); \ - asm( "std %%r3, %0 " : "=m" (s) :: \ - "r3", "r4", "r5", "r6", "r7", "r8", "r9" ); - -#endif - -#else /* PPC32 */ - -#if defined(__MACH__) && defined(__APPLE__) - -#define MULADDC_INIT \ - asm( "lwz r3, %0 " :: "m" (s)); \ - asm( "lwz r4, %0 " :: "m" (d)); \ - asm( "lwz r5, %0 " :: "m" (c)); \ - asm( "lwz r6, %0 " :: "m" (b)); \ - asm( "addi r3, r3, -4 " ); \ - asm( "addi r4, r4, -4 " ); \ - asm( "addic r5, r5, 0 " ); - -#define MULADDC_CORE \ - asm( "lwzu r7, 4(r3) " ); \ - asm( "mullw r8, r7, r6 " ); \ - asm( "mulhwu r9, r7, r6 " ); \ - asm( "adde r8, r8, r5 " ); \ - asm( "lwz r7, 4(r4) " ); \ - asm( "addze r5, r9 " ); \ - asm( "addc r8, r8, r7 " ); \ - asm( "stwu r8, 4(r4) " ); - -#define MULADDC_STOP \ - asm( "addze r5, r5 " ); \ - asm( "addi r4, r4, 4 " ); \ - asm( "addi r3, r3, 4 " ); \ - asm( "stw r5, %0 " : "=m" (c)); \ - asm( "stw r4, %0 " : "=m" (d)); \ - asm( "stw r3, %0 " : "=m" (s) :: \ - "r3", "r4", "r5", "r6", "r7", "r8", "r9" ); - -#else - -#define MULADDC_INIT \ - asm( "lwz %%r3, %0 " :: "m" (s)); \ - asm( "lwz %%r4, %0 " :: "m" (d)); \ - asm( "lwz %%r5, %0 " :: "m" (c)); \ - asm( "lwz %%r6, %0 " :: "m" (b)); \ - asm( "addi %r3, %r3, -4 " ); \ - asm( "addi %r4, %r4, -4 " ); \ - asm( "addic %r5, %r5, 0 " ); - -#define MULADDC_CORE \ - asm( "lwzu %r7, 4(%r3) " ); \ - asm( "mullw %r8, %r7, %r6 " ); \ - asm( "mulhwu %r9, %r7, %r6 " ); \ - asm( "adde %r8, %r8, %r5 " ); \ - asm( "lwz %r7, 4(%r4) " ); \ - asm( "addze %r5, %r9 " ); \ - asm( "addc %r8, %r8, %r7 " ); \ - asm( "stwu %r8, 4(%r4) " ); - -#define MULADDC_STOP \ - asm( "addze %r5, %r5 " ); \ - asm( "addi %r4, %r4, 4 " ); \ - asm( "addi %r3, %r3, 4 " ); \ - asm( "stw %%r5, %0 " : "=m" (c)); \ - asm( "stw %%r4, %0 " : "=m" (d)); \ - asm( "stw %%r3, %0 " : "=m" (s) :: \ - "r3", "r4", "r5", "r6", "r7", "r8", "r9" ); - -#endif - -#endif /* PPC32 */ -#endif /* PPC64 */ - -#if defined(__sparc__) - -#define MULADDC_INIT \ - asm( "ld %0, %%o0 " :: "m" (s)); \ - asm( "ld %0, %%o1 " :: "m" (d)); \ - asm( "ld %0, %%o2 " :: "m" (c)); \ - asm( "ld %0, %%o3 " :: "m" (b)); - -#define MULADDC_CORE \ - asm( "ld [%o0], %o4 " ); \ - asm( "inc 4, %o0 " ); \ - asm( "ld [%o1], %o5 " ); \ - asm( "umul %o3, %o4, %o4 " ); \ - asm( "addcc %o4, %o2, %o4 " ); \ - asm( "rd %y, %g1 " ); \ - asm( "addx %g1, 0, %g1 " ); \ - asm( "addcc %o4, %o5, %o4 " ); \ - asm( "st %o4, [%o1] " ); \ - asm( "addx %g1, 0, %o2 " ); \ - asm( "inc 4, %o1 " ); - -#define MULADDC_STOP \ - asm( "st %%o2, %0 " : "=m" (c)); \ - asm( "st %%o1, %0 " : "=m" (d)); \ - asm( "st %%o0, %0 " : "=m" (s) :: \ - "g1", "o0", "o1", "o2", "o3", "o4", "o5" ); - -#endif /* SPARCv8 */ - -#if defined(__microblaze__) || defined(microblaze) - -#define MULADDC_INIT \ - asm( "lwi r3, %0 " :: "m" (s)); \ - asm( "lwi r4, %0 " :: "m" (d)); \ - asm( "lwi r5, %0 " :: "m" (c)); \ - asm( "lwi r6, %0 " :: "m" (b)); \ - asm( "andi r7, r6, 0xffff" ); \ - asm( "bsrli r6, r6, 16 " ); - -#define MULADDC_CORE \ - asm( "lhui r8, r3, 0 " ); \ - asm( "addi r3, r3, 2 " ); \ - asm( "lhui r9, r3, 0 " ); \ - asm( "addi r3, r3, 2 " ); \ - asm( "mul r10, r9, r6 " ); \ - asm( "mul r11, r8, r7 " ); \ - asm( "mul r12, r9, r7 " ); \ - asm( "mul r13, r8, r6 " ); \ - asm( "bsrli r8, r10, 16 " ); \ - asm( "bsrli r9, r11, 16 " ); \ - asm( "add r13, r13, r8 " ); \ - asm( "add r13, r13, r9 " ); \ - asm( "bslli r10, r10, 16 " ); \ - asm( "bslli r11, r11, 16 " ); \ - asm( "add r12, r12, r10 " ); \ - asm( "addc r13, r13, r0 " ); \ - asm( "add r12, r12, r11 " ); \ - asm( "addc r13, r13, r0 " ); \ - asm( "lwi r10, r4, 0 " ); \ - asm( "add r12, r12, r10 " ); \ - asm( "addc r13, r13, r0 " ); \ - asm( "add r12, r12, r5 " ); \ - asm( "addc r5, r13, r0 " ); \ - asm( "swi r12, r4, 0 " ); \ - asm( "addi r4, r4, 4 " ); - -#define MULADDC_STOP \ - asm( "swi r5, %0 " : "=m" (c)); \ - asm( "swi r4, %0 " : "=m" (d)); \ - asm( "swi r3, %0 " : "=m" (s) :: \ - "r3", "r4" , "r5" , "r6" , "r7" , "r8" , \ - "r9", "r10", "r11", "r12", "r13" ); - -#endif /* MicroBlaze */ - -#if defined(__tricore__) - -#define MULADDC_INIT \ - asm( "ld.a %%a2, %0 " :: "m" (s)); \ - asm( "ld.a %%a3, %0 " :: "m" (d)); \ - asm( "ld.w %%d4, %0 " :: "m" (c)); \ - asm( "ld.w %%d1, %0 " :: "m" (b)); \ - asm( "xor %d5, %d5 " ); - -#define MULADDC_CORE \ - asm( "ld.w %d0, [%a2+] " ); \ - asm( "madd.u %e2, %e4, %d0, %d1 " ); \ - asm( "ld.w %d0, [%a3] " ); \ - asm( "addx %d2, %d2, %d0 " ); \ - asm( "addc %d3, %d3, 0 " ); \ - asm( "mov %d4, %d3 " ); \ - asm( "st.w [%a3+], %d2 " ); - -#define MULADDC_STOP \ - asm( "st.w %0, %%d4 " : "=m" (c)); \ - asm( "st.a %0, %%a3 " : "=m" (d)); \ - asm( "st.a %0, %%a2 " : "=m" (s) :: \ - "d0", "d1", "e2", "d4", "a2", "a3" ); - -#endif /* TriCore */ - -#if defined(__arm__) - -#define MULADDC_INIT \ - asm( "ldr r0, %0 " :: "m" (s)); \ - asm( "ldr r1, %0 " :: "m" (d)); \ - asm( "ldr r2, %0 " :: "m" (c)); \ - asm( "ldr r3, %0 " :: "m" (b)); - -#define MULADDC_CORE \ - asm( "ldr r4, [r0], #4 " ); \ - asm( "mov r5, #0 " ); \ - asm( "ldr r6, [r1] " ); \ - asm( "umlal r2, r5, r3, r4 " ); \ - asm( "adds r7, r6, r2 " ); \ - asm( "adc r2, r5, #0 " ); \ - asm( "str r7, [r1], #4 " ); - -#define MULADDC_STOP \ - asm( "str r2, %0 " : "=m" (c)); \ - asm( "str r1, %0 " : "=m" (d)); \ - asm( "str r0, %0 " : "=m" (s) :: \ - "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7" ); - -#endif /* ARMv3 */ - -#if defined(__alpha__) - -#define MULADDC_INIT \ - asm( "ldq $1, %0 " :: "m" (s)); \ - asm( "ldq $2, %0 " :: "m" (d)); \ - asm( "ldq $3, %0 " :: "m" (c)); \ - asm( "ldq $4, %0 " :: "m" (b)); - -#define MULADDC_CORE \ - asm( "ldq $6, 0($1) " ); \ - asm( "addq $1, 8, $1 " ); \ - asm( "mulq $6, $4, $7 " ); \ - asm( "umulh $6, $4, $6 " ); \ - asm( "addq $7, $3, $7 " ); \ - asm( "cmpult $7, $3, $3 " ); \ - asm( "ldq $5, 0($2) " ); \ - asm( "addq $7, $5, $7 " ); \ - asm( "cmpult $7, $5, $5 " ); \ - asm( "stq $7, 0($2) " ); \ - asm( "addq $2, 8, $2 " ); \ - asm( "addq $6, $3, $3 " ); \ - asm( "addq $5, $3, $3 " ); - -#define MULADDC_STOP \ - asm( "stq $3, %0 " : "=m" (c)); \ - asm( "stq $2, %0 " : "=m" (d)); \ - asm( "stq $1, %0 " : "=m" (s) :: \ - "$1", "$2", "$3", "$4", "$5", "$6", "$7" ); - -#endif /* Alpha */ - -#if defined(__mips__) - -#define MULADDC_INIT \ - asm( "lw $10, %0 " :: "m" (s)); \ - asm( "lw $11, %0 " :: "m" (d)); \ - asm( "lw $12, %0 " :: "m" (c)); \ - asm( "lw $13, %0 " :: "m" (b)); - -#define MULADDC_CORE \ - asm( "lw $14, 0($10) " ); \ - asm( "multu $13, $14 " ); \ - asm( "addi $10, $10, 4 " ); \ - asm( "mflo $14 " ); \ - asm( "mfhi $9 " ); \ - asm( "addu $14, $12, $14 " ); \ - asm( "lw $15, 0($11) " ); \ - asm( "sltu $12, $14, $12 " ); \ - asm( "addu $15, $14, $15 " ); \ - asm( "sltu $14, $15, $14 " ); \ - asm( "addu $12, $12, $9 " ); \ - asm( "sw $15, 0($11) " ); \ - asm( "addu $12, $12, $14 " ); \ - asm( "addi $11, $11, 4 " ); - -#define MULADDC_STOP \ - asm( "sw $12, %0 " : "=m" (c)); \ - asm( "sw $11, %0 " : "=m" (d)); \ - asm( "sw $10, %0 " : "=m" (s) :: \ - "$9", "$10", "$11", "$12", "$13", "$14", "$15" ); - -#endif /* MIPS */ -#endif /* GNUC */ - -#if (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) - -#define MULADDC_INIT \ - __asm mov esi, s \ - __asm mov edi, d \ - __asm mov ecx, c \ - __asm mov ebx, b - -#define MULADDC_CORE \ - __asm lodsd \ - __asm mul ebx \ - __asm add eax, ecx \ - __asm adc edx, 0 \ - __asm add eax, [edi] \ - __asm adc edx, 0 \ - __asm mov ecx, edx \ - __asm stosd - -#if defined(POLARSSL_HAVE_SSE2) - -#define EMIT __asm _emit - -#define MULADDC_HUIT \ - EMIT 0x0F EMIT 0x6E EMIT 0xC9 \ - EMIT 0x0F EMIT 0x6E EMIT 0xC3 \ - EMIT 0x0F EMIT 0x6E EMIT 0x1F \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCB \ - EMIT 0x0F EMIT 0x6E EMIT 0x16 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xD0 \ - EMIT 0x0F EMIT 0x6E EMIT 0x66 EMIT 0x04 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xE0 \ - EMIT 0x0F EMIT 0x6E EMIT 0x76 EMIT 0x08 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xF0 \ - EMIT 0x0F EMIT 0x6E EMIT 0x7E EMIT 0x0C \ - EMIT 0x0F EMIT 0xF4 EMIT 0xF8 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCA \ - EMIT 0x0F EMIT 0x6E EMIT 0x5F EMIT 0x04 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xDC \ - EMIT 0x0F EMIT 0x6E EMIT 0x6F EMIT 0x08 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xEE \ - EMIT 0x0F EMIT 0x6E EMIT 0x67 EMIT 0x0C \ - EMIT 0x0F EMIT 0xD4 EMIT 0xFC \ - EMIT 0x0F EMIT 0x7E EMIT 0x0F \ - EMIT 0x0F EMIT 0x6E EMIT 0x56 EMIT 0x10 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xD0 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0x6E EMIT 0x66 EMIT 0x14 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xE0 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCB \ - EMIT 0x0F EMIT 0x6E EMIT 0x76 EMIT 0x18 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xF0 \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x04 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0x6E EMIT 0x5E EMIT 0x1C \ - EMIT 0x0F EMIT 0xF4 EMIT 0xD8 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCD \ - EMIT 0x0F EMIT 0x6E EMIT 0x6F EMIT 0x10 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xD5 \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x08 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCF \ - EMIT 0x0F EMIT 0x6E EMIT 0x6F EMIT 0x14 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xE5 \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x0C \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCA \ - EMIT 0x0F EMIT 0x6E EMIT 0x6F EMIT 0x18 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xF5 \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x10 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCC \ - EMIT 0x0F EMIT 0x6E EMIT 0x6F EMIT 0x1C \ - EMIT 0x0F EMIT 0xD4 EMIT 0xDD \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x14 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCE \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x18 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCB \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x1C \ - EMIT 0x83 EMIT 0xC7 EMIT 0x20 \ - EMIT 0x83 EMIT 0xC6 EMIT 0x20 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0x7E EMIT 0xC9 - -#define MULADDC_STOP \ - EMIT 0x0F EMIT 0x77 \ - __asm mov c, ecx \ - __asm mov d, edi \ - __asm mov s, esi \ - -#else - -#define MULADDC_STOP \ - __asm mov c, ecx \ - __asm mov d, edi \ - __asm mov s, esi \ - -#endif /* SSE2 */ -#endif /* MSVC */ - -#endif /* POLARSSL_HAVE_ASM */ - -#if !defined(MULADDC_CORE) -#if defined(POLARSSL_HAVE_LONGLONG) - -#define MULADDC_INIT \ -{ \ - t_dbl r; \ - t_int r0, r1; - -#define MULADDC_CORE \ - r = *(s++) * (t_dbl) b; \ - r0 = r; \ - r1 = r >> biL; \ - r0 += c; r1 += (r0 < c); \ - r0 += *d; r1 += (r0 < *d); \ - c = r1; *(d++) = r0; - -#define MULADDC_STOP \ -} - -#else -#define MULADDC_INIT \ -{ \ - t_int s0, s1, b0, b1; \ - t_int r0, r1, rx, ry; \ - b0 = ( b << biH ) >> biH; \ - b1 = ( b >> biH ); - -#define MULADDC_CORE \ - s0 = ( *s << biH ) >> biH; \ - s1 = ( *s >> biH ); s++; \ - rx = s0 * b1; r0 = s0 * b0; \ - ry = s1 * b0; r1 = s1 * b1; \ - r1 += ( rx >> biH ); \ - r1 += ( ry >> biH ); \ - rx <<= biH; ry <<= biH; \ - r0 += rx; r1 += (r0 < rx); \ - r0 += ry; r1 += (r0 < ry); \ - r0 += c; r1 += (r0 < c); \ - r0 += *d; r1 += (r0 < *d); \ - c = r1; *(d++) = r0; - -#define MULADDC_STOP \ -} - -#endif /* C (generic) */ -#endif /* C (longlong) */ - -#endif /* bn_mul.h */ diff --git a/package/utils/px5g-standalone/src/polarssl/config.h b/package/utils/px5g-standalone/src/polarssl/config.h deleted file mode 100644 index 79cd3dba9d..0000000000 --- a/package/utils/px5g-standalone/src/polarssl/config.h +++ /dev/null @@ -1,329 +0,0 @@ -/** - * \file config.h - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the names of PolarSSL or XySSL nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This set of compile-time options may be used to enable - * or disable features selectively, and reduce the global - * memory footprint. - */ -#ifndef POLARSSL_CONFIG_H -#define POLARSSL_CONFIG_H - -#ifndef _CRT_SECURE_NO_DEPRECATE -#define _CRT_SECURE_NO_DEPRECATE 1 -#endif - -/* - * Uncomment if native integers are 8-bit wide. - * -#define POLARSSL_HAVE_INT8 - */ - -/* - * Uncomment if native integers are 16-bit wide. - * -#define POLARSSL_HAVE_INT16 - */ - -/* - * Uncomment if the compiler supports long long. -#define POLARSSL_HAVE_LONGLONG - */ - - -/* - * Uncomment to enable the use of assembly code. - */ -/* #define POLARSSL_HAVE_ASM */ - -/* - * Uncomment if the CPU supports SSE2 (IA-32 specific). - * -#define POLARSSL_HAVE_SSE2 - */ - -/* - * Enable all SSL/TLS debugging messages. - */ -#define POLARSSL_DEBUG_MSG - -/* - * Enable the checkup functions (*_self_test). - */ -#define POLARSSL_SELF_TEST - -/* - * Enable the prime-number generation code. - */ -#define POLARSSL_GENPRIME - -/* - * Uncomment this macro to store the AES tables in ROM. - * -#define POLARSSL_AES_ROM_TABLES - */ - -/* - * Module: library/aes.c - * Caller: library/ssl_tls.c - * - * This module enables the following ciphersuites: - * SSL_RSA_AES_128_SHA - * SSL_RSA_AES_256_SHA - * SSL_EDH_RSA_AES_256_SHA - */ -#define POLARSSL_AES_C - -/* - * Module: library/arc4.c - * Caller: library/ssl_tls.c - * - * This module enables the following ciphersuites: - * SSL_RSA_RC4_128_MD5 - * SSL_RSA_RC4_128_SHA - */ -#define POLARSSL_ARC4_C - -/* - * Module: library/base64.c - * Caller: library/x509parse.c - * - * This module is required for X.509 support. - */ -#define POLARSSL_BASE64_C - -/* - * Module: library/bignum.c - * Caller: library/dhm.c - * library/rsa.c - * library/ssl_tls.c - * library/x509parse.c - * - * This module is required for RSA and DHM support. - */ -#define POLARSSL_BIGNUM_C - -/* - * Module: library/camellia.c - * Caller: - * - * This module enabled the following cipher suites: - */ -#define POLARSSL_CAMELLIA_C - -/* - * Module: library/certs.c - * Caller: - * - * This module is used for testing (ssl_client/server). - */ -#define POLARSSL_CERTS_C - -/* - * Module: library/debug.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * This module provides debugging functions. - */ -#define POLARSSL_DEBUG_C - -/* - * Module: library/des.c - * Caller: library/ssl_tls.c - * - * This module enables the following ciphersuites: - * SSL_RSA_DES_168_SHA - * SSL_EDH_RSA_DES_168_SHA - */ -#define POLARSSL_DES_C - -/* - * Module: library/dhm.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * This module enables the following ciphersuites: - * SSL_EDH_RSA_DES_168_SHA - * SSL_EDH_RSA_AES_256_SHA - */ -#define POLARSSL_DHM_C - -/* - * Module: library/havege.c - * Caller: - * - * This module enables the HAVEGE random number generator. - */ -#define POLARSSL_HAVEGE_C - -/* - * Module: library/md2.c - * Caller: library/x509parse.c - * - * Uncomment to enable support for (rare) MD2-signed X.509 certs. - * -#define POLARSSL_MD2_C - */ - -/* - * Module: library/md4.c - * Caller: library/x509parse.c - * - * Uncomment to enable support for (rare) MD4-signed X.509 certs. - * -#define POLARSSL_MD4_C - */ - -/* - * Module: library/md5.c - * Caller: library/ssl_tls.c - * library/x509parse.c - * - * This module is required for SSL/TLS and X.509. - */ -#define POLARSSL_MD5_C - -/* - * Module: library/net.c - * Caller: - * - * This module provides TCP/IP networking routines. - */ -#define POLARSSL_NET_C - -/* - * Module: library/padlock.c - * Caller: library/aes.c - * - * This modules adds support for the VIA PadLock on x86. - */ -#define POLARSSL_PADLOCK_C - -/* - * Module: library/rsa.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * library/x509.c - * - * This module is required for SSL/TLS and MD5-signed certificates. - */ -#define POLARSSL_RSA_C - -/* - * Module: library/sha1.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * library/x509parse.c - * - * This module is required for SSL/TLS and SHA1-signed certificates. - */ -#define POLARSSL_SHA1_C - -/* - * Module: library/sha2.c - * Caller: - * - * This module adds support for SHA-224 and SHA-256. - */ -#define POLARSSL_SHA2_C - -/* - * Module: library/sha4.c - * Caller: - * - * This module adds support for SHA-384 and SHA-512. - */ -#define POLARSSL_SHA4_C - -/* - * Module: library/ssl_cli.c - * Caller: - * - * This module is required for SSL/TLS client support. - */ -#define POLARSSL_SSL_CLI_C - -/* - * Module: library/ssl_srv.c - * Caller: - * - * This module is required for SSL/TLS server support. - */ -#define POLARSSL_SSL_SRV_C - -/* - * Module: library/ssl_tls.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * This module is required for SSL/TLS. - */ -#define POLARSSL_SSL_TLS_C - -/* - * Module: library/timing.c - * Caller: library/havege.c - * - * This module is used by the HAVEGE random number generator. - */ -#define POLARSSL_TIMING_C - -/* - * Module: library/x509parse.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * This module is required for X.509 certificate parsing. - */ -#define POLARSSL_X509_PARSE_C - -/* - * Module: library/x509_write.c - * Caller: - * - * This module is required for X.509 certificate writing. - */ -#define POLARSSL_X509_WRITE_C - -/* - * Module: library/xtea.c - * Caller: - */ -#define POLARSSL_XTEA_C - -#endif /* config.h */ diff --git a/package/utils/px5g-standalone/src/polarssl/rsa.h b/package/utils/px5g-standalone/src/polarssl/rsa.h deleted file mode 100644 index b31dc2f144..0000000000 --- a/package/utils/px5g-standalone/src/polarssl/rsa.h +++ /dev/null @@ -1,309 +0,0 @@ -/** - * \file rsa.h - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the names of PolarSSL or XySSL nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef POLARSSL_RSA_H -#define POLARSSL_RSA_H - -#include "polarssl/bignum.h" - -#define POLARSSL_ERR_RSA_BAD_INPUT_DATA -0x0400 -#define POLARSSL_ERR_RSA_INVALID_PADDING -0x0410 -#define POLARSSL_ERR_RSA_KEY_GEN_FAILED -0x0420 -#define POLARSSL_ERR_RSA_KEY_CHECK_FAILED -0x0430 -#define POLARSSL_ERR_RSA_PUBLIC_FAILED -0x0440 -#define POLARSSL_ERR_RSA_PRIVATE_FAILED -0x0450 -#define POLARSSL_ERR_RSA_VERIFY_FAILED -0x0460 -#define POLARSSL_ERR_RSA_OUTPUT_TO_LARGE -0x0470 - -/* - * PKCS#1 constants - */ -#define RSA_RAW 0 -#define RSA_MD2 2 -#define RSA_MD4 3 -#define RSA_MD5 4 -#define RSA_SHA1 5 -#define RSA_SHA256 6 - -#define RSA_PUBLIC 0 -#define RSA_PRIVATE 1 - -#define RSA_PKCS_V15 0 -#define RSA_PKCS_V21 1 - -#define RSA_SIGN 1 -#define RSA_CRYPT 2 - -/* - * DigestInfo ::= SEQUENCE { - * digestAlgorithm DigestAlgorithmIdentifier, - * digest Digest } - * - * DigestAlgorithmIdentifier ::= AlgorithmIdentifier - * - * Digest ::= OCTET STRING - */ -#define ASN1_HASH_MDX \ - "\x30\x20\x30\x0C\x06\x08\x2A\x86\x48" \ - "\x86\xF7\x0D\x02\x00\x05\x00\x04\x10" - -#define ASN1_HASH_SHA1 \ - "\x30\x21\x30\x09\x06\x05\x2B\x0E\x03" \ - "\x02\x1A\x05\x00\x04\x14" - -/** - * \brief RSA context structure - */ -typedef struct -{ - int ver; /*!< always 0 */ - int len; /*!< size(N) in chars */ - - mpi N; /*!< public modulus */ - mpi E; /*!< public exponent */ - - mpi D; /*!< private exponent */ - mpi P; /*!< 1st prime factor */ - mpi Q; /*!< 2nd prime factor */ - mpi DP; /*!< D % (P - 1) */ - mpi DQ; /*!< D % (Q - 1) */ - mpi QP; /*!< 1 / (Q % P) */ - - mpi RN; /*!< cached R^2 mod N */ - mpi RP; /*!< cached R^2 mod P */ - mpi RQ; /*!< cached R^2 mod Q */ - - int padding; /*!< 1.5 or OAEP/PSS */ - int hash_id; /*!< hash identifier */ - int (*f_rng)(void *); /*!< RNG function */ - void *p_rng; /*!< RNG parameter */ -} -rsa_context; - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Initialize an RSA context - * - * \param ctx RSA context to be initialized - * \param padding RSA_PKCS_V15 or RSA_PKCS_V21 - * \param hash_id RSA_PKCS_V21 hash identifier - * \param f_rng RNG function - * \param p_rng RNG parameter - * - * \note The hash_id parameter is actually ignored - * when using RSA_PKCS_V15 padding. - * - * \note Currently (xyssl-0.8), RSA_PKCS_V21 padding - * is not supported. - */ -void rsa_init( rsa_context *ctx, - int padding, - int hash_id, - int (*f_rng)(void *), - void *p_rng ); - -/** - * \brief Generate an RSA keypair - * - * \param ctx RSA context that will hold the key - * \param nbits size of the public key in bits - * \param exponent public exponent (e.g., 65537) - * - * \note rsa_init() must be called beforehand to setup - * the RSA context (especially f_rng and p_rng). - * - * \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code - */ -int rsa_gen_key( rsa_context *ctx, int nbits, int exponent ); - -/** - * \brief Check a public RSA key - * - * \param ctx RSA context to be checked - * - * \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code - */ -int rsa_check_pubkey( rsa_context *ctx ); - -/** - * \brief Check a private RSA key - * - * \param ctx RSA context to be checked - * - * \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code - */ -int rsa_check_privkey( rsa_context *ctx ); - -/** - * \brief Do an RSA public key operation - * - * \param ctx RSA context - * \param input input buffer - * \param output output buffer - * - * \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code - * - * \note This function does NOT take care of message - * padding. Also, be sure to set input[0] = 0. - * - * \note The input and output buffers must be large - * enough (eg. 128 bytes if RSA-1024 is used). - */ -int rsa_public( rsa_context *ctx, - unsigned char *input, - unsigned char *output ); - -/** - * \brief Do an RSA private key operation - * - * \param ctx RSA context - * \param input input buffer - * \param output output buffer - * - * \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code - * - * \note The input and output buffers must be large - * enough (eg. 128 bytes if RSA-1024 is used). - */ -int rsa_private( rsa_context *ctx, - unsigned char *input, - unsigned char *output ); - -/** - * \brief Add the message padding, then do an RSA operation - * - * \param ctx RSA context - * \param mode RSA_PUBLIC or RSA_PRIVATE - * \param ilen contains the the plaintext length - * \param input buffer holding the data to be encrypted - * \param output buffer that will hold the ciphertext - * - * \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code - * - * \note The output buffer must be as large as the size - * of ctx->N (eg. 128 bytes if RSA-1024 is used). - */ -int rsa_pkcs1_encrypt( rsa_context *ctx, - int mode, int ilen, - unsigned char *input, - unsigned char *output ); - -/** - * \brief Do an RSA operation, then remove the message padding - * - * \param ctx RSA context - * \param mode RSA_PUBLIC or RSA_PRIVATE - * \param input buffer holding the encrypted data - * \param output buffer that will hold the plaintext - * \param olen will contain the plaintext length - * \param output_max_len maximum length of the output buffer - * - * \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code - * - * \note The output buffer must be as large as the size - * of ctx->N (eg. 128 bytes if RSA-1024 is used) otherwise - * an error is thrown. - */ -int rsa_pkcs1_decrypt( rsa_context *ctx, - int mode, int *olen, - unsigned char *input, - unsigned char *output, - int output_max_len); - -/** - * \brief Do a private RSA to sign a message digest - * - * \param ctx RSA context - * \param mode RSA_PUBLIC or RSA_PRIVATE - * \param hash_id RSA_RAW, RSA_MD{2,4,5} or RSA_SHA{1,256} - * \param hashlen message digest length (for RSA_RAW only) - * \param hash buffer holding the message digest - * \param sig buffer that will hold the ciphertext - * - * \return 0 if the signing operation was successful, - * or an POLARSSL_ERR_RSA_XXX error code - * - * \note The "sig" buffer must be as large as the size - * of ctx->N (eg. 128 bytes if RSA-1024 is used). - */ -int rsa_pkcs1_sign( rsa_context *ctx, - int mode, - int hash_id, - int hashlen, - unsigned char *hash, - unsigned char *sig ); - -/** - * \brief Do a public RSA and check the message digest - * - * \param ctx points to an RSA public key - * \param mode RSA_PUBLIC or RSA_PRIVATE - * \param hash_id RSA_RAW, RSA_MD{2,4,5} or RSA_SHA{1,256} - * \param hashlen message digest length (for RSA_RAW only) - * \param hash buffer holding the message digest - * \param sig buffer holding the ciphertext - * - * \return 0 if the verify operation was successful, - * or an POLARSSL_ERR_RSA_XXX error code - * - * \note The "sig" buffer must be as large as the size - * of ctx->N (eg. 128 bytes if RSA-1024 is used). - */ -int rsa_pkcs1_verify( rsa_context *ctx, - int mode, - int hash_id, - int hashlen, - unsigned char *hash, - unsigned char *sig ); - -/** - * \brief Free the components of an RSA key - */ -void rsa_free( rsa_context *ctx ); - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int rsa_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* rsa.h */ diff --git a/package/utils/px5g-standalone/src/polarssl/sha1.h b/package/utils/px5g-standalone/src/polarssl/sha1.h deleted file mode 100644 index 3ca7dc3195..0000000000 --- a/package/utils/px5g-standalone/src/polarssl/sha1.h +++ /dev/null @@ -1,150 +0,0 @@ -/** - * \file sha1.h - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the names of PolarSSL or XySSL nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef POLARSSL_SHA1_H -#define POLARSSL_SHA1_H - -/** - * \brief SHA-1 context structure - */ -typedef struct -{ - unsigned long total[2]; /*!< number of bytes processed */ - unsigned long state[5]; /*!< intermediate digest state */ - unsigned char buffer[64]; /*!< data block being processed */ - - unsigned char ipad[64]; /*!< HMAC: inner padding */ - unsigned char opad[64]; /*!< HMAC: outer padding */ -} -sha1_context; - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief SHA-1 context setup - * - * \param ctx context to be initialized - */ -void sha1_starts( sha1_context *ctx ); - -/** - * \brief SHA-1 process buffer - * - * \param ctx SHA-1 context - * \param input buffer holding the data - * \param ilen length of the input data - */ -void sha1_update( sha1_context *ctx, unsigned char *input, int ilen ); - -/** - * \brief SHA-1 final digest - * - * \param ctx SHA-1 context - * \param output SHA-1 checksum result - */ -void sha1_finish( sha1_context *ctx, unsigned char output[20] ); - -/** - * \brief Output = SHA-1( input buffer ) - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output SHA-1 checksum result - */ -void sha1( unsigned char *input, int ilen, unsigned char output[20] ); - -/** - * \brief Output = SHA-1( file contents ) - * - * \param path input file name - * \param output SHA-1 checksum result - * - * \return 0 if successful, 1 if fopen failed, - * or 2 if fread failed - */ -int sha1_file( char *path, unsigned char output[20] ); - -/** - * \brief SHA-1 HMAC context setup - * - * \param ctx HMAC context to be initialized - * \param key HMAC secret key - * \param keylen length of the HMAC key - */ -void sha1_hmac_starts( sha1_context *ctx, unsigned char *key, int keylen ); - -/** - * \brief SHA-1 HMAC process buffer - * - * \param ctx HMAC context - * \param input buffer holding the data - * \param ilen length of the input data - */ -void sha1_hmac_update( sha1_context *ctx, unsigned char *input, int ilen ); - -/** - * \brief SHA-1 HMAC final digest - * - * \param ctx HMAC context - * \param output SHA-1 HMAC checksum result - */ -void sha1_hmac_finish( sha1_context *ctx, unsigned char output[20] ); - -/** - * \brief Output = HMAC-SHA-1( hmac key, input buffer ) - * - * \param key HMAC secret key - * \param keylen length of the HMAC key - * \param input buffer holding the data - * \param ilen length of the input data - * \param output HMAC-SHA-1 result - */ -void sha1_hmac( unsigned char *key, int keylen, - unsigned char *input, int ilen, - unsigned char output[20] ); - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int sha1_self_test( int verbose ); - -#ifdef __cplusplus -} -#endif - -#endif /* sha1.h */ diff --git a/package/utils/px5g-standalone/src/polarssl/timing.h b/package/utils/px5g-standalone/src/polarssl/timing.h deleted file mode 100644 index 62d627f61b..0000000000 --- a/package/utils/px5g-standalone/src/polarssl/timing.h +++ /dev/null @@ -1,81 +0,0 @@ -/** - * \file timing.h - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the names of PolarSSL or XySSL nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef POLARSSL_TIMING_H -#define POLARSSL_TIMING_H - -/** - * \brief timer structure - */ -struct hr_time -{ - unsigned char opaque[32]; -}; - -#ifdef __cplusplus -extern "C" { -#endif - -extern int alarmed; - -/** - * \brief Return the CPU cycle counter value - */ -unsigned long hardclock( void ); - -/** - * \brief Return the elapsed time in milliseconds - * - * \param val points to a timer structure - * \param reset if set to 1, the timer is restarted - */ -unsigned long get_timer( struct hr_time *val, int reset ); - -/** - * \brief Setup an alarm clock - * - * \param seconds delay before the "alarmed" flag is set - */ -void set_alarm( int seconds ); - -/** - * \brief Sleep for a certain amount of time - */ -void m_sleep( int milliseconds ); - -#ifdef __cplusplus -} -#endif - -#endif /* timing.h */ diff --git a/package/utils/px5g-standalone/src/polarssl/x509.h b/package/utils/px5g-standalone/src/polarssl/x509.h deleted file mode 100644 index 908a1dbf51..0000000000 --- a/package/utils/px5g-standalone/src/polarssl/x509.h +++ /dev/null @@ -1,549 +0,0 @@ -/** - * \file x509.h - * - * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine - * - * Copyright (C) 2009 Paul Bakker - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the names of PolarSSL or XySSL nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef POLARSSL_X509_H -#define POLARSSL_X509_H - -#include "polarssl/rsa.h" - -#define POLARSSL_ERR_ASN1_OUT_OF_DATA -0x0014 -#define POLARSSL_ERR_ASN1_UNEXPECTED_TAG -0x0016 -#define POLARSSL_ERR_ASN1_INVALID_LENGTH -0x0018 -#define POLARSSL_ERR_ASN1_LENGTH_MISMATCH -0x001A -#define POLARSSL_ERR_ASN1_INVALID_DATA -0x001C - -#define POLARSSL_ERR_X509_FEATURE_UNAVAILABLE -0x0020 -#define POLARSSL_ERR_X509_CERT_INVALID_PEM -0x0040 -#define POLARSSL_ERR_X509_CERT_INVALID_FORMAT -0x0060 -#define POLARSSL_ERR_X509_CERT_INVALID_VERSION -0x0080 -#define POLARSSL_ERR_X509_CERT_INVALID_SERIAL -0x00A0 -#define POLARSSL_ERR_X509_CERT_INVALID_ALG -0x00C0 -#define POLARSSL_ERR_X509_CERT_INVALID_NAME -0x00E0 -#define POLARSSL_ERR_X509_CERT_INVALID_DATE -0x0100 -#define POLARSSL_ERR_X509_CERT_INVALID_PUBKEY -0x0120 -#define POLARSSL_ERR_X509_CERT_INVALID_SIGNATURE -0x0140 -#define POLARSSL_ERR_X509_CERT_INVALID_EXTENSIONS -0x0160 -#define POLARSSL_ERR_X509_CERT_UNKNOWN_VERSION -0x0180 -#define POLARSSL_ERR_X509_CERT_UNKNOWN_SIG_ALG -0x01A0 -#define POLARSSL_ERR_X509_CERT_UNKNOWN_PK_ALG -0x01C0 -#define POLARSSL_ERR_X509_CERT_SIG_MISMATCH -0x01E0 -#define POLARSSL_ERR_X509_CERT_VERIFY_FAILED -0x0200 -#define POLARSSL_ERR_X509_KEY_INVALID_PEM -0x0220 -#define POLARSSL_ERR_X509_KEY_INVALID_VERSION -0x0240 -#define POLARSSL_ERR_X509_KEY_INVALID_FORMAT -0x0260 -#define POLARSSL_ERR_X509_KEY_INVALID_ENC_IV -0x0280 -#define POLARSSL_ERR_X509_KEY_UNKNOWN_ENC_ALG -0x02A0 -#define POLARSSL_ERR_X509_KEY_PASSWORD_REQUIRED -0x02C0 -#define POLARSSL_ERR_X509_KEY_PASSWORD_MISMATCH -0x02E0 -#define POLARSSL_ERR_X509_POINT_ERROR -0x0300 -#define POLARSSL_ERR_X509_VALUE_TO_LENGTH -0x0320 - -#define BADCERT_EXPIRED 1 -#define BADCERT_REVOKED 2 -#define BADCERT_CN_MISMATCH 4 -#define BADCERT_NOT_TRUSTED 8 - -/* - * DER constants - */ -#define ASN1_BOOLEAN 0x01 -#define ASN1_INTEGER 0x02 -#define ASN1_BIT_STRING 0x03 -#define ASN1_OCTET_STRING 0x04 -#define ASN1_NULL 0x05 -#define ASN1_OID 0x06 -#define ASN1_UTF8_STRING 0x0C -#define ASN1_SEQUENCE 0x10 -#define ASN1_SET 0x11 -#define ASN1_PRINTABLE_STRING 0x13 -#define ASN1_T61_STRING 0x14 -#define ASN1_IA5_STRING 0x16 -#define ASN1_UTC_TIME 0x17 -#define ASN1_UNIVERSAL_STRING 0x1C -#define ASN1_BMP_STRING 0x1E -#define ASN1_PRIMITIVE 0x00 -#define ASN1_CONSTRUCTED 0x20 -#define ASN1_CONTEXT_SPECIFIC 0x80 - -/* - * various object identifiers - */ -#define X520_COMMON_NAME 3 -#define X520_COUNTRY 6 -#define X520_LOCALITY 7 -#define X520_STATE 8 -#define X520_ORGANIZATION 10 -#define X520_ORG_UNIT 11 -#define PKCS9_EMAIL 1 - -#define X509_OUTPUT_DER 0x01 -#define X509_OUTPUT_PEM 0x02 -#define PEM_LINE_LENGTH 72 -#define X509_ISSUER 0x01 -#define X509_SUBJECT 0x02 - -#define OID_X520 "\x55\x04" -#define OID_CN "\x55\x04\x03" -#define OID_PKCS1 "\x2A\x86\x48\x86\xF7\x0D\x01\x01" -#define OID_PKCS1_RSA "\x2A\x86\x48\x86\xF7\x0D\x01\x01\x01" -#define OID_PKCS1_RSA_SHA "\x2A\x86\x48\x86\xF7\x0D\x01\x01\x05" -#define OID_PKCS9 "\x2A\x86\x48\x86\xF7\x0D\x01\x09" -#define OID_PKCS9_EMAIL "\x2A\x86\x48\x86\xF7\x0D\x01\x09\x01" - -/* - * Structures for parsing X.509 certificates - */ -typedef struct _x509_buf -{ - int tag; - int len; - unsigned char *p; -} -x509_buf; - -typedef struct _x509_name -{ - x509_buf oid; - x509_buf val; - struct _x509_name *next; -} -x509_name; - -typedef struct _x509_time -{ - int year, mon, day; - int hour, min, sec; -} -x509_time; - -typedef struct _x509_cert -{ - x509_buf raw; - x509_buf tbs; - - int version; - x509_buf serial; - x509_buf sig_oid1; - - x509_buf issuer_raw; - x509_buf subject_raw; - - x509_name issuer; - x509_name subject; - - x509_time valid_from; - x509_time valid_to; - - x509_buf pk_oid; - rsa_context rsa; - - x509_buf issuer_id; - x509_buf subject_id; - x509_buf v3_ext; - - int ca_istrue; - int max_pathlen; - - x509_buf sig_oid2; - x509_buf sig; - - struct _x509_cert *next; -} -x509_cert; - -/* - * Structures for writing X.509 certificates - */ -typedef struct _x509_node -{ - unsigned char *data; - unsigned char *p; - unsigned char *end; - - size_t len; -} -x509_node; - -typedef struct _x509_raw -{ - x509_node raw; - x509_node tbs; - - x509_node version; - x509_node serial; - x509_node tbs_signalg; - x509_node issuer; - x509_node validity; - x509_node subject; - x509_node subpubkey; - - x509_node signalg; - x509_node sign; -} -x509_raw; - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Parse one or more certificates and add them - * to the chained list - * - * \param chain points to the start of the chain - * \param buf buffer holding the certificate data - * \param buflen size of the buffer - * - * \return 0 if successful, or a specific X509 error code - */ -int x509parse_crt( x509_cert *crt, unsigned char *buf, int buflen ); - -/** - * \brief Load one or more certificates and add them - * to the chained list - * - * \param chain points to the start of the chain - * \param path filename to read the certificates from - * - * \return 0 if successful, or a specific X509 error code - */ -int x509parse_crtfile( x509_cert *crt, char *path ); - -/** - * \brief Parse a private RSA key - * - * \param rsa RSA context to be initialized - * \param buf input buffer - * \param buflen size of the buffer - * \param pwd password for decryption (optional) - * \param pwdlen size of the password - * - * \return 0 if successful, or a specific X509 error code - */ -int x509parse_key( rsa_context *rsa, - unsigned char *buf, int buflen, - unsigned char *pwd, int pwdlen ); - -/** - * \brief Load and parse a private RSA key - * - * \param rsa RSA context to be initialized - * \param path filename to read the private key from - * \param pwd password to decrypt the file (can be NULL) - * - * \return 0 if successful, or a specific X509 error code - */ -int x509parse_keyfile( rsa_context *rsa, char *path, char *password ); - -/** - * \brief Store the certificate DN in printable form into buf; - * no more than (end - buf) characters will be written. - */ -int x509parse_dn_gets( char *buf, char *end, x509_name *dn ); - -/** - * \brief Returns an informational string about the - * certificate. - */ -char *x509parse_cert_info( char *prefix, x509_cert *crt ); - -/** - * \brief Return 0 if the certificate is still valid, - * or BADCERT_EXPIRED - */ -int x509parse_expired( x509_cert *crt ); - -/** - * \brief Verify the certificate signature - * - * \param crt a certificate to be verified - * \param trust_ca the trusted CA chain - * \param cn expected Common Name (can be set to - * NULL if the CN must not be verified) - * \param flags result of the verification - * - * \return 0 if successful or POLARSSL_ERR_X509_SIG_VERIFY_FAILED, - * in which case *flags will have one or more of - * the following values set: - * BADCERT_EXPIRED -- - * BADCERT_REVOKED -- - * BADCERT_CN_MISMATCH -- - * BADCERT_NOT_TRUSTED - * - * \note TODO: add two arguments, depth and crl - */ -int x509parse_verify( x509_cert *crt, - x509_cert *trust_ca, - char *cn, int *flags ); - -/** - * \brief Unallocate all certificate data - */ -void x509_free( x509_cert *crt ); - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int x509_self_test( int verbose ); - -/** - * \brief Write a certificate info file - * - * \param chain points to the raw certificate data - * \param path filename to write the certificate to - * \param format X509_OUTPUT_DER or X509_OUTPUT_PEM - * - * \return 0 if successful, or a specific X509 error code - */ -int x509write_crtfile( x509_raw *chain, - unsigned char *path, - int format ); - -/** - * \brief Write a certificate signing request message format file - * - * \param chain points to the raw certificate (with x509write_create_csr) data - * \param path filename to write the certificate to - * \param format X509_OUTPUT_DER or X509_OUTPUT_PEM - * - * \return 0 if successful, or a specific X509 error code - */ -int x509write_csrfile( x509_raw *chain, - unsigned char *path, - int format ); - -/* - * \brief Write a private RSA key into a file - * - * \param rsa points to an RSA key - * \param path filename to write the key to - * \param format X509_OUTPUT_DER or X509_OUTPUT_PEM - * - * \return 0 if successful, or a specific X509 error code - */ -int x509write_keyfile( rsa_context *rsa, - char *path, - int format ); - -/** - * \brief Add a public key to certificate - * - * \param chain points to the raw certificate data - * \param pubkey points to an RSA key - * - * \return 0 if successful, or a specific X509 error code - */ -int x509write_add_pubkey( x509_raw *chain, rsa_context *pubkey ); - -/** - * \brief Create x509 subject/issuer field to raw certificate - * from string or CA cert. Make string NULL if you will - * use the CA copy function or make CA NULL then used - * the string parse. - * - * \param chain points to the raw certificate data - * \param names a string that can hold (separete with ";"): - * CN=CommonName - * -- O=Organization - * -- OU=OrgUnit - * -- ST=State - * -- L=Locality - * -- R=Email - * -- C=Country - * . Make that NULL if you didn't need that. - * \param flag flag is X509_ISSUER or X509_SUBJECT that defined - * where change - * \param ca the certificate for copy data. Make that NULL if you - * didn't need that. - * \param ca_flag set the ca field from copy to crt - * - * \return 0 if successful, or a specific X509 error code - */ -int x509write_add_customize ( x509_raw *crt, - unsigned char *names, - int flag, - x509_cert *ca, - int ca_flag ); - -/** -* \brief Add x509 issuer field -* -* \param chain points to the raw certificate data -* \param issuer a string holding (separete with ";"): -* CN=CommonName -* -- O=Organization -* -- OU=OrgUnit -* -- ST=State -* -- L=Locality -* -- R=Email -* -- C=Country -* . Set this to NULL if not needed. -* \return 0 if successful, or a specific X509 error code -*/ -int x509write_add_issuer( x509_raw *crt, unsigned char *issuer); - -/** - * \brief Add x509 subject field - * - * \param chain points to the raw certificate data - * \param subject a string holding (separete with ";"): - * CN=CommonName - * -- O=Organization - * -- OU=OrgUnit - * -- ST=State - * -- L=Locality - * -- R=Email - * -- C=Country - * . Set this to NULL if not needed. - * \return 0 if successful, or a specific X509 error code - */ -int x509write_add_subject( x509_raw *crt, unsigned char *subject); - -/** -* \brief Copy x509 issuer field from another certificate -* -* \param chain points to the raw certificate data -* \param from_crt the certificate whose issuer is to be copied. -* \return 0 if successful, or a specific X509 error code -*/ -int x509write_copy_issuer(x509_raw *crt, x509_cert *from_crt); - -/** -* \brief Copy x509 subject field from another certificate -* -* \param chain points to the raw certificate data -* \param from_crt the certificate whose subject is to be copied. -* \return 0 if successful, or a specific X509 error code -*/ -int x509write_copy_subject(x509_raw *crt, x509_cert *from_crt); - -/** -* \brief Copy x509 issuer field from the subject of another certificate -* -* \param chain points to the raw certificate data -* \param from_crt the certificate whose subject is to be copied. -* \return 0 if successful, or a specific X509 error code -*/ -int x509write_copy_issuer_from_subject(x509_raw *crt, x509_cert *from_crt); - -/** -* \brief Copy x509 subject field from the issuer of another certificate -* -* \param chain points to the raw certificate data -* \param from_crt the certificate whose issuer is to be copied. -* \return 0 if successful, or a specific X509 error code -*/ -int x509write_copy_subject_from_issuer(x509_raw *crt, x509_cert *from_crt); - -/** - * \brief Create x509 validity time in UTC - * - * \param chain points to the raw certificate data - * \param before valid not before in format YYYY-MM-DD hh:mm:ss - * \param after valid not after in format YYYY-MM-DD hh:mm:ss - * - * \return 0 if successful, or a specific X509 error code - */ -int x509write_add_validity( x509_raw *crt, - unsigned char *before, - unsigned char *after ); - -/** - * \brief Create a self-signed certificate - * - * \param chain points to the raw certificate data - * \param rsa a private key to sign the certificate - * - * \return 0 if successful, or a specific X509 error code - */ -int x509write_create_selfsign( x509_raw *crt, rsa_context *raw ); - -/** - * \brief Create a certificate - * - * \param chain points to the raw certificate data - * \param rsa a private key to sign the certificate - * - * \return 0 if successful, or a specific X509 error code - */ -int x509write_create_sign( x509_raw *crt, rsa_context *raw ); - -/** - * \brief Create a certificate signing request - * - * \param chain points to the raw certificate data. Didn't use the - * same chain that u have use for certificate. - * \param privkey a rsa private key - * - * \return 0 if successful, or a specific X509 error code - */ -int x509write_create_csr( x509_raw *chain, rsa_context *privkey ); - -/** - * \brief Serialize an rsa key into DER - * - * \param rsa a rsa key for output - * \param node a x509 node for write into - * - * \return 0 if successful, or a specific X509 error code - */ -int x509write_serialize_key( rsa_context *rsa, x509_node *node ); - -/** - * \brief Unallocate all raw certificate data - */ -void x509write_free_raw( x509_raw *crt ); - -/** - * \brief Allocate all raw certificate data - */ -void x509write_init_raw( x509_raw *crt ); - -/** - * \brief Unallocate all node certificate data - */ -void x509write_free_node( x509_node *crt_node ); - -/** - * \brief Allocate all node certificate data - */ -void x509write_init_node( x509_node *crt_node ); - -#ifdef __cplusplus -} -#endif - -#endif /* x509.h */ diff --git a/package/utils/px5g-standalone/src/px5g.c b/package/utils/px5g-standalone/src/px5g.c deleted file mode 100644 index 34ab34f32d..0000000000 --- a/package/utils/px5g-standalone/src/px5g.c +++ /dev/null @@ -1,213 +0,0 @@ -/* - * px5g - Embedded x509 key and certificate generator based on PolarSSL - * - * Copyright (C) 2009 Steven Barth - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License, version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301 USA - */ - -#include -#include -#include -#include -#include -#include -#include -#include "polarssl/bignum.h" -#include "polarssl/x509.h" -#include "polarssl/rsa.h" - -#define PX5G_VERSION "0.1" -#define PX5G_COPY "Copyright (c) 2009 Steven Barth " -#define PX5G_LICENSE "Licensed under the GNU Lesser General Public License v2.1" - -static int urandom_fd; - -static int _urandom(void *ctx) -{ - int ret; - read(urandom_fd, &ret, sizeof(ret)); - return ret; -} - - -int rsakey(char **arg) { - rsa_context rsa; - - unsigned int ksize = 512; - int exp = 65537; - char *path = NULL; - int flag = X509_OUTPUT_PEM; - - while (*arg && **arg == '-') { - if (!strcmp(*arg, "-out") && arg[1]) { - path = arg[1]; - arg++; - } else if (!strcmp(*arg, "-3")) { - exp = 3; - } else if (!strcmp(*arg, "-der")) { - flag = X509_OUTPUT_DER; - } - arg++; - } - - if (*arg) { - ksize = (unsigned int)atoi(*arg); - } - - rsa_init(&rsa, RSA_PKCS_V15, 0, _urandom, NULL); - - fprintf(stderr, "Generating RSA private key, %i bit long modulus\n", ksize); - if (rsa_gen_key(&rsa, ksize, exp)) { - fprintf(stderr, "error: key generation failed\n"); - return 1; - } - - if (x509write_keyfile(&rsa, path, flag)) { - fprintf(stderr, "error: I/O error\n"); - return 1; - } - - rsa_free(&rsa); - return 0; -} - -int selfsigned(char **arg) { - rsa_context rsa; - x509_node node; - - char *subject = ""; - unsigned int ksize = 512; - int exp = 65537; - unsigned int days = 30; - char *keypath = NULL, *certpath = NULL; - int flag = X509_OUTPUT_PEM; - time_t from = time(NULL), to; - char fstr[20], tstr[20]; - - while (*arg && **arg == '-') { - if (!strcmp(*arg, "-der")) { - flag = X509_OUTPUT_DER; - } else if (!strcmp(*arg, "-newkey") && arg[1]) { - if (strncmp(arg[1], "rsa:", 4)) { - fprintf(stderr, "error: invalid algorithm"); - return 1; - } - ksize = (unsigned int)atoi(arg[1] + 4); - arg++; - } else if (!strcmp(*arg, "-days") && arg[1]) { - days = (unsigned int)atoi(arg[1]); - arg++; - } else if (!strcmp(*arg, "-keyout") && arg[1]) { - keypath = arg[1]; - arg++; - } else if (!strcmp(*arg, "-out") && arg[1]) { - certpath = arg[1]; - arg++; - } else if (!strcmp(*arg, "-subj") && arg[1]) { - if (arg[1][0] != '/' || strchr(arg[1], ';')) { - fprintf(stderr, "error: invalid subject"); - return 1; - } - subject = calloc(strlen(arg[1]) + 1, 1); - char *oldc = arg[1] + 1, *newc = subject, *delim; - do { - delim = strchr(oldc, '='); - if (!delim) { - fprintf(stderr, "error: invalid subject"); - return 1; - } - memcpy(newc, oldc, delim - oldc + 1); - newc += delim - oldc + 1; - oldc = delim + 1; - - delim = strchr(oldc, '/'); - if (!delim) { - delim = arg[1] + strlen(arg[1]); - } - memcpy(newc, oldc, delim - oldc); - newc += delim - oldc; - *newc++ = ';'; - oldc = delim + 1; - } while(*delim); - arg++; - } - arg++; - } - - rsa_init(&rsa, RSA_PKCS_V15, 0, _urandom, NULL); - x509write_init_node(&node); - fprintf(stderr, "Generating RSA private key, %i bit long modulus\n", ksize); - if (rsa_gen_key(&rsa, ksize, exp)) { - fprintf(stderr, "error: key generation failed\n"); - return 1; - } - - if (keypath) { - if (x509write_keyfile(&rsa, keypath, flag)) { - fprintf(stderr, "error: I/O error\n"); - return 1; - } - } - - from = (from < 1000000000) ? 1000000000 : from; - strftime(fstr, sizeof(fstr), "%F %H:%M:%S", gmtime(&from)); - to = from + 60 * 60 * 24 * days; - if (to < from) - to = INT_MAX; - strftime(tstr, sizeof(tstr), "%F %H:%M:%S", gmtime(&to)); - - x509_raw cert; - x509write_init_raw(&cert); - x509write_add_pubkey(&cert, &rsa); - x509write_add_subject(&cert, (unsigned char*)subject); - x509write_add_validity(&cert, (unsigned char*)fstr, (unsigned char*)tstr); - fprintf(stderr, "Generating selfsigned certificate with subject '%s'" - " and validity %s-%s\n", subject, fstr, tstr); - if (x509write_create_selfsign(&cert, &rsa)) { - fprintf(stderr, "error: certificate generation failed\n"); - } - - if (x509write_crtfile(&cert, (unsigned char*)certpath, flag)) { - fprintf(stderr, "error: I/O error\n"); - return 1; - } - - x509write_free_raw(&cert); - rsa_free(&rsa); - return 0; -} - -int main(int argc, char *argv[]) { - urandom_fd = open("/dev/urandom", O_RDONLY); - if (urandom_fd < 0) { - perror("open(/dev/urandom)"); - return 1; - } - - if (!argv[1]) { - //Usage - } else if (!strcmp(argv[1], "rsakey")) { - return rsakey(argv+2); - } else if (!strcmp(argv[1], "selfsigned")) { - return selfsigned(argv+2); - } - - fprintf(stderr, - "PX5G X.509 Certificate Generator Utility v" PX5G_VERSION "\n" PX5G_COPY - "\nbased on PolarSSL by Christophe Devine and Paul Bakker\n\n"); - fprintf(stderr, "Usage: %s [rsakey|selfsigned]\n", *argv); - return 1; -} diff --git a/package/utils/px5g/Makefile b/package/utils/px5g/Makefile index d33938173c..6fd73e3a48 100644 --- a/package/utils/px5g/Makefile +++ b/package/utils/px5g/Makefile @@ -10,10 +10,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=px5g PKG_RELEASE:=4 PKG_LICENSE:=LGPL-2.1 -PKG_BUILD_DIR:=$(BUILD_DIR)/px5g +PKG_BUILD_DIR:=$(BUILD_DIR)/px5g-$(BUILD_VARIANT) PKG_USE_MIPS16:=0 +PKG_MAINTAINER:=Jo-Philipp Wich + include $(INCLUDE_DIR)/package.mk define Package/px5g-mbedtls @@ -21,9 +23,9 @@ define Package/px5g-mbedtls CATEGORY:=Utilities SUBMENU:=Encryption TITLE:=X.509 certificate generator (using mbedtls) - MAINTAINER:=Jo-Philipp Wich DEPENDS:=+libmbedtls PROVIDES:=px5g + VARIANT:=mbedtls endef define Package/px5g-mbedtls/description @@ -32,12 +34,27 @@ define Package/px5g-mbedtls/description and PEM format for use with stunnel, uhttpd and others. endef +define Package/px5g-standalone + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Encryption + TITLE:=X.509 certificate generator (standalone) + VARIANT:=standalone +endef +Package/px5g-standalone/description = $(Package/px5g-mbedtls/description) + define Build/Prepare mkdir -p $(PKG_BUILD_DIR) endef TARGET_LDFLAGS := -lmbedtls -lmbedx509 -lmbedcrypto +ifeq ($(BUILD_VARIANT),standalone) + TARGET_LDFLAGS := -Wl,-Bstatic $(TARGET_LDFLAGS) -Wl,-Bdynamic +endif + +TARGET_CFLAGS += -Wl,--gc-sections + define Build/Compile $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/px5g px5g.c $(TARGET_LDFLAGS) endef @@ -47,4 +64,7 @@ define Package/px5g-mbedtls/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/px5g $(1)/usr/sbin/px5g endef +Package/px5g-standalone/install = $(Package/px5g-mbedtls/install) + $(eval $(call BuildPackage,px5g-mbedtls)) +$(eval $(call BuildPackage,px5g-standalone)) diff --git a/package/utils/ugps/Makefile b/package/utils/ugps/Makefile index 07769e1516..9dc33ca9eb 100644 --- a/package/utils/ugps/Makefile +++ b/package/utils/ugps/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ugps -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL=$(LEDE_GIT)/project/ugps.git PKG_SOURCE_PROTO:=git diff --git a/package/utils/ugps/files/gps.config b/package/utils/ugps/files/gps.config index eb00d79c60..d4bd69afff 100644 --- a/package/utils/ugps/files/gps.config +++ b/package/utils/ugps/files/gps.config @@ -1,3 +1,3 @@ config gps option 'tty' 'ttyACM0' - option 'adjust_time ' '1' + option 'adjust_time' '1' diff --git a/scripts/download.pl b/scripts/download.pl index 21b63f1256..de6bc59faf 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -82,7 +82,7 @@ sub download_cmd($) { } return $have_curl - ? (qw(curl --connect-timeout 20 --retry 5 --location --insecure), shellwords($ENV{CURL_OPTIONS} || ''), $url) + ? (qw(curl -f --connect-timeout 20 --retry 5 --location --insecure), shellwords($ENV{CURL_OPTIONS} || ''), $url) : (qw(wget --tries=5 --timeout=20 --no-check-certificate --output-document=-), shellwords($ENV{WGET_OPTIONS} || ''), $url) ; } @@ -266,7 +266,7 @@ foreach my $mirror (@ARGV) { } #push @mirrors, 'http://mirror1.openwrt.org'; -push @mirrors, 'https://librecmc.org/librecmc/downloads/sources/v1.4/'; +push @mirrors, 'https://librecmc.org/librecmc/downloads/sources/v1.4'; push @mirrors, 'http://sources.lede-project.org'; push @mirrors, 'http://mirror2.openwrt.org/sources'; push @mirrors, 'http://downloads.openwrt.org/sources'; diff --git a/scripts/feeds b/scripts/feeds index 83007f5e16..dfecaa9bb6 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -9,7 +9,8 @@ use strict; use Cwd 'abs_path'; chdir "$FindBin::Bin/.."; -$ENV{TOPDIR}=getcwd(); +$ENV{TOPDIR} //= getcwd(); +chdir $ENV{TOPDIR}; $ENV{GIT_CONFIG_PARAMETERS}="'core.autocrlf=false'"; $ENV{GREP_OPTIONS}=""; diff --git a/scripts/gen-dependencies.sh b/scripts/gen-dependencies.sh index c6b6f75f55..0aa01b78ec 100755 --- a/scripts/gen-dependencies.sh +++ b/scripts/gen-dependencies.sh @@ -19,7 +19,7 @@ XARGS="${XARGS:-xargs -r}" } find $TARGETS -type f -a -exec file {} \; | \ - sed -n -e 's/^\(.*\):.*ELF.*\(executable\|shared object\).*,.* stripped/\1/p' | \ + sed -n -e 's/^\(.*\):.*ELF.*\(executable\|shared object\).*,.*/\1/p' | \ $XARGS -n1 $READELF -d | \ awk '$2 ~ /NEEDED/ && $NF !~ /interpreter/ && $NF ~ /^\[?lib.*\.so/ { gsub(/[\[\]]/, "", $NF); print $NF }' | \ sort -u diff --git a/scripts/get_source_date_epoch.sh b/scripts/get_source_date_epoch.sh index ea8d930109..84ba445454 100755 --- a/scripts/get_source_date_epoch.sh +++ b/scripts/get_source_date_epoch.sh @@ -17,9 +17,14 @@ try_git() { try_hg() { [ -d .hg ] || return 1 - SOURCE_DATE_EPOCH="" + SOURCE_DATE_EPOCH="$(hg log --template '{date}' -l 1 | cut -d. -f1)" [ -n "$SOURCE_DATE_EPOCH" ] } -try_version || try_git || try_hg || SOURCE_DATE_EPOCH="" +try_mtime() { + perl -e 'print((stat $ARGV[0])[9])' "$0" + [ -n "$SOURCE_DATE_EPOCH" ] +} + +try_version || try_git || try_hg || try_mtime || SOURCE_DATE_EPOCH="" echo "$SOURCE_DATE_EPOCH" diff --git a/scripts/getver.sh b/scripts/getver.sh index 60843be4f6..9175f411db 100755 --- a/scripts/getver.sh +++ b/scripts/getver.sh @@ -12,7 +12,7 @@ try_version() { } try_git() { - REBOOT=375587f4b29039d86880030c6ab9a135e0342567 + REBOOT=ee53a240ac902dc83209008a2671e7fdcf55957a git rev-parse --git-dir >/dev/null 2>&1 || return 1 [ -n "$GET_REV" ] || GET_REV="HEAD" @@ -40,7 +40,8 @@ try_git() { REV="${UPSTREAM_REV}+$((REV - UPSTREAM_REV))" fi - REV="${REV:+r$REV-$(git log --format="%h" -1)}" + REV="${REV:+r$REV-$(git log -n 1 --format="%h" $UPSTREAM_BASE)}" + ;; esac diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh index bb30252aa0..a96adf9bc8 100644 --- a/scripts/om-fwupgradecfg-gen.sh +++ b/scripts/om-fwupgradecfg-gen.sh @@ -7,7 +7,7 @@ # usage() { - echo "Usage: $0 " + echo "Usage: $0 " rm -f $CFG_OUT exit 1 } @@ -26,7 +26,7 @@ case $CE_TYPE in FLASH_BS=262144 MD5_SKIP_BLOCKS=1 ;; - OM5P|OM5PAC|MR600|MR900|MR1750) + OM5P|OM5PAC|MR600|MR900|MR1750|A60) MAX_PART_SIZE=7808 KERNEL_FLASH_ADDR=0xb0000 FLASH_BS=65536 diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index f8f16f07fa..2da32c770e 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -215,11 +215,13 @@ sub mconf_depends { $flags =~ /@/ or $depend = "PACKAGE_$depend"; } } + if ($condition) { if ($m =~ /select/) { next if $depend eq $condition; $depend = "$depend if $condition"; } else { + next if $dep->{"$depend if $condition"}; $depend = "!($condition) || $depend" unless $dep->{$condition} eq 'select'; } } diff --git a/scripts/rstrip.sh b/scripts/rstrip.sh index 4e4232db60..55caefc1a8 100755 --- a/scripts/rstrip.sh +++ b/scripts/rstrip.sh @@ -21,7 +21,7 @@ TARGETS=$* } find $TARGETS -type f -a -exec file {} \; | \ - sed -n -e 's/^\(.*\):.*ELF.*\(executable\|relocatable\|shared object\).*,.* stripped/\1:\2/p' | \ + sed -n -e 's/^\(.*\):.*ELF.*\(executable\|relocatable\|shared object\).*,.*/\1:\2/p' | \ ( IFS=":" while read F S; do diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index 7f7dc6d4ee..31de3c74c8 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -203,13 +203,14 @@ endchoice choice prompt "Target Profile" + default TARGET_MULTI_PROFILE if BUILDBOT EOF foreach my $target (@target) { my $profile = $target->{profiles}->[0]; $profile or next; print <{conf}_$profile->{id} if TARGET_$target->{conf} + default TARGET_$target->{conf}_$profile->{id} if TARGET_$target->{conf} && !BUILDBOT EOF } @@ -256,9 +257,11 @@ menu "Target Devices" config TARGET_ALL_PROFILES bool "Enable all profiles by default" + default BUILDBOT config TARGET_PER_DEVICE_ROOTFS bool "Use a per-device root filesystem that adds profile packages" + default BUILDBOT help When disabled, all device packages from all selected devices will be included in all images by default. (Marked as <*>) You will diff --git a/target/imagebuilder/Config.in b/target/imagebuilder/Config.in index 0862f36032..49bb741f73 100644 --- a/target/imagebuilder/Config.in +++ b/target/imagebuilder/Config.in @@ -1,6 +1,7 @@ config IB - bool "Build the libreCMC Image Builder" + bool "Build the LEDE Image Builder" depends on !EXTERNAL_TOOLCHAIN + default BUILDBOT help This is essentially a stripped-down version of the buildroot with precompiled packages, kernel image and image building tools. @@ -8,7 +9,7 @@ config IB config IB_STANDALONE bool "Include package repositories" - default y + default y if !BUILDBOT depends on IB help Disabling this option will cause the ImageBuilder to embed only diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile index 8a7c2093b9..d891aab18c 100644 --- a/target/imagebuilder/Makefile +++ b/target/imagebuilder/Makefile @@ -66,6 +66,8 @@ endif $(PKG_BUILD_DIR)/target/linux/*/patches{,-*} -cp $(KERNEL_BUILD_DIR)/* $(IB_KDIR)/ # don't copy subdirectories here -cp $(LINUX_DIR)/.config $(IB_LDIR)/ + rm -f $(IB_KDIR)/root.* + rm -f $(IB_KDIR)/vmlinux.debug if [ -x $(LINUX_DIR)/scripts/dtc/dtc ]; then \ $(INSTALL_DIR) $(IB_LDIR)/scripts/dtc; \ $(INSTALL_BIN) $(LINUX_DIR)/scripts/dtc/dtc $(IB_LDIR)/scripts/dtc/dtc; \ diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile index 493012ff72..af633b2163 100644 --- a/target/imagebuilder/files/Makefile +++ b/target/imagebuilder/files/Makefile @@ -74,7 +74,7 @@ include $(INCLUDE_DIR)/target.mk USER_PROFILE ?= $(firstword $(PROFILE_NAMES)) PROFILE_LIST = $(foreach p,$(PROFILE_NAMES), \ - echo '$(patsubst DEVICE_%,%,$(p)):'; $(if $($(p)_NAME),echo ' $($(p)_NAME)'; ) echo ' Packages: $($(p)_PACKAGES)'; \ + echo '$(patsubst DEVICE_%,%,$(p)):'; $(if $($(p)_NAME),echo ' $(subst ','"'"',$($(p)_NAME))'; ) echo ' Packages: $($(p)_PACKAGES)'; \ ) .profiles.mk: .targetinfo diff --git a/target/linux/ar71xx/Makefile b/target/linux/ar71xx/Makefile index a8df2b036e..4341a9a47a 100644 --- a/target/linux/ar71xx/Makefile +++ b/target/linux/ar71xx/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk ARCH:=mips BOARD:=ar71xx BOARDNAME:=Atheros AR7xxx/AR9xxx -FEATURES:=mips16 +FEATURES:= CPU_TYPE:=24kc SUBTARGETS:=generic nand mikrotik diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index 5a2bf0cfc4..f622929f7c 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -11,6 +11,14 @@ board_config_update board=$(ar71xx_board_name) case "$board" in +a40) + ucidef_set_led_default "status-red" "Status (red)" "a40:red:status" "0" + ucidef_set_led_default "status-blue" "Status (blue)" "a40:blue:status" "0" + ;; +a60) + ucidef_set_led_default "status-red" "Status (red)" "a60:red:status" "0" + ucidef_set_led_default "status-blue" "Status (blue)" "a60:blue:status" "0" + ;; airgateway|\ airgatewaypro) ucidef_set_led_wlan "wlan" "WLAN" "ubnt:blue:wlan" "phy0tpt" @@ -201,6 +209,9 @@ rb-750) ucidef_set_led_switch "port4" "port4" "rb750:green:port4" "switch0" "0x04" ucidef_set_led_switch "port5" "port5" "rb750:green:port5" "switch0" "0x02" ;; +rb-941-2nd) + ucidef_set_led_timer "act" "act" "rb:green:act" "1000" "1000" + ;; rb-2011l|\ rb-2011uas|\ rb-2011uias|\ @@ -388,9 +399,11 @@ nbg6716) ;; om2p|\ om2pv2|\ +om2pv4|\ om2p-hs|\ om2p-hsv2|\ om2p-hsv3|\ +om2p-hsv4|\ om2p-lc) ucidef_set_led_netdev "port1" "port1" "om2p:blue:wan" "eth0" ucidef_set_led_netdev "port2" "port2" "om2p:blue:lan" "eth1" diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index 66274db15f..10f84bf717 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -45,7 +45,6 @@ ar71xx_setup_interfaces() tl-wr741nd|\ tl-wr741nd-v4|\ tl-wr841n-v11|\ - tl-wr841n-v7|\ tl-wr841n-v9|\ tl-wr842n-v3|\ whr-g301n|\ @@ -84,6 +83,7 @@ ar71xx_setup_interfaces() mr900v2|\ mynet-rext|\ rb-411|\ + rb-411u|\ rb-911g-2hpnd|\ rb-911g-5hpacd|\ rb-911g-5hpnd|\ @@ -118,6 +118,8 @@ ar71xx_setup_interfaces() wp543) ucidef_set_interface_lan "eth0" ;; + a40|\ + a60|\ alfa-ap96|\ alfa-nx|\ gl-ar150|\ @@ -126,6 +128,8 @@ ar71xx_setup_interfaces() gl-inet|\ gl-mifi|\ jwap003|\ + om2pv4|\ + om2p-hsv4|\ pb42|\ pb44|\ rb-951ui-2hnd|\ @@ -239,6 +243,10 @@ ar71xx_setup_interfaces() dap-2695-a1) ucidef_add_switch "switch0" "0@eth0" "2:lan" "3:wan" "6@eth1" ;; + rb-941-2nd) + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1" + ;; db120|\ rb-2011l|\ rb-2011uas|\ @@ -272,7 +280,6 @@ ar71xx_setup_interfaces() tl-wr941nd-v5|\ tl-wr941nd-v6|\ wnr1000-v2|\ - wnr2000-v3|\ wnr2000-v4|\ wnr2200|\ wnr612-v2|\ @@ -322,7 +329,8 @@ ar71xx_setup_interfaces() ucidef_add_switch "switch0" \ "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan" ;; - gl-ar300) + gl-ar300|\ + wnr2000-v3) ucidef_set_interfaces_lan_wan "eth1" "eth0" ucidef_add_switch "switch0" \ "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" @@ -392,6 +400,11 @@ ar71xx_setup_interfaces() ucidef_set_interface_raw "eth" "eth0" ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" ;; + tl-wr841n-v7) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" + ;; tl-wr842n-v2) ucidef_set_interfaces_lan_wan "eth1" "eth0" ucidef_add_switch "switch0" \ @@ -407,10 +420,13 @@ ar71xx_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:lan" "3:wan" ;; - wndr3700) + wndr3700|\ + wndr3700v2|\ + wndr3800|\ + wndr3800ch) ucidef_set_interfaces_lan_wan "eth0" "eth1" ucidef_add_switch "switch0" \ - "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0" + "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0" ucidef_add_switch_attr "switch0" "blinkrate" 2 ucidef_add_switch_port_attr "switch0" 1 led 6 diff --git a/target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches b/target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches index da963bf64d..66be8e76d5 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches @@ -25,7 +25,7 @@ wbs510) ;; rb-912uag-2hpnd|\ rb-912uag-5hpnd) - ucidef_add_gpio_switch "usb_power_switch" "USB Power Switch" "52" + ucidef_add_gpio_switch "usb_power_switch" "USB Power Switch" "52" "1" ;; esac diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index d060ccf6e2..7b8aac8f8e 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -8,6 +8,12 @@ get_status_led() { local board=$(ar71xx_board_name) case $board in + a40) + status_led="a40:green:status" + ;; + a60) + status_led="a60:green:status" + ;; alfa-nx) status_led="alfa:green:led_8" ;; @@ -238,9 +244,11 @@ get_status_led() { ;; om2p|\ om2pv2|\ + om2pv4|\ om2p-hs|\ om2p-hsv2|\ om2p-hsv3|\ + om2p-hsv4|\ om2p-lc) status_led="om2p:blue:power" ;; @@ -288,7 +296,7 @@ get_status_led() { rb-912uag-5hpnd) status_led="rb:green:user" ;; - rb-951ui-2hnd) + rb-951ui-2hnd | rb-941-2nd) status_led="rb:green:act" ;; rb-sxt2n|\ diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index a4f426e142..b3e23c9a8f 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -76,6 +76,8 @@ case "$FIRMWARE" in ath10kcal_extract "art" 20480 2116 ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -1) ;; + a40 | \ + a60 | \ mr1750 | \ mr1750v2 | \ om5p-acv2) diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 1b30f4d827..b035535a42 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -382,6 +382,12 @@ ar71xx_board_detect() { *"Oolite V1.0") name="oolite" ;; + *"A40") + name="a40" + ;; + *"A60") + name="a60" + ;; *"AC1750DB") name="f9k1115v2" ;; @@ -736,6 +742,9 @@ ar71xx_board_detect() { *OM2Pv2) name="om2pv2" ;; + *OM2Pv4) + name="om2pv4" + ;; *"OM2P HS") name="om2p-hs" ;; @@ -745,6 +754,9 @@ ar71xx_board_detect() { *"OM2P HSv3") name="om2p-hsv3" ;; + *"OM2P HSv4") + name="om2p-hsv4" + ;; *"OM2P LC") name="om2p-lc" ;; @@ -835,6 +847,9 @@ ar71xx_board_detect() { *"RouterBOARD 912UAG-5HPnD") name="rb-912uag-5hpnd" ;; + *"RouterBOARD 941-2nD") + name="rb-941-2nd" + ;; *"RouterBOARD 951G-2HnD") name="rb-951g-2hnd" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh index 87b65165b4..6085b300a0 100644 --- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh @@ -41,13 +41,21 @@ platform_check_image_target_openmesh() img_board_target="$1" case "$img_board_target" in + A60) + [ "$board" = "a40" ] && return 0 + [ "$board" = "a60" ] && return 0 + echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" + return 1 + ;; OM2P) [ "$board" = "om2p" ] && return 0 [ "$board" = "om2pv2" ] && return 0 + [ "$board" = "om2pv4" ] && return 0 [ "$board" = "om2p-lc" ] && return 0 [ "$board" = "om2p-hs" ] && return 0 [ "$board" = "om2p-hsv2" ] && return 0 [ "$board" = "om2p-hsv3" ] && return 0 + [ "$board" = "om2p-hsv4" ] && return 0 echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" return 1 ;; @@ -177,7 +185,7 @@ platform_do_upgrade_openmesh() kernel_start_addr1=0x9f1c0000 kernel_start_addr2=0x9f8c0000 ;; - OM5P|OM5PAC|MR600|MR900|MR1750) + OM5P|OM5PAC|MR600|MR900|MR1750|A60) block_size=$((64 * 1024)) total_size=7995392 kernel_start_addr1=0x9f0b0000 diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 6341a31791..4f479ce858 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -7,10 +7,13 @@ PART_NAME=firmware RAMFS_COPY_DATA=/lib/ar71xx.sh +[ -x /usr/sbin/nandwrite ] && RAMFS_COPY_BIN=/usr/sbin/nandwrite CI_BLKSZ=65536 CI_LDADR=0x80060000 +PLATFORM_DO_UPGRADE_COMBINED_SEPARATE_MTD=0 + platform_find_partitions() { local first dev size erasesize name while read dev size erasesize name; do @@ -40,6 +43,13 @@ platform_find_kernelpart() { done } +platform_find_rootfspart() { + local part + for part in "${1%:*}" "${1#*:}"; do + [ "$part" != "$2" ] && echo "$part" && break + done +} + platform_do_upgrade_combined() { local partitions=$(platform_find_partitions) local kernelpart=$(platform_find_kernelpart "${partitions#*:}") @@ -53,13 +63,22 @@ platform_do_upgrade_combined() { [ ${root_blocks:-0} -gt 0 ] && \ [ ${erase_size:-0} -gt 0 ]; then + local rootfspart=$(platform_find_rootfspart "$partitions" "$kernelpart") local append="" [ -f "$CONF_TAR" -a "$SAVE_CONFIG" -eq 1 ] && append="-j $CONF_TAR" - ( dd if="$1" bs=$CI_BLKSZ skip=1 count=$kern_blocks 2>/dev/null; \ - dd if="$1" bs=$CI_BLKSZ skip=$((1+$kern_blocks)) count=$root_blocks 2>/dev/null ) | \ - mtd -r $append -F$kernelpart:$kern_length:$CI_LDADR,rootfs write - $partitions + if [ "$PLATFORM_DO_UPGRADE_COMBINED_SEPARATE_MTD" -ne 1 ]; then + ( dd if="$1" bs=$CI_BLKSZ skip=1 count=$kern_blocks 2>/dev/null; \ + dd if="$1" bs=$CI_BLKSZ skip=$((1+$kern_blocks)) count=$root_blocks 2>/dev/null ) | \ + mtd -r $append -F$kernelpart:$kern_length:$CI_LDADR,rootfs write - $partitions + elif [ -n "$rootfspart" ]; then + dd if="$1" bs=$CI_BLKSZ skip=1 count=$kern_blocks 2>/dev/null | \ + mtd write - $kernelpart + dd if="$1" bs=$CI_BLKSZ skip=$((1+$kern_blocks)) count=$root_blocks 2>/dev/null | \ + mtd -r $append write - $rootfspart + fi fi + PLATFORM_DO_UPGRADE_COMBINED_SEPARATE_MTD=0 } tplink_get_image_hwid() { @@ -164,6 +183,15 @@ alfa_check_image() { return 0 } +platform_nand_board_name() { + local board=$(ar71xx_board_name) + + case "$board" in + rb*) echo "routerboard";; + *) echo "$board";; + esac +} + platform_check_image() { local board=$(ar71xx_board_name) local magic="$(get_magic_word "$1")" @@ -308,6 +336,7 @@ platform_check_image() { ls-sr71|\ pb42|\ pb44|\ + rb-941-2nd|\ routerstation-pro|\ routerstation|\ wp543|\ @@ -443,6 +472,10 @@ platform_check_image() { tew-673gru) dir825b_check_image "$1" && return 0 ;; + rb*) + nand_do_platform_check routerboard $1 + return $? + ;; c-60|\ nbg6716|\ r6100|\ @@ -459,6 +492,8 @@ platform_check_image() { tplink_pharos_check_image "$1" && return 0 return 1 ;; + a40|\ + a60|\ mr1750v2|\ mr1750|\ mr600v2|\ @@ -467,9 +502,11 @@ platform_check_image() { mr900|\ om2p-hsv2|\ om2p-hsv3|\ + om2p-hsv4|\ om2p-hs|\ om2p-lc|\ om2pv2|\ + om2pv4|\ om2p|\ om5p-acv2|\ om5p-ac|\ @@ -570,6 +607,9 @@ platform_pre_upgrade() { local board=$(ar71xx_board_name) case "$board" in + rb-941-2nd) + ;; + rb*|\ c-60|\ nbg6716|\ r6100|\ @@ -584,10 +624,29 @@ platform_pre_upgrade() { esac } +platform_nand_pre_upgrade() { + local board=$(ar71xx_board_name) + + case "$board" in + rb*) + CI_KERNPART=none + local fw_mtd=$(find_mtd_part kernel) + fw_mtd="${fw_mtd/block/}" + [ -n "$fw_mtd" ] || return + mtd erase kernel + tar xf "$1" sysupgrade-routerboard/kernel -O | nandwrite -o "$fw_mtd" - + ;; + esac +} + platform_do_upgrade() { local board=$(ar71xx_board_name) case "$board" in + rb-941-2nd) + PLATFORM_DO_UPGRADE_COMBINED_SEPARATE_MTD=1 + platform_do_upgrade_combined "$ARGV" + ;; all0258n) platform_do_upgrade_allnet "0x9f050000" "$ARGV" ;; @@ -614,6 +673,8 @@ platform_do_upgrade() { tew-673gru) platform_do_upgrade_dir825b "$ARGV" ;; + a40|\ + a60|\ mr1750v2|\ mr1750|\ mr600v2|\ @@ -622,9 +683,11 @@ platform_do_upgrade() { mr900|\ om2p-hsv2|\ om2p-hsv3|\ + om2p-hsv4|\ om2p-hs|\ om2p-lc|\ om2pv2|\ + om2pv4|\ om2p|\ om5p-acv2|\ om5p-ac|\ diff --git a/target/linux/ar71xx/base-files/sbin/wget2nand b/target/linux/ar71xx/base-files/sbin/wget2nand deleted file mode 100755 index c80e21ccc7..0000000000 --- a/target/linux/ar71xx/base-files/sbin/wget2nand +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/sh -# wget2nand -# This script can be used to download a TGZ file from your build system which -# contains the files to be installed on the NAND flash on your RB1xx card. -# The one parameter is the URL of the TGZ file to be downloaded. -# Licence GPL V2 -# Author david.goodenough@linkchoose.co.uk -# Based on cf2nand from RB532 support -. /lib/functions.sh - -wget2nand_dir=/tmp/wget2nand -mnt_kernel=$wget2nand_dir/mnt_kernel -mnt_rootfs=$wget2nand_dir/mnt_rootfs -src_rootfs=$wget2nand_dir/rootfs.tgz -src_kernel=$wget2nand_dir/kernel - -[ -d "$wget2nand_dir" ] && { - echo "$wget2nand_dir already exists" - exit 1 -} - -# need to find the wget server from the command line -url=$1 -[ -z "$url" ] && { - echo "No URL specified for image TGZ" - echo "Usage : $0 URL" - exit 1 -} - -url_kernel=$url/lede-ar71xx-mikrotik-vmlinux-lzma.elf -url_rootfs=$url/lede-ar71xx-mikrotik-defaultnowifi-rootfs.tar.gz - -mtd_kernel="$(find_mtd_part 'kernel')" -mtd_rootfs="$(find_mtd_part 'rootfs')" -[ -z "$mtd_kernel" -o -z "$mtd_rootfs" ] && { - echo "Cannot find NAND Flash partitions" - exit 1 -} - -mkdir "$wget2nand_dir" -wget $url_kernel -O "$src_kernel" || { - echo "Unable to download $url_kernel" - exit 1 -} - -wget $url_rootfs -O "$src_rootfs" || { - echo "Unable to download $url_rootfs" - exit 1 -} - -echo "Erasing filesystem..." -mtd erase kernel 2>/dev/null >/dev/null -mtd erase rootfs 2>/dev/null >/dev/null - -echo "Mounting $mtd_rootfs as new root and $mtd_kernel as kernel partition" - -mkdir "$mnt_kernel" -mkdir "$mnt_rootfs" -mount -t yaffs2 "$mtd_kernel" "$mnt_kernel" -mount -t yaffs2 "$mtd_rootfs" "$mnt_rootfs" - -echo "Copying kernel..." -cp $src_kernel $mnt_kernel/kernel || { - echo "Error occured while copying the kernel" - exit 1 -} -chmod +x $mnt_kernel/kernel - -echo "Preparing filesystem..." -( cd "$mnt_rootfs"; tar xvz -f "$src_rootfs" ) - -# make sure everything is written before we unmount the partitions -echo "chmod ugo+x /" > $mnt_rootfs/etc/uci-defaults/set_root_permission -sync -ls $mnt_kernel >/dev/null -ls $mnt_rootfs >/dev/null - -echo "Cleaning up..." -# unmount the partitions and remove the directories into which they were mounted -umount $mnt_kernel -umount $mnt_rootfs -rm -rf $wget2nand_dir - -# all done -echo "Image written, you can now reboot. Remember to change the boot source to Boot from Nand" diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 4b2f736a86..ff6bb135d1 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -32,6 +32,7 @@ CONFIG_ATH79_DEV_NFC=y CONFIG_ATH79_DEV_SPI=y CONFIG_ATH79_DEV_USB=y CONFIG_ATH79_DEV_WMAC=y +CONFIG_ATH79_MACH_A60=y CONFIG_ATH79_MACH_ALFA_AP120C=y CONFIG_ATH79_MACH_ALFA_AP96=y CONFIG_ATH79_MACH_ALFA_NX=y @@ -143,6 +144,7 @@ CONFIG_ATH79_MACH_R6100=y # CONFIG_ATH79_MACH_RB750 is not set # CONFIG_ATH79_MACH_RB91X is not set # CONFIG_ATH79_MACH_RB922 is not set +# CONFIG_ATH79_MACH_RB941 is not set # CONFIG_ATH79_MACH_RB95X is not set # CONFIG_ATH79_MACH_RBSXTLITE is not set CONFIG_ATH79_MACH_RE450=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index 21d6b51897..894367fbb9 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -1,3 +1,13 @@ +config ATH79_MACH_A60 + bool "OpenMesh A40/A60 board support" + select SOC_QCA955X + select ATH79_DEV_AP9X_PCI if PCI + select ATH79_DEV_ETH + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_WMAC + select ATH79_DEV_USB + config ATH79_MACH_ALFA_AP120C bool "ALFA Network AP120C board support" select ATH79_DEV_AP9X_PCI if PCI @@ -860,6 +870,16 @@ config ATH79_MACH_RB922 select ATH79_ROUTERBOOT select RLE_DECOMPRESS +config ATH79_MACH_RB941 + bool "MikroTik RouterBOARD 941-2nd support" + select SOC_QCA953X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_WMAC + select ATH79_ROUTERBOOT + config ATH79_MACH_RB95X bool "MikroTik RouterBOARD 95X support" select SOC_AR934X @@ -978,6 +998,7 @@ config ATH79_MACH_OM2P bool "OpenMesh OM2P board support" select SOC_AR724X select SOC_AR933X + select SOC_QCA953X select ATH79_DEV_AP9X_PCI if PCI select ATH79_DEV_ETH select ATH79_DEV_GPIO_BUTTONS diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index 6384c0604c..c91d03ff21 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -38,6 +38,7 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += routerboot.o # # Machines # +obj-$(CONFIG_ATH79_MACH_A60) += mach-a60.o obj-$(CONFIG_ATH79_MACH_ALFA_AP120C) += mach-alfa-ap120c.o obj-$(CONFIG_ATH79_MACH_ALFA_AP96) += mach-alfa-ap96.o obj-$(CONFIG_ATH79_MACH_ALFA_NX) += mach-alfa-nx.o @@ -147,6 +148,7 @@ obj-$(CONFIG_ATH79_MACH_RB4XX) += mach-rb4xx.o obj-$(CONFIG_ATH79_MACH_RB750) += mach-rb750.o obj-$(CONFIG_ATH79_MACH_RB91X) += mach-rb91x.o obj-$(CONFIG_ATH79_MACH_RB922) += mach-rb922.o +obj-$(CONFIG_ATH79_MACH_RB941) += mach-rb941.o obj-$(CONFIG_ATH79_MACH_RB95X) += mach-rb95x.o obj-$(CONFIG_ATH79_MACH_RBSXTLITE) += mach-rbsxtlite.o obj-$(CONFIG_ATH79_MACH_RE450) += mach-re450.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c index 07cb12c8e9..790c2d3396 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c @@ -1075,7 +1075,7 @@ void __init ath79_register_eth(unsigned int id) if (pdata->phy_if_mode == PHY_INTERFACE_MODE_SGMII) pdata->set_speed = qca956x_set_speed_sgmii; else - pdata->set_speed = ath79_set_speed_ge0; + pdata->set_speed = ar934x_set_speed_ge0; } else { pdata->reset_bit = QCA955X_RESET_GE1_MAC | QCA955X_RESET_GE1_MDIO; diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-a60.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-a60.c new file mode 100644 index 0000000000..2f0a75f7bb --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-a60.c @@ -0,0 +1,181 @@ +/* + * OpenMesh A60 support + * + * Copyright (C) 2013 Marek Lindner + * Copyright (C) 2014-2017 Sven Eckelmann + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include "common.h" +#include "dev-ap9x-pci.h" +#include "dev-eth.h" +#include "dev-leds-gpio.h" +#include "dev-gpio-buttons.h" +#include "dev-m25p80.h" +#include "dev-wmac.h" +#include "machtypes.h" +#include "pci.h" +#include "dev-usb.h" + +#define A60_GPIO_LED_RED 22 +#define A60_GPIO_LED_GREEN 23 +#define A60_GPIO_LED_BLUE 13 + +#define A60_GPIO_BTN_RESET 17 + +#define A60_KEYS_POLL_INTERVAL 20 /* msecs */ +#define A60_KEYS_DEBOUNCE_INTERVAL (3 * A60_KEYS_POLL_INTERVAL) + +#define A60_WMAC_CALDATA_OFFSET 0x1000 + +static struct gpio_led a40_leds_gpio[] __initdata = { + { + .name = "a40:red:status", + .gpio = A60_GPIO_LED_RED, + }, { + .name = "a40:green:status", + .gpio = A60_GPIO_LED_GREEN, + }, { + .name = "a40:blue:status", + .gpio = A60_GPIO_LED_BLUE, + } +}; + +static struct gpio_led a60_leds_gpio[] __initdata = { + { + .name = "a60:red:status", + .gpio = A60_GPIO_LED_RED, + }, { + .name = "a60:green:status", + .gpio = A60_GPIO_LED_GREEN, + }, { + .name = "a60:blue:status", + .gpio = A60_GPIO_LED_BLUE, + } +}; + +static struct gpio_keys_button a60_gpio_keys[] __initdata = { + { + .desc = "Reset button", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = A60_KEYS_DEBOUNCE_INTERVAL, + .gpio = A60_GPIO_BTN_RESET, + .active_low = 1, + }, +}; + +static struct at803x_platform_data a60_at803x_data = { + .disable_smarteee = 1, + .enable_rgmii_rx_delay = 1, + .enable_rgmii_tx_delay = 1, +}; + +static struct mdio_board_info a60_mdio0_info[] = { + { + .bus_id = "ag71xx-mdio.0", + .phy_addr = 1, + .platform_data = &a60_at803x_data, + }, + { + .bus_id = "ag71xx-mdio.0", + .phy_addr = 2, + .platform_data = &a60_at803x_data, + }, +}; + +static void __init a60_setup_qca955x_eth_cfg(u32 mask, + unsigned int rxd, + unsigned int rxdv, + unsigned int txd, + unsigned int txe) +{ + void __iomem *base; + u32 t; + + base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE); + + t = mask; + t |= rxd << QCA955X_ETH_CFG_RXD_DELAY_SHIFT; + t |= rxdv << QCA955X_ETH_CFG_RDV_DELAY_SHIFT; + t |= txd << QCA955X_ETH_CFG_TXD_DELAY_SHIFT; + t |= txe << QCA955X_ETH_CFG_TXE_DELAY_SHIFT; + + __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG); + + iounmap(base); +} + +static void __init a60_setup_common(void) +{ + u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); + u8 mac[6]; + + ath79_register_usb(); + + ath79_register_m25p80(NULL); + ath79_register_gpio_keys_polled(-1, A60_KEYS_POLL_INTERVAL, + ARRAY_SIZE(a60_gpio_keys), + a60_gpio_keys); + + ath79_init_mac(mac, art, 0x02); + ath79_register_wmac(art + A60_WMAC_CALDATA_OFFSET, mac); + + a60_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN, 3, 3, 0, 0); + ath79_register_mdio(0, 0x0); + + mdiobus_register_board_info(a60_mdio0_info, ARRAY_SIZE(a60_mdio0_info)); + + ath79_init_mac(ath79_eth0_data.mac_addr, art, 0x00); + ath79_init_mac(ath79_eth1_data.mac_addr, art, 0x01); + + /* GMAC0 is connected to the PHY1 */ + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_eth0_data.phy_mask = BIT(1); + ath79_eth0_pll_data.pll_1000 = 0x82000101; + ath79_eth0_pll_data.pll_100 = 0x80000101; + ath79_eth0_pll_data.pll_10 = 0x80001313; + ath79_register_eth(0); + + /* GMAC1 is connected to MDIO1 in SGMII mode */ + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; + ath79_eth1_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_eth1_data.phy_mask = BIT(2); + ath79_eth1_pll_data.pll_1000 = 0x03000101; + ath79_eth1_pll_data.pll_100 = 0x80000101; + ath79_eth1_pll_data.pll_10 = 0x80001313; + ath79_eth1_data.speed = SPEED_1000; + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_register_eth(1); + + ath79_register_pci(); +} + +static void __init a40_setup(void) +{ + ath79_register_leds_gpio(-1, ARRAY_SIZE(a40_leds_gpio), a40_leds_gpio); + a60_setup_common(); +} + +MIPS_MACHINE(ATH79_MACH_A40, "A40", "OpenMesh A40", a40_setup); + +static void __init a60_setup(void) +{ + ath79_register_leds_gpio(-1, ARRAY_SIZE(a60_leds_gpio), a60_leds_gpio); + a60_setup_common(); +} + +MIPS_MACHINE(ATH79_MACH_A60, "A60", "OpenMesh A60", a60_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c index 3b282a36ea..c888f7d1a8 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c @@ -46,6 +46,16 @@ #define OM2P_LC_GPIO_LED_WAN 17 #define OM2P_LC_GPIO_BTN_RESET 12 +#define OM2Pv4_GPIO_LED_POWER 0 +#define OM2Pv4_GPIO_LED_GREEN 2 +#define OM2Pv4_GPIO_LED_RED 4 +#define OM2Pv4_GPIO_LED_YELLOW 3 +#define OM2Pv4_GPIO_LED_LAN 14 +#define OM2Pv4_GPIO_LED_WAN 13 +#define OM2Pv4_GPIO_BTN_RESET 1 + +#define OM2P_WMAC_CALDATA_OFFSET 0x1000 + static struct flash_platform_data om2p_flash_data = { .type = "s25sl12800", .name = "ar7240-nor0", @@ -224,3 +234,87 @@ static void __init om2p_hs_setup(void) MIPS_MACHINE(ATH79_MACH_OM2P_HS, "OM2P-HS", "OpenMesh OM2P HS", om2p_hs_setup); MIPS_MACHINE(ATH79_MACH_OM2P_HSv2, "OM2P-HSv2", "OpenMesh OM2P HSv2", om2p_hs_setup); MIPS_MACHINE(ATH79_MACH_OM2P_HSv3, "OM2P-HSv3", "OpenMesh OM2P HSv3", om2p_hs_setup); + +static struct flash_platform_data om2pv4_flash_data = { + .type = "s25sl12800", +}; + +static struct gpio_led om2pv4_leds_gpio[] __initdata = { + { + .name = "om2p:blue:power", + .gpio = OM2Pv4_GPIO_LED_POWER, + .active_low = 1, + }, { + .name = "om2p:red:wifi", + .gpio = OM2Pv4_GPIO_LED_RED, + .active_low = 1, + }, { + .name = "om2p:yellow:wifi", + .gpio = OM2Pv4_GPIO_LED_YELLOW, + .active_low = 1, + }, { + .name = "om2p:green:wifi", + .gpio = OM2Pv4_GPIO_LED_GREEN, + .active_low = 1, + }, { + .name = "om2p:blue:lan", + .gpio = OM2Pv4_GPIO_LED_LAN, + .active_low = 1, + }, { + .name = "om2p:blue:wan", + .gpio = OM2Pv4_GPIO_LED_WAN, + .active_low = 1, + } +}; + +static struct gpio_keys_button om2pv4_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = OM2P_KEYS_DEBOUNCE_INTERVAL, + .gpio = OM2Pv4_GPIO_BTN_RESET, + .active_low = 1, + } +}; + +static void __init om2pv4_setup(void) +{ + u8 *mac1 = (u8 *)KSEG1ADDR(0x1ffc0000); + u8 *mac2 = (u8 *)KSEG1ADDR(0x1ffc0000 + ETH_ALEN); + u8 *art = (u8 *)KSEG1ADDR(0x1ffc0000); + u8 wmac[6]; + + ath79_register_m25p80(&om2pv4_flash_data); + ath79_register_leds_gpio(-1, ARRAY_SIZE(om2pv4_leds_gpio), + om2pv4_leds_gpio); + ath79_register_gpio_keys_polled(-1, OM2P_KEYS_POLL_INTERVAL, + ARRAY_SIZE(om2pv4_gpio_keys), + om2pv4_gpio_keys); + + ath79_init_mac(wmac, art, 0x02); + ath79_register_wmac(art + OM2P_WMAC_CALDATA_OFFSET, wmac); + + ath79_setup_ar933x_phy4_switch(false, false); + + ath79_register_mdio(0, 0x0); + + /* LAN */ + ath79_switch_data.phy4_mii_en = 1; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.speed = SPEED_100; + ath79_eth0_data.phy_mask = BIT(4); + ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0); + ath79_register_eth(0); + + /* WAN */ + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_switch_data.phy_poll_mask |= BIT(4); + ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0); + ath79_register_eth(1); +} + +MIPS_MACHINE(ATH79_MACH_OM2Pv4, "OM2Pv4", "OpenMesh OM2Pv4", om2pv4_setup); +MIPS_MACHINE(ATH79_MACH_OM2P_HSv4, "OM2P-HSv4", "OpenMesh OM2P HSv4", om2pv4_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c index afd56085c7..0db359c9a1 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c @@ -94,7 +94,7 @@ static struct mtd_partition rb2011_nand_partitions[] = { .size = (4 * 1024 * 1024) - (256 * 1024), }, { - .name = "rootfs", + .name = "ubi", .offset = MTDPART_OFS_NXTBLK, .size = MTDPART_SIZ_FULL, }, diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c index 5656d3c1f1..c308f9521d 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c @@ -169,6 +169,9 @@ static void __init rb750_setup(void) rb750_nand_data.disable_pins = rb750_nand_disable_pins; rb750_nand_data.latch_change = rb750_latch_change; platform_device_register(&rb750_nand_device); + + /* USB */ + ath79_register_usb(); } MIPS_MACHINE(ATH79_MACH_RB_750, "750i", "MikroTik RouterBOARD 750", diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb922.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb922.c index c88c522b80..0c5373c365 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb922.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb922.c @@ -167,7 +167,7 @@ static struct mtd_partition rb922gs_nand_partitions[] = { .size = (4 * 1024 * 1024) - (256 * 1024), }, { - .name = "rootfs", + .name = "ubi", .offset = MTDPART_OFS_NXTBLK, .size = MTDPART_SIZ_FULL, }, diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb941.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb941.c new file mode 100644 index 0000000000..5da950bb88 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb941.c @@ -0,0 +1,173 @@ +/* + * MikroTik RouterBOARD 941-2nD support + * + * Copyright (C) 2016 Sergey Sergeev + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +//#include +#include + +#include +#include +#include + +#include "common.h" +#include "dev-ap9x-pci.h" +#include "dev-eth.h" +#include "dev-spi.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +//#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" +#include "routerboot.h" + +#define RB941_GPIO_LED_ACT 14 +#define RB941_GPIO_BTN_RESET 16 + +#define RB941_KEYS_POLL_INTERVAL 20 /* msecs */ +#define RB941_KEYS_DEBOUNCE_INTERVAL (3 * RB941_KEYS_POLL_INTERVAL) + +#define RB_ROUTERBOOT_OFFSET 0x0000 +#define RB_ROUTERBOOT_SIZE 0xe000 +#define RB_HARD_CFG_OFFSET 0xe000 +#define RB_HARD_CFG_SIZE 0x1000 +#define RB_BIOS_OFFSET 0xf000 +#define RB_BIOS_SIZE 0x1000 +#define RB_ROUTERBOOT2_OFFSET 0x10000 +#define RB_ROUTERBOOT2_SIZE 0xf000 +#define RB_SOFT_CFG_OFFSET 0x1f000 +#define RB_SOFT_CFG_SIZE 0x1000 +#define RB_ROOTFS_OFFSET 0x20000 +#define RB_ROOTFS_SIZE 0x9e0000 +#define RB_KERNEL_OFFSET 0xa00000 +#define RB_KERNEL_SIZE MTDPART_SIZ_FULL + +void __init rb941_wlan_init(void) +{ + char *art_buf; + u8 wlan_mac[ETH_ALEN]; + + art_buf = rb_get_wlan_data(); + if (art_buf == NULL) + return; + + ath79_init_mac(wlan_mac, ath79_mac_base, 11); + ath79_register_wmac(art_buf + 0x1000, wlan_mac); + + kfree(art_buf); +} + +static struct mtd_partition rb941_spi_partitions[] = { + { + .name = "routerboot", + .offset = RB_ROUTERBOOT_OFFSET, + .mask_flags = MTD_WRITEABLE, + .size = RB_ROUTERBOOT_SIZE, + }, { + .name = "hard_config", + .offset = RB_HARD_CFG_OFFSET, + .size = RB_HARD_CFG_SIZE, + .mask_flags = MTD_WRITEABLE, + }, { + .name = "bios", + .offset = RB_BIOS_OFFSET, + .size = RB_BIOS_SIZE, + .mask_flags = MTD_WRITEABLE, + }, { + .name = "routerboot2", + .offset = RB_ROUTERBOOT2_OFFSET, + .size = RB_ROUTERBOOT2_SIZE, + .mask_flags = MTD_WRITEABLE, + }, { + .name = "soft_config", + .offset = RB_SOFT_CFG_OFFSET, + .size = RB_SOFT_CFG_SIZE, + }, { + .name = "rootfs", + .offset = RB_ROOTFS_OFFSET, + .size = RB_ROOTFS_SIZE, + }, { + .name = "kernel", + .offset = RB_KERNEL_OFFSET, + .size = RB_KERNEL_SIZE, + } +}; + +static struct flash_platform_data rb941_spi_flash_data = { + .parts = rb941_spi_partitions, + .nr_parts = ARRAY_SIZE(rb941_spi_partitions), +}; + +static struct gpio_led rb941_leds[] __initdata = { + { + .name = "rb:green:act", + .gpio = RB941_GPIO_LED_ACT, + .active_low = 1, + }, +}; + +static struct gpio_keys_button rb941_gpio_keys[] __initdata = { + { + .desc = "Reset button", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = RB941_KEYS_DEBOUNCE_INTERVAL, + .gpio = RB941_GPIO_BTN_RESET, + .active_low = 1, + }, +}; + +static void __init rb941_setup(void) +{ + const struct rb_info *info; + //try to get rb_info data + info = rb_init_info((void *)(KSEG1ADDR(AR71XX_SPI_BASE)), 0x20000); + if (!info){ + pr_err("%s: Can't get rb_info data from flash!\n", __func__); + //return -EINVAL; //Not critical ... continue! + } + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_ONLY_MODE); + ath79_register_m25p80(&rb941_spi_flash_data); + ath79_register_mdio(0, 0x0); + + /* WAN. We have no WAN. Only LAN. */ + /*ath79_switch_data.phy4_mii_en = 1; + ath79_switch_data.phy_poll_mask = BIT(4); + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(4); + ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0); + ath79_register_eth(0); */ + + /* LAN */ + ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 0); + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_register_eth(1); + + //ath79_register_usb(); + + rb941_wlan_init(); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(rb941_leds), rb941_leds); + ath79_register_gpio_keys_polled(-1, RB941_KEYS_POLL_INTERVAL, + ARRAY_SIZE(rb941_gpio_keys), + rb941_gpio_keys); +} + +MIPS_MACHINE(ATH79_MACH_RB_941, "H951L", "MikroTik RouterBOARD 941-2nD", rb941_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c index c2261ab9f1..05e15e77e1 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c @@ -53,7 +53,7 @@ static struct mtd_partition rb95x_nand_partitions[] = { .size = (4 * 1024 * 1024) - (256 * 1024), }, { - .name = "rootfs", + .name = "ubi", .offset = MTDPART_OFS_NXTBLK, .size = MTDPART_SIZ_FULL, }, diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbsxtlite.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbsxtlite.c index 94e0b4483e..129195dde6 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbsxtlite.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbsxtlite.c @@ -69,7 +69,7 @@ static struct mtd_partition rbsxtlite_nand_partitions[] = { .size = (4 * 1024 * 1024) - (256 * 1024), }, { - .name = "rootfs", + .name = "ubi", .offset = MTDPART_OFS_NXTBLK, .size = MTDPART_SIZ_FULL, }, diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 9402185b9c..b9a8e3e4e0 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -17,6 +17,8 @@ enum ath79_mach_type { ATH79_MACH_GENERIC_OF = -1, /* Device tree board */ ATH79_MACH_GENERIC = 0, + ATH79_MACH_A40, /* OpenMesh A40 */ + ATH79_MACH_A60, /* OpenMesh A60 */ ATH79_MACH_ALFA_AP120C, /* ALFA Network AP120C board */ ATH79_MACH_ALFA_AP96, /* ALFA Network AP96 board */ ATH79_MACH_ALFA_NX, /* ALFA Network N2/N5 board */ @@ -128,9 +130,11 @@ enum ath79_mach_type { ATH79_MACH_NBG6716, /* Zyxel NBG6716 */ ATH79_MACH_OM2P, /* OpenMesh OM2P */ ATH79_MACH_OM2Pv2, /* OpenMesh OM2Pv2 */ + ATH79_MACH_OM2Pv4, /* OpenMesh OM2Pv4 */ ATH79_MACH_OM2P_HS, /* OpenMesh OM2P-HS */ ATH79_MACH_OM2P_HSv2, /* OpenMesh OM2P-HSv2 */ ATH79_MACH_OM2P_HSv3, /* OpenMesh OM2P-HSv3 */ + ATH79_MACH_OM2P_HSv4, /* OpenMesh OM2P-HSv4 */ ATH79_MACH_OM2P_LC, /* OpenMesh OM2P-LC */ ATH79_MACH_OM5P, /* OpenMesh OM5P */ ATH79_MACH_OM5P_AC, /* OpenMesh OM5P-AC */ @@ -162,6 +166,7 @@ enum ath79_mach_type { ATH79_MACH_RB_751, /* MikroTik RouterBOARD 751 */ ATH79_MACH_RB_751G, /* Mikrotik RouterBOARD 751G */ ATH79_MACH_RB_922GS, /* Mikrotik RouterBOARD 911/922GS boards */ + ATH79_MACH_RB_941, /* MikroTik RouterBOARD 941-2nD */ ATH79_MACH_RB_951G, /* Mikrotik RouterBOARD 951G */ ATH79_MACH_RB_951U, /* Mikrotik RouterBOARD 951Ui-2HnD */ ATH79_MACH_RB_SXTLITE2ND, /* Mikrotik RouterBOARD SXT Lite 2nD */ diff --git a/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c b/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c index f2b430ec4b..96ec5dd1e5 100644 --- a/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c +++ b/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c @@ -65,7 +65,7 @@ static struct mtd_partition rb4xx_nand_partitions[] = { .size = (4 * 1024 * 1024) - (256 * 1024), }, { - .name = "rootfs", + .name = "ubi", .offset = MTDPART_OFS_NXTBLK, .size = MTDPART_SIZ_FULL, }, diff --git a/target/linux/ar71xx/files/drivers/mtd/nand/rb750_nand.c b/target/linux/ar71xx/files/drivers/mtd/nand/rb750_nand.c index a9b287be10..0604c5a235 100644 --- a/target/linux/ar71xx/files/drivers/mtd/nand/rb750_nand.c +++ b/target/linux/ar71xx/files/drivers/mtd/nand/rb750_nand.c @@ -71,7 +71,7 @@ static struct mtd_partition rb750_nand_partitions[] = { .offset = (256 * 1024), .size = (4 * 1024 * 1024) - (256 * 1024), }, { - .name = "rootfs", + .name = "ubi", .offset = MTDPART_OFS_NXTBLK, .size = MTDPART_SIZ_FULL, }, diff --git a/target/linux/ar71xx/files/drivers/mtd/nand/rb91x_nand.c b/target/linux/ar71xx/files/drivers/mtd/nand/rb91x_nand.c index bfc5d4dca0..1308e18ba6 100644 --- a/target/linux/ar71xx/files/drivers/mtd/nand/rb91x_nand.c +++ b/target/linux/ar71xx/files/drivers/mtd/nand/rb91x_nand.c @@ -78,7 +78,7 @@ static struct mtd_partition rb91x_nand_partitions[] = { .offset = (256 * 1024), .size = (4 * 1024 * 1024) - (256 * 1024), }, { - .name = "rootfs", + .name = "ubi", .offset = MTDPART_OFS_NXTBLK, .size = MTDPART_SIZ_FULL, }, diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index b9c3fc350f..8eac5fc997 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -21,6 +21,9 @@ endif ifeq ($(SUBTARGET),nand) include ./nand.mk endif +ifeq ($(SUBTARGET),mikrotik) +include ./mikrotik.mk +endif include ./legacy.mk define Build/netgear-squashfs diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index e2867e6c40..810e96b672 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -579,7 +579,7 @@ define Build/uImageHiWiFi mkimage -A $(LINUX_KARCH) \ -O linux -T kernel \ -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ - -n 'tw150v1 $(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION)' -d $@ $@.new + -n 'tw150v1 $(call toupper,$(LINUX_KARCH)) libreCMC Linux-$(LINUX_VERSION)' -d $@ $@.new @mv $@.new $@ endef @@ -680,7 +680,7 @@ define Build/mkwrggimg $(STAGING_DIR_HOST)/bin/mkwrggimg -b \ -i $@ -o $@.imghdr -d /dev/mtdblock/1 \ -m $(BOARDNAME) -s $(DAP_SIGNATURE) \ - -v LEDE -B $(REVISION) + -v libreCMC -B $(REVISION) mv $@.imghdr $@ endef @@ -722,6 +722,6 @@ define Device/bhr-4grv2 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware) IMAGES := sysupgrade.bin factory.bin IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | pad-to $$$$(ROOTFS_SIZE) | append-kernel | check-size $$$$(IMAGE_SIZE) - IMAGE/factory.bin = append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | mkbuffaloimg + IMAGE/factory.bin = append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | mkbuffaloimg endef TARGET_DEVICES += bhr-4grv2 diff --git a/target/linux/ar71xx/image/legacy-devices.mk b/target/linux/ar71xx/image/legacy-devices.mk index 3f865da43f..87423ce55c 100644 --- a/target/linux/ar71xx/image/legacy-devices.mk +++ b/target/linux/ar71xx/image/legacy-devices.mk @@ -1,3 +1,10 @@ +define LegacyDevice/A60 + DEVICE_TITLE := OpenMesh A40/A60 + DEVICE_PACKAGES := om-watchdog kmod-ath10k ath10k-firmware-qca988x \ + mod-usb-core kmod-usb2 +endef +LEGACY_DEVICES += A60 + define LegacyDevice/ALFANX DEVICE_TITLE := ALFA Network N2/N5 board endef @@ -469,7 +476,7 @@ endef LEGACY_DEVICES += WPN824N define LegacyDevice/OM2P - DEVICE_TITLE := OpenMesh OM2P/OM2Pv2/OM2P-HS/OM2P-HSv2/OM2P-HSv3/OM2P-LC + DEVICE_TITLE := OpenMesh OM2P/OM2P-HS/OM2P-LC DEVICE_PACKAGES := om-watchdog endef LEGACY_DEVICES += OM2P @@ -481,7 +488,7 @@ endef LEGACY_DEVICES += OM5P define LegacyDevice/OM5PAC - DEVICE_TITLE := OpenMesh OM5P-AC/OM5P-ACv2 + DEVICE_TITLE := OpenMesh OM5P-AC DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x om-watchdog endef LEGACY_DEVICES += OM5PAC @@ -493,14 +500,14 @@ endef LEGACY_DEVICES += MR600 define LegacyDevice/MR900 - DEVICE_TITLE := OpenMesh MR900/MR900v2 + DEVICE_TITLE := OpenMesh MR900 DEVICE_PACKAGES := om-watchdog endef LEGACY_DEVICES += MR900 define LegacyDevice/MR1750 - DEVICE_TITLE := OpenMesh MR1750/MR1750v2 - DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x + DEVICE_TITLE := OpenMesh MR1750 + DEVICE_PACKAGES := om-watchdog kmod-ath10k ath10k-firmware-qca988x endef LEGACY_DEVICES += MR1750 diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk index f80b700be8..c94bc26e38 100644 --- a/target/linux/ar71xx/image/legacy.mk +++ b/target/linux/ar71xx/image/legacy.mk @@ -984,6 +984,7 @@ $(eval $(call SingleProfile,Netgear,64kraw,REALWNR1000V2,wnr1000v2,WNR1000V2,tty $(eval $(call SingleProfile,Netgear,64kraw,WNR1000V2_VC,wnr1000v2-vc,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303030,WNR1000V2-VC,"",)) $(eval $(call SingleProfile,Netgear,64kraw,WPN824N,wpn824n,WPN824N,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31313030,WPN824N,"" NA,)) +$(eval $(call SingleProfile,OpenMesh,squashfs-only,A60,a60,,,,A60)) $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2p,,,,OM2P)) $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5P,om5p,,,,OM5P)) $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5PAC,om5pac,,,,OM5PAC)) diff --git a/target/linux/ar71xx/image/mikrotik.mk b/target/linux/ar71xx/image/mikrotik.mk new file mode 100644 index 0000000000..6aa7c2a1ae --- /dev/null +++ b/target/linux/ar71xx/image/mikrotik.mk @@ -0,0 +1,44 @@ +define Device/mikrotik + PROFILES := Default + DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport nand-utils + BOARD_NAME := routerboard + KERNEL_INITRAMFS := + KERNEL_NAME := loader-generic.elf + KERNEL := kernel-bin | kernel2minor -s 2048 -e -c + FILESYSTEMS := squashfs + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := sysupgrade-tar +endef + +define Device/nand-64m + DEVICE_TITLE := MikroTik RouterBoard with 64 MB NAND flash +$(Device/mikrotik) + KERNEL := kernel-bin | kernel2minor -s 512 -e -c +endef + +define Device/nand-large + DEVICE_TITLE := MikroTik RouterBoard with >= 128 MB NAND flash +$(Device/mikrotik) + KERNEL := kernel-bin | kernel2minor -s 2048 -e -c +endef + +TARGET_DEVICES += nand-64m nand-large + +define Device/rb-nor-flash-16M + DEVICE_TITLE := MikroTik RouterBoard with 16 MB NOR flash + DEVICE_PACKAGES := rbcfg + BLOCKSIZE := 64k + IMAGE_SIZE := 16000k + LOADER_TYPE := elf + KERNEL_INSTALL := 1 + KERNEL := kernel-bin | lzma | loader-kernel | kernel2minor -s 1024 -e + KERNEL_INITRAMFS := kernel-bin | lzma | loader-kernel + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | combined-image | check-size $$$$(IMAGE_SIZE) +endef + +define Device/rb-941-2nd +$(Device/rb-nor-flash-16M) + DEVICE_TITLE := hAP lite + BOARDNAME:= rb-941-2nd +endef diff --git a/target/linux/ar71xx/image/nand.mk b/target/linux/ar71xx/image/nand.mk index e66014e663..ce1b067c55 100644 --- a/target/linux/ar71xx/image/nand.mk +++ b/target/linux/ar71xx/image/nand.mk @@ -71,7 +71,7 @@ TARGET_DEVICES += z1 define LegacyDevice/R6100 DEVICE_TITLE := NETGEAR R6100 - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport endef LEGACY_DEVICES += R6100 diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default index 3e7cfd5f27..44ea327fb1 100644 --- a/target/linux/ar71xx/mikrotik/config-default +++ b/target/linux/ar71xx/mikrotik/config-default @@ -1,33 +1,62 @@ # CONFIG_ATH79_DEV_DSA is not set +# CONFIG_ATH79_MACH_ALFA_AP120C is not set # CONFIG_ATH79_MACH_ALFA_AP96 is not set # CONFIG_ATH79_MACH_ALFA_NX is not set # CONFIG_ATH79_MACH_ALL0258N is not set # CONFIG_ATH79_MACH_ALL0315N is not set # CONFIG_ATH79_MACH_ANTMINER_S1 is not set +# CONFIG_ATH79_MACH_ANTMINER_S3 is not set +# CONFIG_ATH79_MACH_ANTROUTER_R1 is not set # CONFIG_ATH79_MACH_AP121 is not set # CONFIG_ATH79_MACH_AP132 is not set # CONFIG_ATH79_MACH_AP136 is not set +# CONFIG_ATH79_MACH_AP143 is not set # CONFIG_ATH79_MACH_AP147 is not set +# CONFIG_ATH79_MACH_AP152 is not set +# CONFIG_ATH79_MACH_AP90Q is not set # CONFIG_ATH79_MACH_AP96 is not set # CONFIG_ATH79_MACH_ARCHER_C7 is not set +# CONFIG_ATH79_MACH_ARDUINO_YUN is not set # CONFIG_ATH79_MACH_AW_NR580 is not set +# CONFIG_ATH79_MACH_BHR_4GRV2 is not set # CONFIG_ATH79_MACH_BHU_BXU2000N2_A is not set +# CONFIG_ATH79_MACH_BSB is not set +# CONFIG_ATH79_MACH_C55 is not set +# CONFIG_ATH79_MACH_C60 is not set # CONFIG_ATH79_MACH_CAP324 is not set # CONFIG_ATH79_MACH_CAP4200AG is not set # CONFIG_ATH79_MACH_CARAMBOLA2 is not set +# CONFIG_ATH79_MACH_CF_E316N_V2 is not set +# CONFIG_ATH79_MACH_CF_E320N_V2 is not set +# CONFIG_ATH79_MACH_CF_E380AC_V1 is not set +# CONFIG_ATH79_MACH_CF_E380AC_V2 is not set +# CONFIG_ATH79_MACH_CF_E520N is not set +# CONFIG_ATH79_MACH_CF_E530N is not set # CONFIG_ATH79_MACH_CPE510 is not set +# CONFIG_ATH79_MACH_CPE830 is not set +# CONFIG_ATH79_MACH_CPE870 is not set # CONFIG_ATH79_MACH_CR3000 is not set # CONFIG_ATH79_MACH_CR5000 is not set +# CONFIG_ATH79_MACH_DAP_2695_A1 is not set # CONFIG_ATH79_MACH_DB120 is not set # CONFIG_ATH79_MACH_DGL_5500_A1 is not set # CONFIG_ATH79_MACH_DHP_1565_A1 is not set # CONFIG_ATH79_MACH_DIR_505_A1 is not set # CONFIG_ATH79_MACH_DIR_600_A1 is not set # CONFIG_ATH79_MACH_DIR_615_C1 is not set +# CONFIG_ATH79_MACH_DIR_615_I1 is not set # CONFIG_ATH79_MACH_DIR_825_B1 is not set # CONFIG_ATH79_MACH_DIR_825_C1 is not set # CONFIG_ATH79_MACH_DIR_869_A1 is not set +# CONFIG_ATH79_MACH_DLAN_HOTSPOT is not set +# CONFIG_ATH79_MACH_DLAN_PRO_1200_AC is not set +# CONFIG_ATH79_MACH_DLAN_PRO_500_WP is not set +# CONFIG_ATH79_MACH_DOMYWIFI_DW33D is not set +# CONFIG_ATH79_MACH_DR344 is not set +# CONFIG_ATH79_MACH_DR531 is not set # CONFIG_ATH79_MACH_DRAGINO2 is not set +# CONFIG_ATH79_MACH_E2100L is not set +# CONFIG_ATH79_MACH_EAP120 is not set # CONFIG_ATH79_MACH_EAP300V2 is not set # CONFIG_ATH79_MACH_EAP7660D is not set # CONFIG_ATH79_MACH_EL_M150 is not set @@ -37,15 +66,24 @@ # CONFIG_ATH79_MACH_ESR900 is not set # CONFIG_ATH79_MACH_EW_DORIN is not set # CONFIG_ATH79_MACH_F9K1115V2 is not set +# CONFIG_ATH79_MACH_GL_AR150 is not set +# CONFIG_ATH79_MACH_GL_AR300 is not set +# CONFIG_ATH79_MACH_GL_AR300M is not set +# CONFIG_ATH79_MACH_GL_DOMINO is not set # CONFIG_ATH79_MACH_GL_INET is not set +# CONFIG_ATH79_MACH_GL_MIFI is not set +# CONFIG_ATH79_MACH_GS_MINIBOX_V1 is not set # CONFIG_ATH79_MACH_GS_OOLITE is not set # CONFIG_ATH79_MACH_HIWIFI_HC6361 is not set # CONFIG_ATH79_MACH_HORNET_UB is not set # CONFIG_ATH79_MACH_JA76PF is not set # CONFIG_ATH79_MACH_JWAP003 is not set +# CONFIG_ATH79_MACH_JWAP230 is not set # CONFIG_ATH79_MACH_MC_MAC1200R is not set # CONFIG_ATH79_MACH_MR12 is not set # CONFIG_ATH79_MACH_MR16 is not set +# CONFIG_ATH79_MACH_MR1750 is not set +# CONFIG_ATH79_MACH_MR18 is not set # CONFIG_ATH79_MACH_MR600 is not set # CONFIG_ATH79_MACH_MR900 is not set # CONFIG_ATH79_MACH_MYNET_N600 is not set @@ -57,6 +95,11 @@ # CONFIG_ATH79_MACH_NBG6716 is not set # CONFIG_ATH79_MACH_OM2P is not set # CONFIG_ATH79_MACH_OM5P is not set +# CONFIG_ATH79_MACH_OM5P_AC is not set +# CONFIG_ATH79_MACH_OM5P_ACv2 is not set +# CONFIG_ATH79_MACH_OMY_G1 is not set +# CONFIG_ATH79_MACH_OMY_X1 is not set +# CONFIG_ATH79_MACH_ONION_OMEGA is not set # CONFIG_ATH79_MACH_PB42 is not set # CONFIG_ATH79_MACH_PB44 is not set # CONFIG_ATH79_MACH_QIHOO_C301 is not set @@ -66,27 +109,37 @@ CONFIG_ATH79_MACH_RB4XX=y CONFIG_ATH79_MACH_RB750=y CONFIG_ATH79_MACH_RB91X=y CONFIG_ATH79_MACH_RB922=y +CONFIG_ATH79_MACH_RB941=y CONFIG_ATH79_MACH_RB95X=y CONFIG_ATH79_MACH_RBSXTLITE=y # CONFIG_ATH79_MACH_RE450 is not set # CONFIG_ATH79_MACH_RW2458N is not set # CONFIG_ATH79_MACH_SMART_300 is not set +# CONFIG_ATH79_MACH_SOM9331 is not set +# CONFIG_ATH79_MACH_SR3200 is not set +# CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE is not set # CONFIG_ATH79_MACH_TEW_632BRP is not set # CONFIG_ATH79_MACH_TEW_673GRU is not set # CONFIG_ATH79_MACH_TEW_712BR is not set # CONFIG_ATH79_MACH_TEW_732BR is not set +# CONFIG_ATH79_MACH_TEW_823DRU is not set # CONFIG_ATH79_MACH_TL_MR11U is not set # CONFIG_ATH79_MACH_TL_MR13U is not set # CONFIG_ATH79_MACH_TL_MR3020 is not set # CONFIG_ATH79_MACH_TL_MR3X20 is not set # CONFIG_ATH79_MACH_TL_WA701ND_V2 is not set # CONFIG_ATH79_MACH_TL_WA7210N_V2 is not set +# CONFIG_ATH79_MACH_TL_WA801ND_V3 is not set # CONFIG_ATH79_MACH_TL_WA830RE_V2 is not set # CONFIG_ATH79_MACH_TL_WA901ND is not set # CONFIG_ATH79_MACH_TL_WA901ND_V2 is not set +# CONFIG_ATH79_MACH_TL_WA901ND_V4 is not set # CONFIG_ATH79_MACH_TL_WAX50RE is not set +# CONFIG_ATH79_MACH_TL_WDR3320_V2 is not set # CONFIG_ATH79_MACH_TL_WDR3500 is not set # CONFIG_ATH79_MACH_TL_WDR4300 is not set +# CONFIG_ATH79_MACH_TL_WDR6500_V2 is not set +# CONFIG_ATH79_MACH_TL_WPA8630 is not set # CONFIG_ATH79_MACH_TL_WR1041N_V2 is not set # CONFIG_ATH79_MACH_TL_WR1043ND is not set # CONFIG_ATH79_MACH_TL_WR1043ND_V2 is not set @@ -97,15 +150,18 @@ CONFIG_ATH79_MACH_RBSXTLITE=y # CONFIG_ATH79_MACH_TL_WR741ND is not set # CONFIG_ATH79_MACH_TL_WR741ND_V4 is not set # CONFIG_ATH79_MACH_TL_WR802N_V1 is not set +# CONFIG_ATH79_MACH_TL_WR810N is not set # CONFIG_ATH79_MACH_TL_WR841N_V1 is not set # CONFIG_ATH79_MACH_TL_WR841N_V8 is not set # CONFIG_ATH79_MACH_TL_WR841N_V9 is not set -# CONFIG_ATH79_MACH_TL_WR941ND is not set # CONFIG_ATH79_MACH_TL_WR940N_V4 is not set +# CONFIG_ATH79_MACH_TL_WR941ND is not set +# CONFIG_ATH79_MACH_TL_WR941ND_V6 is not set # CONFIG_ATH79_MACH_TUBE2H is not set # CONFIG_ATH79_MACH_UBNT is not set # CONFIG_ATH79_MACH_UBNT_UNIFIAC is not set # CONFIG_ATH79_MACH_UBNT_XM is not set +# CONFIG_ATH79_MACH_WEIO is not set # CONFIG_ATH79_MACH_WHR_HP_G300N is not set # CONFIG_ATH79_MACH_WLAE_AG300N is not set # CONFIG_ATH79_MACH_WLR8100 is not set @@ -124,24 +180,28 @@ CONFIG_ATH79_MACH_RBSXTLITE=y # CONFIG_ATH79_MACH_WPJ558 is not set # CONFIG_ATH79_MACH_WRT160NL is not set # CONFIG_ATH79_MACH_WRT400N is not set +# CONFIG_ATH79_MACH_WRTNODE2Q is not set # CONFIG_ATH79_MACH_WZR_450HP2 is not set # CONFIG_ATH79_MACH_WZR_HP_AG300H is not set # CONFIG_ATH79_MACH_WZR_HP_G300NH is not set # CONFIG_ATH79_MACH_WZR_HP_G300NH2 is not set # CONFIG_ATH79_MACH_WZR_HP_G450H is not set +# CONFIG_ATH79_MACH_XD3200 is not set +# CONFIG_ATH79_MACH_Z1 is not set +# CONFIG_ATH79_MACH_ZBT_WE1526 is not set # CONFIG_ATH79_MACH_ZCN_1523H is not set # CONFIG_ATH79_NVRAM is not set CONFIG_ATH79_ROUTERBOOT=y -CONFIG_CMDLINE="rootfstype=yaffs noinitrd" +CONFIG_CMDLINE="rootfstype=squashfs noinitrd" +CONFIG_CRC16=y +CONFIG_CRYPTO_DEFLATE=y CONFIG_GPIO_74X164=y CONFIG_GPIO_LATCH=y -# CONFIG_JFFS2_FS is not set CONFIG_LEDS_RB750=y CONFIG_LZO_DECOMPRESS=y -CONFIG_MDIO_BITBANG=y -CONFIG_MDIO_GPIO=y # CONFIG_MTD_CFI is not set CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CYBERTAN_PARTS is not set CONFIG_MTD_MAP_BANK_WIDTH_1=y CONFIG_MTD_MAP_BANK_WIDTH_4=y # CONFIG_MTD_MYLOADER_PARTS is not set @@ -152,24 +212,22 @@ CONFIG_MTD_NAND_RB4XX=y CONFIG_MTD_NAND_RB750=y CONFIG_MTD_NAND_RB91X=y # CONFIG_MTD_REDBOOT_PARTS is not set -CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y # CONFIG_MTD_TPLINK_PARTS is not set -# CONFIG_OVERLAY_FS is not set +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +CONFIG_MTD_UBI_BLOCK=y +# CONFIG_MTD_UBI_FASTMAP is not set +# CONFIG_MTD_UBI_GLUEBI is not set +CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_RLE_DECOMPRESS=y # CONFIG_SOC_AR913X is not set # CONFIG_SOC_AR933X is not set -# CONFIG_SOC_QCA953X is not set +# CONFIG_SOC_QCA956X is not set CONFIG_SPI_RB4XX=y CONFIG_SPI_RB4XX_CPLD=y -# CONFIG_SQUASHFS is not set -CONFIG_YAFFS_9BYTE_TAGS=y -CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED=y -CONFIG_YAFFS_AUTO_YAFFS2=y -# CONFIG_YAFFS_DISABLE_BACKGROUND is not set -# CONFIG_YAFFS_DISABLE_BLOCK_REFRESHING is not set -# CONFIG_YAFFS_DISABLE_TAGS_ECC is not set -# CONFIG_YAFFS_EMPTY_LOST_AND_FOUND is not set -CONFIG_YAFFS_FS=y -CONFIG_YAFFS_XATTR=y -CONFIG_YAFFS_YAFFS1=y -CONFIG_YAFFS_YAFFS2=y +CONFIG_UBIFS_FS=y +CONFIG_UBIFS_FS_ADVANCED_COMPR=y +# CONFIG_UBIFS_FS_LZO is not set +CONFIG_UBIFS_FS_ZLIB=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/ar71xx/mikrotik/profiles/00-default.mk b/target/linux/ar71xx/mikrotik/profiles/00-default.mk new file mode 100644 index 0000000000..2b2670f07b --- /dev/null +++ b/target/linux/ar71xx/mikrotik/profiles/00-default.mk @@ -0,0 +1,18 @@ +# +# Copyright (C) 2009 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/Default + NAME:=Default Profile + PACKAGES:= \ + kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport nand-utils + PRIORITY := 1 +endef + +define Profile/Default/Description + Default package set compatible with most boards. +endef +$(eval $(call Profile,Default)) diff --git a/target/linux/ar71xx/mikrotik/profiles/01-minimal.mk b/target/linux/ar71xx/mikrotik/profiles/01-minimal.mk deleted file mode 100644 index a334977d48..0000000000 --- a/target/linux/ar71xx/mikrotik/profiles/01-minimal.mk +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright (C) 2009 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define Profile/DefaultNoWifi - NAME:=Default Profile (no WiFi) - PACKAGES:= - PRIORITY := 2 -endef - -define Profile/DefaultNoWifi/Description - Default package set compatible with most boards. -endef -$(eval $(call Profile,DefaultNoWifi)) diff --git a/target/linux/ar71xx/mikrotik/profiles/02-ath5k.mk b/target/linux/ar71xx/mikrotik/profiles/02-ath5k.mk deleted file mode 100644 index fa304b7d4c..0000000000 --- a/target/linux/ar71xx/mikrotik/profiles/02-ath5k.mk +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright (C) 2009-2012 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define Profile/Ath5k - NAME:=Atheros WiFi (ath5k) - PACKAGES:=kmod-ath5k -kmod-ath9k - PRIORITY := 3 -endef - -define Profile/Ath5k/Description - Package set compatible with hardware using Atheros WiFi cards. -endef -$(eval $(call Profile,Ath5k)) diff --git a/target/linux/ar71xx/mikrotik/target.mk b/target/linux/ar71xx/mikrotik/target.mk index cb2447aee8..90ef51e41b 100644 --- a/target/linux/ar71xx/mikrotik/target.mk +++ b/target/linux/ar71xx/mikrotik/target.mk @@ -1,5 +1,5 @@ BOARDNAME:=Mikrotik devices with NAND/NOR flash -FEATURES += targz ramdisk minor +FEATURES += squashfs ramdisk minor nand define Target/Description Build firmware images for Atheros AR71xx/AR913x based Mikrotik boards. diff --git a/target/linux/ar71xx/patches-4.4/500-MIPS-fw-myloader.patch b/target/linux/ar71xx/patches-4.4/500-MIPS-fw-myloader.patch index e877b0c947..811a234a2c 100644 --- a/target/linux/ar71xx/patches-4.4/500-MIPS-fw-myloader.patch +++ b/target/linux/ar71xx/patches-4.4/500-MIPS-fw-myloader.patch @@ -10,7 +10,7 @@ --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1117,6 +1117,9 @@ config MIPS_MSC +@@ -1118,6 +1118,9 @@ config MIPS_MSC config MIPS_NILE4 bool diff --git a/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch b/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch index 77bf38cc00..b5f46169a7 100644 --- a/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch +++ b/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch @@ -1,12 +1,14 @@ --- a/arch/mips/ath79/prom.c +++ b/arch/mips/ath79/prom.c -@@ -136,6 +136,16 @@ void __init prom_init(void) +@@ -136,6 +136,18 @@ void __init prom_init(void) initrd_end = initrd_start + fw_getenvl("initrd_size"); } #endif + + if (strstr(arcs_cmdline, "board=750Gr3") || + strstr(arcs_cmdline, "board=750i") || ++ strstr(arcs_cmdline, "board=411") || ++ strstr(arcs_cmdline, "board=433") || + strstr(arcs_cmdline, "board=450") || + strstr(arcs_cmdline, "board=493") || + strstr(arcs_cmdline, "board=951G") || diff --git a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch index 21cad91161..1e68cf72f5 100644 --- a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch +++ b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch @@ -267,16 +267,16 @@ case IPV6_2292HOPOPTS: --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c -@@ -394,7 +394,7 @@ static void ip6gre_err(struct sk_buff *s +@@ -395,7 +395,7 @@ static void ip6gre_err(struct sk_buff *s + return; + ipv6h = (const struct ipv6hdr *)skb->data; + greh = (const struct gre_base_hdr *)(skb->data + offset); +- key = key_off ? *(__be32 *)(skb->data + key_off) : 0; ++ key = key_off ? net_hdr_word((__be32 *)(skb->data + key_off)) : 0; t = ip6gre_tunnel_lookup(skb->dev, &ipv6h->daddr, &ipv6h->saddr, - flags & GRE_KEY ? -- *(((__be32 *)p) + (grehlen / 4) - 1) : 0, -+ net_hdr_word(((__be32 *)p) + (grehlen / 4) - 1) : 0, - p[1]); - if (!t) - return; -@@ -476,11 +476,11 @@ static int ip6gre_rcv(struct sk_buff *sk + key, greh->protocol); +@@ -479,11 +479,11 @@ static int ip6gre_rcv(struct sk_buff *sk offset += 4; } if (flags&GRE_KEY) { @@ -290,7 +290,7 @@ offset += 4; } } -@@ -742,7 +742,7 @@ static netdev_tx_t ip6gre_xmit2(struct s +@@ -745,7 +745,7 @@ static netdev_tx_t ip6gre_xmit2(struct s if (tunnel->parms.o_flags&GRE_SEQ) { ++tunnel->o_seqno; @@ -299,7 +299,7 @@ ptr--; } if (tunnel->parms.o_flags&GRE_KEY) { -@@ -838,7 +838,7 @@ static inline int ip6gre_xmit_ipv6(struc +@@ -841,7 +841,7 @@ static inline int ip6gre_xmit_ipv6(struc dsfield = ipv6_get_dsfield(ipv6h); if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS) @@ -310,7 +310,7 @@ if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK) --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c -@@ -1397,7 +1397,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1407,7 +1407,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str dsfield = ipv6_get_dsfield(ipv6h); if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS) @@ -491,7 +491,7 @@ memcpy(p, foc->val, foc->len); --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c -@@ -500,7 +500,7 @@ static struct sk_buff *add_grec(struct s +@@ -505,7 +505,7 @@ static struct sk_buff *add_grec(struct s if (!skb) return NULL; psrc = (__be32 *)skb_put(skb, sizeof(__be32)); @@ -610,7 +610,7 @@ goto next_ht; --- a/net/ipv6/ip6_offload.c +++ b/net/ipv6/ip6_offload.c -@@ -221,7 +221,7 @@ static struct sk_buff **ipv6_gro_receive +@@ -222,7 +222,7 @@ static struct sk_buff **ipv6_gro_receive continue; iph2 = (struct ipv6hdr *)(p->data + off); diff --git a/target/linux/arm64/Makefile b/target/linux/arm64/Makefile new file mode 100644 index 0000000000..6bf89a7194 --- /dev/null +++ b/target/linux/arm64/Makefile @@ -0,0 +1,28 @@ +# +# Copyright (C) 2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +ARCH:=aarch64 +BOARD:=arm64 +BOARDNAME:=ARMv8 multiplatform +FEATURES:=fpu ramdisk +CFLAGS:=-Os -pipe -fno-caller-saves +MAINTAINER:=Florian Fainelli + +KERNEL_PATCHVER:=4.4 + +DEVICE_TYPE:=developerboard + +define Target/Description + Build multi-platform images for the ARMv8 instruction set architecture +endef + +include $(INCLUDE_DIR)/target.mk + +KERNELNAME:=Image dtbs + +$(eval $(call BuildTarget)) diff --git a/target/linux/arm64/README b/target/linux/arm64/README new file mode 100644 index 0000000000..0328ca1607 --- /dev/null +++ b/target/linux/arm64/README @@ -0,0 +1,13 @@ +This multi-platform ARMv8 target can be used either with ARM Ltd.'s Foundation_V8 +fast-model doing the following: + +Foundation_v8 --image bin/arm64-eglibc/openwrt-arm64-vexpress-foundation.axf + +or you can also use QEMU: + +qemu-system-aarch64 -machine virt -cpu cortex-a57 -machine type=virt -nographic \ + -smp 1 -m 2048 \ + -kernel bin/arm64-eglibc/openwrt-arm64-qemu-virt-initramfs.Image \ + --append "console=ttyAMA0" + +and enjoy the system booting. diff --git a/target/linux/x86/xen_domu/base-files/etc/inittab b/target/linux/arm64/base-files/etc/inittab similarity index 58% rename from target/linux/x86/xen_domu/base-files/etc/inittab rename to target/linux/arm64/base-files/etc/inittab index 72e19c5b3d..be235d8792 100644 --- a/target/linux/x86/xen_domu/base-files/etc/inittab +++ b/target/linux/arm64/base-files/etc/inittab @@ -1,5 +1,5 @@ ::sysinit:/etc/init.d/rcS S boot -::shutdown:/etc/init.d/rcS K stop +::shutdown:/etc/init.d/rcS K shutdown tts/0::askfirst:/usr/libexec/login.sh -hvc0::askfirst:/usr/libexec/login.sh +ttyAMA0::askfirst:/usr/libexec/login.sh tty1::askfirst:/usr/libexec/login.sh diff --git a/target/linux/arm64/config-4.4 b/target/linux/arm64/config-4.4 new file mode 100644 index 0000000000..d3f7f754d4 --- /dev/null +++ b/target/linux/arm64/config-4.4 @@ -0,0 +1,350 @@ +CONFIG_64BIT=y +CONFIG_ACPI=y +CONFIG_ACPI_CCA_REQUIRED=y +# CONFIG_ACPI_CONTAINER is not set +# CONFIG_ACPI_CUSTOM_DSDT is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_DEBUGGER is not set +# CONFIG_ACPI_DOCK is not set +# CONFIG_ACPI_EC_DEBUGFS is not set +CONFIG_ACPI_FAN=y +CONFIG_ACPI_GENERIC_GSI=y +# CONFIG_ACPI_PCI_SLOT is not set +CONFIG_ACPI_PROCESSOR=y +CONFIG_ACPI_REDUCED_HARDWARE_ONLY=y +CONFIG_ACPI_THERMAL=y +# CONFIG_ARCH_BCM_IPROC is not set +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +# CONFIG_ARCH_EXYNOS7 is not set +CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y +CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y +CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_ARCH_HAS_TICK_BROADCAST=y +# CONFIG_ARCH_LAYERSCAPE is not set +CONFIG_ARCH_PHYS_ADDR_T_64BIT=y +CONFIG_ARCH_REQUIRE_GPIOLIB=y +# CONFIG_ARCH_SEATTLE is not set +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_DEFAULT=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +# CONFIG_ARCH_SPRD is not set +# CONFIG_ARCH_STRATIX10 is not set +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# CONFIG_ARCH_THUNDER is not set +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_VEXPRESS=y +CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y +CONFIG_ARCH_WANT_FRAME_POINTERS=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y +CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y +# CONFIG_ARCH_XGENE is not set +# CONFIG_ARCH_ZYNQMP is not set +CONFIG_ARM64=y +# CONFIG_ARM64_16K_PAGES is not set +CONFIG_ARM64_4K_PAGES=y +# CONFIG_ARM64_64K_PAGES is not set +# CONFIG_ARM64_CRYPTO is not set +CONFIG_ARM64_ERRATUM_819472=y +CONFIG_ARM64_ERRATUM_824069=y +CONFIG_ARM64_ERRATUM_826319=y +CONFIG_ARM64_ERRATUM_827319=y +CONFIG_ARM64_ERRATUM_832075=y +CONFIG_ARM64_ERRATUM_843419=y +CONFIG_ARM64_ERRATUM_845719=y +CONFIG_ARM64_HW_AFDBM=y +# CONFIG_ARM64_LSE_ATOMICS is not set +CONFIG_ARM64_PAN=y +# CONFIG_ARM64_PTDUMP is not set +# CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET is not set +CONFIG_ARM64_VA_BITS=39 +CONFIG_ARM64_VA_BITS_39=y +# CONFIG_ARM64_VA_BITS_48 is not set +# CONFIG_ARMV8_DEPRECATED is not set +CONFIG_ARM_AMBA=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +CONFIG_ARM_GIC=y +CONFIG_ARM_GIC_V3=y +CONFIG_ARM_PSCI_FW=y +# CONFIG_ARM_SP805_WATCHDOG is not set +CONFIG_ATOMIC64_SELFTEST=y +CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y +CONFIG_BLK_DEV_SD=y +CONFIG_BLOCK_COMPAT=y +CONFIG_BOUNCE=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_BUILD_BIN2C=y +# CONFIG_CAVIUM_ERRATUM_22375 is not set +# CONFIG_CAVIUM_ERRATUM_23144 is not set +# CONFIG_CAVIUM_ERRATUM_23154 is not set +# CONFIG_CAVIUM_ERRATUM_27456 is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKSRC_ACPI=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLKSRC_OF=y +CONFIG_CLKSRC_PROBE=y +CONFIG_CLK_SP810=y +CONFIG_CLK_VEXPRESS_OSC=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE="console=ttyAMA0" +CONFIG_COMMON_CLK=y +CONFIG_COMMON_CLK_VERSATILE=y +CONFIG_COMMON_CLK_XGENE=y +CONFIG_COMPAT=y +CONFIG_COMPAT_BINFMT_ELF=y +CONFIG_COMPAT_NETLINK_MESSAGES=y +CONFIG_COMPAT_OLD_SIGACTION=y +# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CPU_RMAP=y +CONFIG_CRC16=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_CUSE=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DEBUG_INFO=y +CONFIG_DEFAULT_IOSCHED="noop" +CONFIG_DEFAULT_NOOP=y +CONFIG_DTC=y +CONFIG_EDAC_SUPPORT=y +# CONFIG_EFI is not set +CONFIG_EXT4_FS=y +CONFIG_FAT_FS=y +CONFIG_FB=y +CONFIG_FB_ARMCLCD=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_CMDLINE=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +# CONFIG_FSL_MC_BUS is not set +CONFIG_FS_MBCACHE=y +CONFIG_FUSE_FS=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_CSUM=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_ACPI=y +# CONFIG_GPIO_AMDPT is not set +CONFIG_GPIO_DEVRES=y +CONFIG_GPIO_GENERIC=y +CONFIG_GPIO_GENERIC_PLATFORM=y +# CONFIG_GPIO_XGENE is not set +CONFIG_GRACE_PERIOD=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +CONFIG_HAVE_ARCH_BITREVERSE=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KASAN=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_BPF_JIT=y +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CMPXCHG_DOUBLE=y +CONFIG_HAVE_CMPXCHG_LOCAL=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_BUGVERBOSE=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_GENERIC_RCU_GUP=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MEMORY_PRESENT=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_PATA_PLATFORM=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_RCU_TABLE_FREE=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +# CONFIG_HPET is not set +# CONFIG_HUGETLBFS is not set +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_VIRTIO=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IOMMU_HELPER=y +# CONFIG_IOSCHED_DEADLINE is not set +CONFIG_IP_PNP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_IP_PNP_DHCP=y +# CONFIG_IP_PNP_RARP is not set +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_JBD2=y +CONFIG_LIBFDT=y +# CONFIG_LIQUIDIO is not set +CONFIG_LOCKD=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_LOGO=y +CONFIG_LOGO_LINUX_CLUT224=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_MFD_CORE=y +CONFIG_MFD_SYSCON=y +CONFIG_MFD_VEXPRESS_SYSREG=y +# CONFIG_MISC_FILESYSTEMS is not set +CONFIG_MMC=y +CONFIG_MMC_ARMMMCI=y +# CONFIG_MMC_TIFM_SD is not set +CONFIG_MODULES_USE_ELF_RELA=y +# CONFIG_MTD_PHYSMAP_OF is not set +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_SG_DMA_LENGTH=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NFS_FS=y +CONFIG_NLS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NO_BOOTMEM=y +CONFIG_NO_HZ=y +CONFIG_NO_HZ_COMMON=y +CONFIG_NO_HZ_IDLE=y +CONFIG_NR_CPUS=4 +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_MTD=y +CONFIG_OF_NET=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_OF_RESERVED_MEM=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_PCI=y +CONFIG_PCI_BUS_ADDR_T_64BIT=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +# CONFIG_PCI_HISI is not set +CONFIG_PCI_LABEL=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=3 +CONFIG_PHYS_ADDR_T_64BIT=y +# CONFIG_PHY_XGENE is not set +# CONFIG_PMIC_OPREGION is not set +CONFIG_PNP=y +CONFIG_PNPACPI=y +CONFIG_PNP_DEBUG_MESSAGES=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_VEXPRESS=y +# CONFIG_POWER_RESET_XGENE is not set +CONFIG_POWER_SUPPLY=y +# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_VOLUNTARY=y +CONFIG_PROFILING=y +CONFIG_RATIONAL=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_REGMAP=y +CONFIG_REGMAP_MMIO=y +CONFIG_RFS_ACCEL=y +CONFIG_ROOT_NFS=y +CONFIG_RPS=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_SCHED_HRTICK=y +# CONFIG_SCHED_INFO is not set +CONFIG_SCSI=y +# CONFIG_SCSI_LOWLEVEL is not set +# CONFIG_SCSI_PROC_FS is not set +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_8250_PNP=y +# CONFIG_SERIAL_AMBA_PL010 is not set +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SMC91X=y +CONFIG_SMP=y +CONFIG_SPARSEMEM=y +CONFIG_SPARSEMEM_EXTREME=y +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM_VMEMMAP=y +CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y +CONFIG_SPARSE_IRQ=y +CONFIG_SRCU=y +CONFIG_SUNRPC=y +# CONFIG_SWAP is not set +CONFIG_SWIOTLB=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_SYSVIPC_COMPAT=y +CONFIG_SYS_SUPPORTS_HUGETLBFS=y +CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THERMAL_OF=y +# CONFIG_THUNDER_NIC_BGX is not set +# CONFIG_THUNDER_NIC_PF is not set +# CONFIG_THUNDER_NIC_VF is not set +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TREE_RCU=y +CONFIG_VEXPRESS_CONFIG=y +CONFIG_VEXPRESS_SYSCFG=y +CONFIG_VFAT_FS=y +CONFIG_VIDEOMODE_HELPERS=y +CONFIG_VIRTIO=y +CONFIG_VIRTIO_BLK=y +# CONFIG_VIRTIO_CONSOLE is not set +CONFIG_VIRTIO_MMIO=y +# CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES is not set +CONFIG_VIRTIO_NET=y +CONFIG_XPS=y diff --git a/target/linux/arm64/image/Makefile b/target/linux/arm64/image/Makefile new file mode 100644 index 0000000000..cc04b183fc --- /dev/null +++ b/target/linux/arm64/image/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/image.mk + +define Image/Prepare + -rm -rf $(KDIR)/linux-system.axf + cp $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/Image $(KDIR)/Image + $(MAKE) -C boot-wrapper clean + $(MAKE) -C boot-wrapper compile +endef + +define Build/Clean + $(MAKE) -C boot-wrapper clean +endef + +define Image/Build/QemuVirt + $(CP) $(KDIR)/Image $(BIN_DIR)/$(IMG_PREFIX)-qemu-virt.Image +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + $(CP) $(KDIR)/Image-initramfs $(BIN_DIR)/$(IMG_PREFIX)-qemu-virt-initramfs.Image +endif +endef + +define Image/Build/VexpressFoundation + $(CP) $(KDIR)/linux-system.axf $(BIN_DIR)/$(IMG_PREFIX)-vexpress-foundation.axf +endef + +define Image/BuildKernel + $(call Image/Build/QemuVirt) + $(call Image/Build/VexpressFoundation) +endef + +define Image/Build/squashfs + $(call prepare_generic_squashfs,$(KDIR)/root.squashfs) +endef + +define Image/Build + $(call Image/Build/$(1)) + dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync +endef + +$(eval $(call BuildImage)) diff --git a/target/linux/arm64/image/boot-wrapper/Makefile b/target/linux/arm64/image/boot-wrapper/Makefile new file mode 100644 index 0000000000..cf16f8045d --- /dev/null +++ b/target/linux/arm64/image/boot-wrapper/Makefile @@ -0,0 +1,37 @@ +# +# Copyright (C) 2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=aarch64-boot-wrapper +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git +PKG_SOURCE_DATE:=2013-01-10 +PKG_SOURCE_VERSION:=c51dde817b5ed5b8f741b67ac51bd67bd87b4a2a +PKG_MIRROR_HASH:=2f029a20c906af68e9fe067c1b0ed394e4c455e142454a039f41d1d82d6e17c8 +PKG_MAINTAINER:=Florian Fainelli + +include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/image.mk + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + KERNEL="../Image" \ + DTC="$(LINUX_DIR)/scripts/dtc/dtc" \ + FDT_SRC="$(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts/arm/foundation-v8.dts" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + BOOTARGS="console=ttyAMA0 earlyprintk" +endef + +define Build/InstallDev + $(CP) $(PKG_BUILD_DIR)/linux-system.axf $(KDIR)/linux-system.axf +endef + +$(eval $(call Build/DefaultTargets)) diff --git a/target/linux/armvirt/Makefile b/target/linux/armvirt/Makefile new file mode 100644 index 0000000000..3fedcad0a0 --- /dev/null +++ b/target/linux/armvirt/Makefile @@ -0,0 +1,28 @@ +# +# Copyright (C) 2016 Yousong Zhou +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +ARCH:=arm +BOARD:=armvirt +BOARDNAME:=QEMU ARM Virtual Machine +FEATURES:=fpu pci rtc usb +FEATURES+=cpiogz ext4 ramdisk squashfs targz +CPU_TYPE:=cortex-a15 +CPU_SUBTYPE:=neon-vfpv4 +MAINTAINER:=Yousong Zhou + +KERNEL_PATCHVER:=4.4 + +define Target/Description + Build images for QEMU ARM Virtual Machine +endef + +include $(INCLUDE_DIR)/target.mk + +KERNELNAME:=zImage + +$(eval $(call BuildTarget)) diff --git a/target/linux/armvirt/README b/target/linux/armvirt/README new file mode 100644 index 0000000000..e99038197e --- /dev/null +++ b/target/linux/armvirt/README @@ -0,0 +1,34 @@ +This is intended to be used with LEDE project to provide image for use with +QEMU arm-softmmu virt machine. + +Run with qemu-system-arm + + # boot with initramfs embedded in + qemu-system-arm -nographic -M virt -m 64 -kernel lede-armvirt-zImage-initramfs + + # boot with accel=kvm + qemu-system-arm -nographic -M virt,accel=kvm -cpu host -m 64 -kernel lede-armvirt-zImage-initramfs + + # boot with a separate rootfs + qemu-system-arm -nographic -M virt -m 64 -kernel lede-armvirt-zImage \ + -drive file=lede-armvirt-root.ext4,format=raw,if=virtio -append 'root=/dev/vda rootwait' + + # boot with local dir as rootfs + qemu-system-arm -nographic -M virt -m 64 -kernel lede-armvirt-zImage \ + -fsdev local,id=rootdev,path=root-armvirt/,security_model=none \ + -device virtio-9p-pci,fsdev=rootdev,mount_tag=/dev/root \ + -append 'rootflags=trans=virtio,version=9p2000.L,cache=loose rootfstype=9p' + +Run with kvmtool + + # start a named machine + lkvm run -k lede-armvirt-zImage -i lede-armvirt-rootfs.cpio --name armvirt0 + + # start with virtio-9p rootfs + lkvm run -k lede-armvirt-zImage -d root-armvirt/ + + # stop "armvirt0" + lkvm stop --name armvirt0 + + # stop all + lkvm stop --all diff --git a/target/linux/armvirt/base-files/etc/board.d/00_model b/target/linux/armvirt/base-files/etc/board.d/00_model new file mode 100755 index 0000000000..6ba51b8a42 --- /dev/null +++ b/target/linux/armvirt/base-files/etc/board.d/00_model @@ -0,0 +1,14 @@ +#!/bin/sh +# Copyright (C) 2015 OpenWrt.org +# Copyright (C) 2016 Yousong Zhou + +. /lib/functions/uci-defaults.sh + +board_config_update + +ucidef_set_board_id "armvirt" +ucidef_set_model_name "QEMU ARM Virtual Machine" + +board_config_flush + +exit 0 diff --git a/target/linux/armvirt/base-files/etc/inittab b/target/linux/armvirt/base-files/etc/inittab new file mode 100644 index 0000000000..837d7f32a4 --- /dev/null +++ b/target/linux/armvirt/base-files/etc/inittab @@ -0,0 +1,5 @@ +::sysinit:/etc/init.d/rcS S boot +::shutdown:/etc/init.d/rcS K shutdown +ttyAMA0::askfirst:/usr/libexec/login.sh +ttyS0::askfirst:/usr/libexec/login.sh +hvc0::askfirst:/usr/libexec/login.sh diff --git a/target/linux/armvirt/config-default b/target/linux/armvirt/config-default new file mode 100644 index 0000000000..0cee053692 --- /dev/null +++ b/target/linux/armvirt/config-default @@ -0,0 +1,259 @@ +CONFIG_9P_FS=y +# CONFIG_9P_FS_POSIX_ACL is not set +# CONFIG_9P_FS_SECURITY is not set +CONFIG_ALIGNMENT_TRAP=y +CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_ARCH_HAS_TICK_BROADCAST=y +CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y +# CONFIG_ARCH_MULTI_CPU_AUTO is not set +CONFIG_ARCH_MULTI_V6_V7=y +CONFIG_ARCH_MULTI_V7=y +CONFIG_ARCH_NR_GPIO=0 +# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set +# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_VIRT=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y +CONFIG_ARM=y +CONFIG_ARM_AMBA=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +# CONFIG_ARM_CPU_SUSPEND is not set +CONFIG_ARM_GIC=y +CONFIG_ARM_GIC_V3=y +CONFIG_ARM_HAS_SG_CHAIN=y +CONFIG_ARM_HEAVY_MB=y +CONFIG_ARM_L1_CACHE_SHIFT=6 +CONFIG_ARM_L1_CACHE_SHIFT_6=y +# CONFIG_ARM_LPAE is not set +CONFIG_ARM_PATCH_PHYS_VIRT=y +CONFIG_ARM_PSCI=y +CONFIG_ARM_PSCI_FW=y +# CONFIG_ARM_SP805_WATCHDOG is not set +CONFIG_ARM_THUMB=y +# CONFIG_ARM_THUMBEE is not set +CONFIG_ARM_VIRT_EXT=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_CACHE_L2X0=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKSRC_OF=y +CONFIG_CLKSRC_PROBE=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +CONFIG_CPU_32v6K=y +CONFIG_CPU_32v7=y +CONFIG_CPU_ABRT_EV7=y +# CONFIG_CPU_BPREDICT_DISABLE is not set +CONFIG_CPU_CACHE_V7=y +CONFIG_CPU_CACHE_VIPT=y +CONFIG_CPU_COPY_V6=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_HAS_ASID=y +# CONFIG_CPU_ICACHE_DISABLE is not set +CONFIG_CPU_PABRT_V7=y +CONFIG_CPU_RMAP=y +CONFIG_CPU_TLB_V7=y +CONFIG_CPU_V7=y +CONFIG_CRC16=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" +# CONFIG_DEBUG_UART_8250 is not set +# CONFIG_DEBUG_USER is not set +CONFIG_DTC=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EXT4_FS=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +CONFIG_FS_MBCACHE=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GPIOLIB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_DEVRES=y +CONFIG_GPIO_PL061=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +CONFIG_HAVE_ARCH_BITREVERSE=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_ARM_ARCH_TIMER=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_BPF_JIT=y +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_PROC_CPU=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SMP=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HOTPLUG_CPU=y +CONFIG_HVC_DRIVER=y +CONFIG_HZ_FIXED=0 +CONFIG_HZ_PERIODIC=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IOMMU_HELPER=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_JBD2=y +CONFIG_LIBFDT=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_MEMORY_BALLOON=y +CONFIG_MIGHT_HAVE_CACHE_L2X0=y +CONFIG_MIGHT_HAVE_PCI=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MULTI_IRQ_HANDLER=y +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEON=y +CONFIG_NET_9P=y +# CONFIG_NET_9P_DEBUG is not set +CONFIG_NET_9P_VIRTIO=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NO_BOOTMEM=y +CONFIG_NR_CPUS=4 +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_MTD=y +CONFIG_OF_NET=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_OF_RESERVED_MEM=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_OUTER_CACHE=y +CONFIG_OUTER_CACHE_SYNC=y +CONFIG_PADATA=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PCI=y +# CONFIG_PCI_DOMAINS_GENERIC is not set +CONFIG_PCI_HOST_GENERIC=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +# CONFIG_PL310_ERRATA_588369 is not set +# CONFIG_PL310_ERRATA_727915 is not set +# CONFIG_PL310_ERRATA_753970 is not set +# CONFIG_PL310_ERRATA_769419 is not set +CONFIG_RATIONAL=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_PL031=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_SCHED_HRTICK=y +# CONFIG_SCHED_INFO is not set +CONFIG_SCSI=y +CONFIG_SCSI_VIRTIO=y +CONFIG_SERIAL_8250_FSL=y +# CONFIG_SERIAL_AMBA_PL010 is not set +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SMP=y +CONFIG_SMP_ON_UP=y +CONFIG_SPARSE_IRQ=y +CONFIG_SRCU=y +CONFIG_SWIOTLB=y +CONFIG_SWP_EMULATE=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +# CONFIG_THUMB2_KERNEL is not set +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TREE_RCU=y +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y +CONFIG_VECTORS_BASE=0xffff0000 +CONFIG_VFP=y +CONFIG_VFPv3=y +CONFIG_VIRTIO=y +CONFIG_VIRTIO_BALLOON=y +CONFIG_VIRTIO_BLK=y +CONFIG_VIRTIO_CONSOLE=y +CONFIG_VIRTIO_MMIO=y +# CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES is not set +CONFIG_VIRTIO_NET=y +CONFIG_VIRTIO_PCI=y +CONFIG_VIRTIO_PCI_LEGACY=y +CONFIG_XPS=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0 +CONFIG_ZBOOT_ROM_TEXT=0 +CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/armvirt/image/Makefile b/target/linux/armvirt/image/Makefile new file mode 100644 index 0000000000..df4383f1d4 --- /dev/null +++ b/target/linux/armvirt/image/Makefile @@ -0,0 +1,24 @@ +# +# Copyright (C) 2016 Yousong Zhou +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/image.mk + +define Image/BuildKernel + cp $(KDIR)/$(KERNELNAME) $(BIN_DIR)/$(IMG_PREFIX)-$(KERNELNAME) +endef + +define Image/Build/Initramfs + cp $(KDIR)/$(KERNELNAME)-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(KERNELNAME)-initramfs +endef + +define Image/Build + $(call Image/Build/$(1)) + dd if=$(KDIR)/root.$(1) bs=128k conv=sync | \ + gzip -9n >$(BIN_DIR)/$(IMG_PREFIX)-root.$(1).gz +endef + +$(eval $(call BuildImage)) diff --git a/target/linux/generic/files/drivers/leds/ledtrig-netdev.c b/target/linux/generic/files/drivers/leds/ledtrig-netdev.c index cfa4dc0758..7246bcaf7e 100644 --- a/target/linux/generic/files/drivers/leds/ledtrig-netdev.c +++ b/target/linux/generic/files/drivers/leds/ledtrig-netdev.c @@ -70,7 +70,7 @@ struct led_netdev_data { spinlock_t lock; - struct timer_list timer; + struct delayed_work work; struct notifier_block notifier; struct led_classdev *led_cdev; @@ -91,7 +91,7 @@ static void set_baseline_state(struct led_netdev_data *trigger_data) led_set_brightness(trigger_data->led_cdev, LED_OFF); if ((trigger_data->mode & (MODE_TX | MODE_RX)) != 0 && trigger_data->link_up) - mod_timer(&trigger_data->timer, jiffies + trigger_data->interval); + schedule_delayed_work(&trigger_data->work, trigger_data->interval); } static ssize_t led_device_name_show(struct device *dev, @@ -116,8 +116,9 @@ static ssize_t led_device_name_store(struct device *dev, if (size < 0 || size >= IFNAMSIZ) return -EINVAL; + cancel_delayed_work_sync(&trigger_data->work); + spin_lock_bh(&trigger_data->lock); - del_timer_sync(&trigger_data->timer); strcpy(trigger_data->device_name, buf); if (size > 0 && trigger_data->device_name[size-1] == '\n') @@ -201,11 +202,10 @@ static ssize_t led_mode_store(struct device *dev, if (new_mode == -1) return -EINVAL; - spin_lock_bh(&trigger_data->lock); - del_timer_sync(&trigger_data->timer); + cancel_delayed_work_sync(&trigger_data->work); + spin_lock_bh(&trigger_data->lock); trigger_data->mode = new_mode; - set_baseline_state(trigger_data); spin_unlock_bh(&trigger_data->lock); @@ -242,11 +242,10 @@ static ssize_t led_interval_store(struct device *dev, /* impose some basic bounds on the timer interval */ if (count == size && value >= 5 && value <= 10000) { - spin_lock_bh(&trigger_data->lock); - del_timer_sync(&trigger_data->timer); + cancel_delayed_work_sync(&trigger_data->work); + spin_lock_bh(&trigger_data->lock); trigger_data->interval = msecs_to_jiffies(value); - set_baseline_state(trigger_data); /* resets timer */ spin_unlock_bh(&trigger_data->lock); @@ -268,12 +267,12 @@ static int netdev_trig_notify(struct notifier_block *nb, if (evt != NETDEV_UP && evt != NETDEV_DOWN && evt != NETDEV_CHANGE && evt != NETDEV_REGISTER && evt != NETDEV_UNREGISTER && evt != NETDEV_CHANGENAME) return NOTIFY_DONE; - spin_lock_bh(&trigger_data->lock); - if (strcmp(dev->name, trigger_data->device_name)) - goto done; + return NOTIFY_DONE; - del_timer_sync(&trigger_data->timer); + cancel_delayed_work_sync(&trigger_data->work); + + spin_lock_bh(&trigger_data->lock); if (evt == NETDEV_REGISTER || evt == NETDEV_CHANGENAME) { if (trigger_data->net_dev != NULL) @@ -302,9 +301,9 @@ done: } /* here's the real work! */ -static void netdev_trig_timer(unsigned long arg) +static void netdev_trig_work(struct work_struct *work) { - struct led_netdev_data *trigger_data = (struct led_netdev_data *)arg; + struct led_netdev_data *trigger_data = container_of(work, struct led_netdev_data, work.work); struct rtnl_link_stats64 *dev_stats; unsigned new_activity; struct rtnl_link_stats64 temp; @@ -343,7 +342,7 @@ static void netdev_trig_timer(unsigned long arg) } trigger_data->last_activity = new_activity; - mod_timer(&trigger_data->timer, jiffies + trigger_data->interval); + schedule_delayed_work(&trigger_data->work, trigger_data->interval); } static void netdev_trig_activate(struct led_classdev *led_cdev) @@ -360,7 +359,7 @@ static void netdev_trig_activate(struct led_classdev *led_cdev) trigger_data->notifier.notifier_call = netdev_trig_notify; trigger_data->notifier.priority = 10; - setup_timer(&trigger_data->timer, netdev_trig_timer, (unsigned long) trigger_data); + INIT_DELAYED_WORK(&trigger_data->work, netdev_trig_work); trigger_data->led_cdev = led_cdev; trigger_data->net_dev = NULL; @@ -406,8 +405,9 @@ static void netdev_trig_deactivate(struct led_classdev *led_cdev) device_remove_file(led_cdev->dev, &dev_attr_mode); device_remove_file(led_cdev->dev, &dev_attr_interval); + cancel_delayed_work_sync(&trigger_data->work); + spin_lock_bh(&trigger_data->lock); - del_timer_sync(&trigger_data->timer); if (trigger_data->net_dev) { dev_put(trigger_data->net_dev); diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index 27b062bc47..01dc065be1 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -1194,6 +1194,7 @@ ar8xxx_sw_reset_switch(struct switch_dev *dev) priv->arl_age_time = AR8XXX_DEFAULT_ARL_AGE_TIME; chip->init_globals(priv); + chip->atu_flush(priv); mutex_unlock(&priv->reg_mutex); diff --git a/target/linux/generic/files/drivers/net/phy/mvsw61xx.c b/target/linux/generic/files/drivers/net/phy/mvsw61xx.c index 6bd112b00d..9a689e6c81 100644 --- a/target/linux/generic/files/drivers/net/phy/mvsw61xx.c +++ b/target/linux/generic/files/drivers/net/phy/mvsw61xx.c @@ -851,6 +851,9 @@ static int mvsw61xx_probe(struct platform_device *pdev) case MV_IDENT_VALUE_6176: model_str = MV_IDENT_STR_6176; break; + case MV_IDENT_VALUE_6352: + model_str = MV_IDENT_STR_6352; + break; default: dev_err(&pdev->dev, "No compatible switch found at 0x%02x\n", state->base_addr); @@ -916,6 +919,7 @@ static const struct of_device_id mvsw61xx_match[] = { { .compatible = "marvell,88e6171" }, { .compatible = "marvell,88e6172" }, { .compatible = "marvell,88e6176" }, + { .compatible = "marvell,88e6352" }, { } }; MODULE_DEVICE_TABLE(of, mvsw61xx_match); diff --git a/target/linux/generic/files/drivers/net/phy/mvsw61xx.h b/target/linux/generic/files/drivers/net/phy/mvsw61xx.h index 1c45189689..a07b09cd14 100644 --- a/target/linux/generic/files/drivers/net/phy/mvsw61xx.h +++ b/target/linux/generic/files/drivers/net/phy/mvsw61xx.h @@ -232,6 +232,9 @@ enum { #define MV_IDENT_VALUE_6176 0x1760 #define MV_IDENT_STR_6176 "MV88E6176" +#define MV_IDENT_VALUE_6352 0x3520 +#define MV_IDENT_STR_6352 "MV88E6352" + #define MV_PVID_MASK 0x0fff #define MV_FDB_HI_MASK 0x00ff diff --git a/target/linux/generic/patches-3.18/305-mips_module_reloc.patch b/target/linux/generic/patches-3.18/305-mips_module_reloc.patch index f8ca91401a..fae7e70f0e 100644 --- a/target/linux/generic/patches-3.18/305-mips_module_reloc.patch +++ b/target/linux/generic/patches-3.18/305-mips_module_reloc.patch @@ -317,7 +317,7 @@ return 0; } -@@ -287,9 +529,33 @@ int module_finalize(const Elf_Ehdr *hdr, +@@ -287,9 +529,36 @@ int module_finalize(const Elf_Ehdr *hdr, list_add(&me->arch.dbe_list, &dbe_list); spin_unlock_irq(&dbe_lock); } @@ -338,6 +338,9 @@ +void module_arch_freeing_init(struct module *mod) +{ ++ if (mod->state == MODULE_STATE_LIVE) ++ return; ++ + if (mod->arch.phys_plt_tbl) { + __module_free(mod->arch.phys_plt_tbl); + mod->arch.phys_plt_tbl = NULL; diff --git a/target/linux/generic/patches-4.4/023-bcma-from-4.9.patch b/target/linux/generic/patches-4.4/023-bcma-from-4.9.patch index 0391bcb802..027054c162 100644 --- a/target/linux/generic/patches-4.4/023-bcma-from-4.9.patch +++ b/target/linux/generic/patches-4.4/023-bcma-from-4.9.patch @@ -80,3 +80,29 @@ /* Board types (on PCI usually equals to the subsystem dev id) */ /* BCM4313 */ +--- a/drivers/bcma/main.c ++++ b/drivers/bcma/main.c +@@ -209,6 +209,8 @@ static void bcma_of_fill_device(struct p + core->dev.of_node = node; + + core->irq = bcma_of_get_irq(parent, core, 0); ++ ++ of_dma_configure(&core->dev, node); + } + + unsigned int bcma_core_irq(struct bcma_device *core, int num) +@@ -248,12 +250,12 @@ void bcma_prepare_core(struct bcma_bus * + core->irq = bus->host_pci->irq; + break; + case BCMA_HOSTTYPE_SOC: +- core->dev.dma_mask = &core->dev.coherent_dma_mask; +- if (bus->host_pdev) { ++ if (IS_ENABLED(CONFIG_OF) && bus->host_pdev) { + core->dma_dev = &bus->host_pdev->dev; + core->dev.parent = &bus->host_pdev->dev; + bcma_of_fill_device(bus->host_pdev, core); + } else { ++ core->dev.dma_mask = &core->dev.coherent_dma_mask; + core->dma_dev = &core->dev; + } + break; diff --git a/target/linux/generic/patches-4.4/025-bcma-from-4.11.patch b/target/linux/generic/patches-4.4/025-bcma-from-4.11.patch new file mode 100644 index 0000000000..d5bdd2d5ae --- /dev/null +++ b/target/linux/generic/patches-4.4/025-bcma-from-4.11.patch @@ -0,0 +1,105 @@ +--- a/drivers/bcma/main.c ++++ b/drivers/bcma/main.c +@@ -136,17 +136,17 @@ static bool bcma_is_core_needed_early(u1 + return false; + } + +-static struct device_node *bcma_of_find_child_device(struct platform_device *parent, ++static struct device_node *bcma_of_find_child_device(struct device *parent, + struct bcma_device *core) + { + struct device_node *node; + u64 size; + const __be32 *reg; + +- if (!parent || !parent->dev.of_node) ++ if (!parent->of_node) + return NULL; + +- for_each_child_of_node(parent->dev.of_node, node) { ++ for_each_child_of_node(parent->of_node, node) { + reg = of_get_address(node, 0, &size, NULL); + if (!reg) + continue; +@@ -156,7 +156,7 @@ static struct device_node *bcma_of_find_ + return NULL; + } + +-static int bcma_of_irq_parse(struct platform_device *parent, ++static int bcma_of_irq_parse(struct device *parent, + struct bcma_device *core, + struct of_phandle_args *out_irq, int num) + { +@@ -169,7 +169,7 @@ static int bcma_of_irq_parse(struct plat + return rc; + } + +- out_irq->np = parent->dev.of_node; ++ out_irq->np = parent->of_node; + out_irq->args_count = 1; + out_irq->args[0] = num; + +@@ -177,13 +177,13 @@ static int bcma_of_irq_parse(struct plat + return of_irq_parse_raw(laddr, out_irq); + } + +-static unsigned int bcma_of_get_irq(struct platform_device *parent, ++static unsigned int bcma_of_get_irq(struct device *parent, + struct bcma_device *core, int num) + { + struct of_phandle_args out_irq; + int ret; + +- if (!IS_ENABLED(CONFIG_OF_IRQ) || !parent || !parent->dev.of_node) ++ if (!IS_ENABLED(CONFIG_OF_IRQ) || !parent->of_node) + return 0; + + ret = bcma_of_irq_parse(parent, core, &out_irq, num); +@@ -196,7 +196,7 @@ static unsigned int bcma_of_get_irq(stru + return irq_create_of_mapping(&out_irq); + } + +-static void bcma_of_fill_device(struct platform_device *parent, ++static void bcma_of_fill_device(struct device *parent, + struct bcma_device *core) + { + struct device_node *node; +@@ -227,7 +227,7 @@ unsigned int bcma_core_irq(struct bcma_d + return mips_irq <= 4 ? mips_irq + 2 : 0; + } + if (bus->host_pdev) +- return bcma_of_get_irq(bus->host_pdev, core, num); ++ return bcma_of_get_irq(&bus->host_pdev->dev, core, num); + return 0; + case BCMA_HOSTTYPE_SDIO: + return 0; +@@ -253,7 +253,8 @@ void bcma_prepare_core(struct bcma_bus * + if (IS_ENABLED(CONFIG_OF) && bus->host_pdev) { + core->dma_dev = &bus->host_pdev->dev; + core->dev.parent = &bus->host_pdev->dev; +- bcma_of_fill_device(bus->host_pdev, core); ++ if (core->dev.parent) ++ bcma_of_fill_device(core->dev.parent, core); + } else { + core->dev.dma_mask = &core->dev.coherent_dma_mask; + core->dma_dev = &core->dev; +@@ -633,8 +634,11 @@ static int bcma_device_probe(struct devi + drv); + int err = 0; + ++ get_device(dev); + if (adrv->probe) + err = adrv->probe(core); ++ if (err) ++ put_device(dev); + + return err; + } +@@ -647,6 +651,7 @@ static int bcma_device_remove(struct dev + + if (adrv->remove) + adrv->remove(core); ++ put_device(dev); + + return 0; + } diff --git a/target/linux/generic/patches-4.4/042-0005-mtd-bcm47xxsflash-use-platform_-set-get-_drvdata.patch b/target/linux/generic/patches-4.4/042-0005-mtd-bcm47xxsflash-use-platform_-set-get-_drvdata.patch new file mode 100644 index 0000000000..a68eaa4594 --- /dev/null +++ b/target/linux/generic/patches-4.4/042-0005-mtd-bcm47xxsflash-use-platform_-set-get-_drvdata.patch @@ -0,0 +1,63 @@ +From be5e5099183301fb7920f8f6b66bd3ac1f820a97 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 16 Jan 2017 17:28:18 +0100 +Subject: [PATCH] mtd: bcm47xxsflash: use platform_(set|get)_drvdata +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We have generic place & helpers for storing platform driver data so +there is no reason for using custom priv pointer. + +This allows cleaning up struct bcma_sflash from unneeded fields. + +Signed-off-by: Rafał Miłecki +Acked-by: Kalle Valo +Acked-by: Boris Brezillon +Signed-off-by: Brian Norris +--- + drivers/mtd/devices/bcm47xxsflash.c | 6 +++--- + include/linux/bcma/bcma_driver_chipcommon.h | 3 --- + 2 files changed, 3 insertions(+), 6 deletions(-) + +--- a/drivers/mtd/devices/bcm47xxsflash.c ++++ b/drivers/mtd/devices/bcm47xxsflash.c +@@ -284,7 +284,6 @@ static int bcm47xxsflash_bcma_probe(stru + b47s = devm_kzalloc(dev, sizeof(*b47s), GFP_KERNEL); + if (!b47s) + return -ENOMEM; +- sflash->priv = b47s; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) { +@@ -334,6 +333,8 @@ static int bcm47xxsflash_bcma_probe(stru + b47s->size = sflash->size; + bcm47xxsflash_fill_mtd(b47s, &pdev->dev); + ++ platform_set_drvdata(pdev, b47s); ++ + err = mtd_device_parse_register(&b47s->mtd, probes, NULL, NULL, 0); + if (err) { + pr_err("Failed to register MTD device: %d\n", err); +@@ -349,8 +350,7 @@ static int bcm47xxsflash_bcma_probe(stru + + static int bcm47xxsflash_bcma_remove(struct platform_device *pdev) + { +- struct bcma_sflash *sflash = dev_get_platdata(&pdev->dev); +- struct bcm47xxsflash *b47s = sflash->priv; ++ struct bcm47xxsflash *b47s = platform_get_drvdata(pdev); + + mtd_device_unregister(&b47s->mtd); + iounmap(b47s->window); +--- a/include/linux/bcma/bcma_driver_chipcommon.h ++++ b/include/linux/bcma/bcma_driver_chipcommon.h +@@ -591,9 +591,6 @@ struct bcma_sflash { + u32 blocksize; + u16 numblocks; + u32 size; +- +- struct mtd_info *mtd; +- void *priv; + }; + #endif + diff --git a/target/linux/generic/patches-4.4/042-0006-mtd-bcm47xxsflash-support-reading-flash-out-of-mappi.patch b/target/linux/generic/patches-4.4/042-0006-mtd-bcm47xxsflash-support-reading-flash-out-of-mappi.patch new file mode 100644 index 0000000000..ecdae2a871 --- /dev/null +++ b/target/linux/generic/patches-4.4/042-0006-mtd-bcm47xxsflash-support-reading-flash-out-of-mappi.patch @@ -0,0 +1,81 @@ +From ccc38234fdc70120be79e7fb2df5c27ca5cd4c8a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Wed, 8 Feb 2017 23:53:44 +0100 +Subject: [PATCH] mtd: bcm47xxsflash: support reading flash out of mapping + window +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +For reading flash content we use MMIO but it's possible to read only +first 16 MiB this way. It's simply an arch design/limitation. +To support flash sizes bigger than 16 MiB implement indirect access +using ChipCommon registers. +This has been tested using MX25L25635F. + +Signed-off-by: Rafał Miłecki +Acked-by: Marek Vasut +Signed-off-by: Brian Norris +--- + drivers/mtd/devices/bcm47xxsflash.c | 24 +++++++++++++++++++++--- + drivers/mtd/devices/bcm47xxsflash.h | 3 +++ + 2 files changed, 24 insertions(+), 3 deletions(-) + +--- a/drivers/mtd/devices/bcm47xxsflash.c ++++ b/drivers/mtd/devices/bcm47xxsflash.c +@@ -105,15 +105,33 @@ static int bcm47xxsflash_read(struct mtd + size_t *retlen, u_char *buf) + { + struct bcm47xxsflash *b47s = mtd->priv; ++ size_t orig_len = len; + + /* Check address range */ + if ((from + len) > mtd->size) + return -EINVAL; + +- memcpy_fromio(buf, b47s->window + from, len); +- *retlen = len; ++ /* Read as much as possible using fast MMIO window */ ++ if (from < BCM47XXSFLASH_WINDOW_SZ) { ++ size_t memcpy_len; + +- return len; ++ memcpy_len = min(len, (size_t)(BCM47XXSFLASH_WINDOW_SZ - from)); ++ memcpy_fromio(buf, b47s->window + from, memcpy_len); ++ from += memcpy_len; ++ len -= memcpy_len; ++ buf += memcpy_len; ++ } ++ ++ /* Use indirect access for content out of the window */ ++ for (; len; len--) { ++ b47s->cc_write(b47s, BCMA_CC_FLASHADDR, from++); ++ bcm47xxsflash_cmd(b47s, OPCODE_ST_READ4B); ++ *buf++ = b47s->cc_read(b47s, BCMA_CC_FLASHDATA); ++ } ++ ++ *retlen = orig_len; ++ ++ return orig_len; + } + + static int bcm47xxsflash_write_st(struct mtd_info *mtd, u32 offset, size_t len, +--- a/drivers/mtd/devices/bcm47xxsflash.h ++++ b/drivers/mtd/devices/bcm47xxsflash.h +@@ -3,6 +3,8 @@ + + #include + ++#define BCM47XXSFLASH_WINDOW_SZ SZ_16M ++ + /* Used for ST flashes only. */ + #define OPCODE_ST_WREN 0x0006 /* Write Enable */ + #define OPCODE_ST_WRDIS 0x0004 /* Write Disable */ +@@ -16,6 +18,7 @@ + #define OPCODE_ST_RES 0x03ab /* Read Electronic Signature */ + #define OPCODE_ST_CSA 0x1000 /* Keep chip select asserted */ + #define OPCODE_ST_SSE 0x0220 /* Sub-sector Erase */ ++#define OPCODE_ST_READ4B 0x6313 /* Read Data Bytes in 4Byte addressing mode */ + + /* Used for Atmel flashes only. */ + #define OPCODE_AT_READ 0x07e8 diff --git a/target/linux/generic/patches-4.4/141-0001-mtd-bcm47xxpart-move-TRX-parsing-code-to-separated-f.patch b/target/linux/generic/patches-4.4/042-0007-mtd-bcm47xxpart-move-TRX-parsing-code-to-separated-f.patch similarity index 94% rename from target/linux/generic/patches-4.4/141-0001-mtd-bcm47xxpart-move-TRX-parsing-code-to-separated-f.patch rename to target/linux/generic/patches-4.4/042-0007-mtd-bcm47xxpart-move-TRX-parsing-code-to-separated-f.patch index a204fe6625..4ef7e7f5d8 100644 --- a/target/linux/generic/patches-4.4/141-0001-mtd-bcm47xxpart-move-TRX-parsing-code-to-separated-f.patch +++ b/target/linux/generic/patches-4.4/042-0007-mtd-bcm47xxpart-move-TRX-parsing-code-to-separated-f.patch @@ -1,6 +1,7 @@ +From b522d7b0ebe3539340c2a6d46d787ae3d33bcb92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Subject: [PATCH 1/2] mtd: bcm47xxpart: move TRX parsing code to separated - function +Date: Tue, 10 Jan 2017 23:15:24 +0100 +Subject: [PATCH] mtd: bcm47xxpart: move TRX parsing code to separated function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -13,6 +14,8 @@ better flash layout knowledge. It may be useful e.g. if it appears there is more than 1 TRX partition. Signed-off-by: Rafał Miłecki +Acked-by: Marek Vasut +Signed-off-by: Brian Norris --- drivers/mtd/bcm47xxpart.c | 121 ++++++++++++++++++++++++++++------------------ 1 file changed, 74 insertions(+), 47 deletions(-) diff --git a/target/linux/generic/patches-4.4/141-0002-mtd-bcm47xxpart-support-layouts-with-multiple-TRX-pa.patch b/target/linux/generic/patches-4.4/042-0008-mtd-bcm47xxpart-support-layouts-with-multiple-TRX-pa.patch similarity index 91% rename from target/linux/generic/patches-4.4/141-0002-mtd-bcm47xxpart-support-layouts-with-multiple-TRX-pa.patch rename to target/linux/generic/patches-4.4/042-0008-mtd-bcm47xxpart-support-layouts-with-multiple-TRX-pa.patch index 2d97be7508..6c6c8397df 100644 --- a/target/linux/generic/patches-4.4/141-0002-mtd-bcm47xxpart-support-layouts-with-multiple-TRX-pa.patch +++ b/target/linux/generic/patches-4.4/042-0008-mtd-bcm47xxpart-support-layouts-with-multiple-TRX-pa.patch @@ -1,5 +1,7 @@ +From 89a0d9a9f1941a086a82bc7cd73d275cec98ba14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Subject: [PATCH 2/2] mtd: bcm47xxpart: support layouts with multiple TRX +Date: Tue, 10 Jan 2017 23:15:25 +0100 +Subject: [PATCH] mtd: bcm47xxpart: support layouts with multiple TRX partitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -10,6 +12,8 @@ we detect such partition we should set a proper name for it and don't parse it. Signed-off-by: Rafał Miłecki +Acked-by: Marek Vasut +Signed-off-by: Brian Norris --- drivers/mtd/bcm47xxpart.c | 56 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/target/linux/generic/patches-4.4/062-01-MIPS-Introduce-irq_stack.patch b/target/linux/generic/patches-4.4/062-01-MIPS-Introduce-irq_stack.patch new file mode 100644 index 0000000000..2a929aa7e1 --- /dev/null +++ b/target/linux/generic/patches-4.4/062-01-MIPS-Introduce-irq_stack.patch @@ -0,0 +1,70 @@ +From: Matt Redfearn +Date: Mon, 19 Dec 2016 14:20:56 +0000 +Subject: [PATCH] MIPS: Introduce irq_stack + +Allocate a per-cpu irq stack for use within interrupt handlers. + +Also add a utility function on_irq_stack to determine if a given stack +pointer is within the irq stack for that cpu. + +Signed-off-by: Matt Redfearn +--- + +--- a/arch/mips/include/asm/irq.h ++++ b/arch/mips/include/asm/irq.h +@@ -17,6 +17,18 @@ + + #include + ++#define IRQ_STACK_SIZE THREAD_SIZE ++ ++extern void *irq_stack[NR_CPUS]; ++ ++static inline bool on_irq_stack(int cpu, unsigned long sp) ++{ ++ unsigned long low = (unsigned long)irq_stack[cpu]; ++ unsigned long high = low + IRQ_STACK_SIZE; ++ ++ return (low <= sp && sp <= high); ++} ++ + #ifdef CONFIG_I8259 + static inline int irq_canonicalize(int irq) + { +--- a/arch/mips/kernel/asm-offsets.c ++++ b/arch/mips/kernel/asm-offsets.c +@@ -101,6 +101,7 @@ void output_thread_info_defines(void) + OFFSET(TI_REGS, thread_info, regs); + DEFINE(_THREAD_SIZE, THREAD_SIZE); + DEFINE(_THREAD_MASK, THREAD_MASK); ++ DEFINE(_IRQ_STACK_SIZE, IRQ_STACK_SIZE); + BLANK(); + } + +--- a/arch/mips/kernel/irq.c ++++ b/arch/mips/kernel/irq.c +@@ -25,6 +25,8 @@ + #include + #include + ++void *irq_stack[NR_CPUS]; ++ + /* + * 'what should we do if we get a hw irq event on an illegal vector'. + * each architecture has to answer this themselves. +@@ -55,6 +57,15 @@ void __init init_IRQ(void) + irq_set_noprobe(i); + + arch_init_irq(); ++ ++ for_each_possible_cpu(i) { ++ int irq_pages = IRQ_STACK_SIZE / PAGE_SIZE; ++ void *s = (void *)__get_free_pages(GFP_KERNEL, irq_pages); ++ ++ irq_stack[i] = s; ++ pr_debug("CPU%d IRQ stack at 0x%p - 0x%p\n", i, ++ irq_stack[i], irq_stack[i] + IRQ_STACK_SIZE); ++ } + } + + #ifdef CONFIG_DEBUG_STACKOVERFLOW diff --git a/target/linux/generic/patches-4.4/062-02-MIPS-Stack-unwinding-while-on-IRQ-stack.patch b/target/linux/generic/patches-4.4/062-02-MIPS-Stack-unwinding-while-on-IRQ-stack.patch new file mode 100644 index 0000000000..513e904e52 --- /dev/null +++ b/target/linux/generic/patches-4.4/062-02-MIPS-Stack-unwinding-while-on-IRQ-stack.patch @@ -0,0 +1,42 @@ +From: Matt Redfearn +Date: Mon, 19 Dec 2016 14:20:57 +0000 +Subject: [PATCH] MIPS: Stack unwinding while on IRQ stack + +Within unwind stack, check if the stack pointer being unwound is within +the CPU's irq_stack and if so use that page rather than the task's stack +page. + +Signed-off-by: Matt Redfearn +--- + +--- a/arch/mips/kernel/process.c ++++ b/arch/mips/kernel/process.c +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -507,7 +508,19 @@ EXPORT_SYMBOL(unwind_stack_by_address); + unsigned long unwind_stack(struct task_struct *task, unsigned long *sp, + unsigned long pc, unsigned long *ra) + { +- unsigned long stack_page = (unsigned long)task_stack_page(task); ++ unsigned long stack_page = 0; ++ int cpu; ++ ++ for_each_possible_cpu(cpu) { ++ if (on_irq_stack(cpu, *sp)) { ++ stack_page = (unsigned long)irq_stack[cpu]; ++ break; ++ } ++ } ++ ++ if (!stack_page) ++ stack_page = (unsigned long)task_stack_page(task); ++ + return unwind_stack_by_address(stack_page, sp, pc, ra); + } + #endif diff --git a/target/linux/generic/patches-4.4/062-03-MIPS-Only-change-28-to-thread_info-if-coming-from-us.patch b/target/linux/generic/patches-4.4/062-03-MIPS-Only-change-28-to-thread_info-if-coming-from-us.patch new file mode 100644 index 0000000000..e13c67be60 --- /dev/null +++ b/target/linux/generic/patches-4.4/062-03-MIPS-Only-change-28-to-thread_info-if-coming-from-us.patch @@ -0,0 +1,48 @@ +From: Matt Redfearn +Date: Mon, 19 Dec 2016 14:20:58 +0000 +Subject: [PATCH] MIPS: Only change $28 to thread_info if coming from user + mode + +The SAVE_SOME macro is used to save the execution context on all +exceptions. +If an exception occurs while executing user code, the stack is switched +to the kernel's stack for the current task, and register $28 is switched +to point to the current_thread_info, which is at the bottom of the stack +region. +If the exception occurs while executing kernel code, the stack is left, +and this change ensures that register $28 is not updated. This is the +correct behaviour when the kernel can be executing on the separate irq +stack, because the thread_info will not be at the base of it. + +With this change, register $28 is only switched to it's kernel +conventional usage of the currrent thread info pointer at the point at +which execution enters kernel space. Doing it on every exception was +redundant, but OK without an IRQ stack, but will be erroneous once that +is introduced. + +Signed-off-by: Matt Redfearn +Reviewed-by: Maciej W. Rozycki +--- + +--- a/arch/mips/include/asm/stackframe.h ++++ b/arch/mips/include/asm/stackframe.h +@@ -216,12 +216,19 @@ + LONG_S $25, PT_R25(sp) + LONG_S $28, PT_R28(sp) + LONG_S $31, PT_R31(sp) ++ ++ /* Set thread_info if we're coming from user mode */ ++ mfc0 k0, CP0_STATUS ++ sll k0, 3 /* extract cu0 bit */ ++ bltz k0, 9f ++ + ori $28, sp, _THREAD_MASK + xori $28, _THREAD_MASK + #ifdef CONFIG_CPU_CAVIUM_OCTEON + .set mips64 + pref 0, 0($28) /* Prefetch the current pointer */ + #endif ++9: + .set pop + .endm + diff --git a/target/linux/generic/patches-4.4/062-04-MIPS-Switch-to-the-irq_stack-in-interrupts.patch b/target/linux/generic/patches-4.4/062-04-MIPS-Switch-to-the-irq_stack-in-interrupts.patch new file mode 100644 index 0000000000..9bd2336974 --- /dev/null +++ b/target/linux/generic/patches-4.4/062-04-MIPS-Switch-to-the-irq_stack-in-interrupts.patch @@ -0,0 +1,116 @@ +From: Matt Redfearn +Date: Mon, 19 Dec 2016 14:20:59 +0000 +Subject: [PATCH] MIPS: Switch to the irq_stack in interrupts + +When enterring interrupt context via handle_int or except_vec_vi, switch +to the irq_stack of the current CPU if it is not already in use. + +The current stack pointer is masked with the thread size and compared to +the base or the irq stack. If it does not match then the stack pointer +is set to the top of that stack, otherwise this is a nested irq being +handled on the irq stack so the stack pointer should be left as it was. + +The in-use stack pointer is placed in the callee saved register s1. It +will be saved to the stack when plat_irq_dispatch is invoked and can be +restored once control returns here. + +Signed-off-by: Matt Redfearn +--- + +--- a/arch/mips/kernel/genex.S ++++ b/arch/mips/kernel/genex.S +@@ -188,9 +188,44 @@ NESTED(handle_int, PT_SIZE, sp) + + LONG_L s0, TI_REGS($28) + LONG_S sp, TI_REGS($28) +- PTR_LA ra, ret_from_irq +- PTR_LA v0, plat_irq_dispatch +- jr v0 ++ ++ /* ++ * SAVE_ALL ensures we are using a valid kernel stack for the thread. ++ * Check if we are already using the IRQ stack. ++ */ ++ move s1, sp # Preserve the sp ++ ++ /* Get IRQ stack for this CPU */ ++ ASM_CPUID_MFC0 k0, ASM_SMP_CPUID_REG ++#if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32) ++ lui k1, %hi(irq_stack) ++#else ++ lui k1, %highest(irq_stack) ++ daddiu k1, %higher(irq_stack) ++ dsll k1, 16 ++ daddiu k1, %hi(irq_stack) ++ dsll k1, 16 ++#endif ++ LONG_SRL k0, SMP_CPUID_PTRSHIFT ++ LONG_ADDU k1, k0 ++ LONG_L t0, %lo(irq_stack)(k1) ++ ++ # Check if already on IRQ stack ++ PTR_LI t1, ~(_THREAD_SIZE-1) ++ and t1, t1, sp ++ beq t0, t1, 2f ++ ++ /* Switch to IRQ stack */ ++ li t1, _IRQ_STACK_SIZE ++ PTR_ADD sp, t0, t1 ++ ++2: ++ jal plat_irq_dispatch ++ ++ /* Restore sp */ ++ move sp, s1 ++ ++ j ret_from_irq + #ifdef CONFIG_CPU_MICROMIPS + nop + #endif +@@ -263,8 +298,44 @@ NESTED(except_vec_vi_handler, 0, sp) + + LONG_L s0, TI_REGS($28) + LONG_S sp, TI_REGS($28) +- PTR_LA ra, ret_from_irq +- jr v0 ++ ++ /* ++ * SAVE_ALL ensures we are using a valid kernel stack for the thread. ++ * Check if we are already using the IRQ stack. ++ */ ++ move s1, sp # Preserve the sp ++ ++ /* Get IRQ stack for this CPU */ ++ ASM_CPUID_MFC0 k0, ASM_SMP_CPUID_REG ++#if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32) ++ lui k1, %hi(irq_stack) ++#else ++ lui k1, %highest(irq_stack) ++ daddiu k1, %higher(irq_stack) ++ dsll k1, 16 ++ daddiu k1, %hi(irq_stack) ++ dsll k1, 16 ++#endif ++ LONG_SRL k0, SMP_CPUID_PTRSHIFT ++ LONG_ADDU k1, k0 ++ LONG_L t0, %lo(irq_stack)(k1) ++ ++ # Check if already on IRQ stack ++ PTR_LI t1, ~(_THREAD_SIZE-1) ++ and t1, t1, sp ++ beq t0, t1, 2f ++ ++ /* Switch to IRQ stack */ ++ li t1, _IRQ_STACK_SIZE ++ PTR_ADD sp, t0, t1 ++ ++2: ++ jal plat_irq_dispatch ++ ++ /* Restore sp */ ++ move sp, s1 ++ ++ j ret_from_irq + END(except_vec_vi_handler) + + /* diff --git a/target/linux/generic/patches-4.4/062-05-MIPS-Select-HAVE_IRQ_EXIT_ON_IRQ_STACK.patch b/target/linux/generic/patches-4.4/062-05-MIPS-Select-HAVE_IRQ_EXIT_ON_IRQ_STACK.patch new file mode 100644 index 0000000000..a4942b83af --- /dev/null +++ b/target/linux/generic/patches-4.4/062-05-MIPS-Select-HAVE_IRQ_EXIT_ON_IRQ_STACK.patch @@ -0,0 +1,21 @@ +From: Matt Redfearn +Date: Mon, 19 Dec 2016 14:21:00 +0000 +Subject: [PATCH] MIPS: Select HAVE_IRQ_EXIT_ON_IRQ_STACK + +Since do_IRQ is now invoked on a separate IRQ stack, we select +HAVE_IRQ_EXIT_ON_IRQ_STACK so that softirq's may be invoked directly +from irq_exit(), rather than requiring do_softirq_own_stack. + +Signed-off-by: Matt Redfearn +--- + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -9,6 +9,7 @@ config MIPS + select HAVE_CONTEXT_TRACKING + select HAVE_GENERIC_DMA_COHERENT + select HAVE_IDE ++ select HAVE_IRQ_EXIT_ON_IRQ_STACK + select HAVE_OPROFILE + select HAVE_PERF_EVENTS + select PERF_USE_VMALLOC diff --git a/target/linux/generic/patches-4.4/062-06-MIPS-IRQ-Stack-Fix-erroneous-jal-to-plat_irq_dispatc.patch b/target/linux/generic/patches-4.4/062-06-MIPS-IRQ-Stack-Fix-erroneous-jal-to-plat_irq_dispatc.patch new file mode 100644 index 0000000000..26cf5c44d9 --- /dev/null +++ b/target/linux/generic/patches-4.4/062-06-MIPS-IRQ-Stack-Fix-erroneous-jal-to-plat_irq_dispatc.patch @@ -0,0 +1,35 @@ +From de856416e7143e32afc4849625616554aa060f7a Mon Sep 17 00:00:00 2001 +From: Matt Redfearn +Date: Wed, 25 Jan 2017 17:00:25 +0000 +Subject: [PATCH] MIPS: IRQ Stack: Fix erroneous jal to plat_irq_dispatch + +Commit dda45f701c9d ("MIPS: Switch to the irq_stack in interrupts") +changed both the normal and vectored interrupt handlers. Unfortunately +the vectored version, "except_vec_vi_handler", was incorrectly modified +to unconditionally jal to plat_irq_dispatch, rather than doing a jalr to +the vectored handler that has been set up. This is ok for many platforms +which set the vectored handler to plat_irq_dispatch anyway, but will +cause problems with platforms that use other handlers. + +Fixes: dda45f701c9d ("MIPS: Switch to the irq_stack in interrupts") +Signed-off-by: Matt Redfearn +Cc: Ralf Baechle +Cc: Paul Burton +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/15110/ +Signed-off-by: James Hogan +--- + arch/mips/kernel/genex.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/kernel/genex.S ++++ b/arch/mips/kernel/genex.S +@@ -330,7 +330,7 @@ NESTED(except_vec_vi_handler, 0, sp) + PTR_ADD sp, t0, t1 + + 2: +- jal plat_irq_dispatch ++ jalr v0 + + /* Restore sp */ + move sp, s1 diff --git a/target/linux/generic/patches-4.4/070-0001-bgmac-fix-a-missing-check-for-build_skb.patch b/target/linux/generic/patches-4.4/070-v4.5-0001-bgmac-fix-a-missing-check-for-build_skb.patch similarity index 100% rename from target/linux/generic/patches-4.4/070-0001-bgmac-fix-a-missing-check-for-build_skb.patch rename to target/linux/generic/patches-4.4/070-v4.5-0001-bgmac-fix-a-missing-check-for-build_skb.patch diff --git a/target/linux/generic/patches-4.4/070-0002-bgmac-Fix-reversed-test-of-build_skb-return-value.patch b/target/linux/generic/patches-4.4/070-v4.5-0002-bgmac-Fix-reversed-test-of-build_skb-return-value.patch similarity index 100% rename from target/linux/generic/patches-4.4/070-0002-bgmac-Fix-reversed-test-of-build_skb-return-value.patch rename to target/linux/generic/patches-4.4/070-v4.5-0002-bgmac-Fix-reversed-test-of-build_skb-return-value.patch diff --git a/target/linux/generic/patches-4.4/071-0000-net-bgmac-clarify-CONFIG_BCMA-dependency.patch b/target/linux/generic/patches-4.4/070-v4.5-0003-net-bgmac-clarify-CONFIG_BCMA-dependency.patch similarity index 100% rename from target/linux/generic/patches-4.4/071-0000-net-bgmac-clarify-CONFIG_BCMA-dependency.patch rename to target/linux/generic/patches-4.4/070-v4.5-0003-net-bgmac-clarify-CONFIG_BCMA-dependency.patch diff --git a/target/linux/generic/patches-4.4/071-0001-bgmac-add-helper-checking-for-BCM4707-BCM53018-chip-.patch b/target/linux/generic/patches-4.4/070-v4.6-0001-bgmac-add-helper-checking-for-BCM4707-BCM53018-chip-.patch similarity index 100% rename from target/linux/generic/patches-4.4/071-0001-bgmac-add-helper-checking-for-BCM4707-BCM53018-chip-.patch rename to target/linux/generic/patches-4.4/070-v4.6-0001-bgmac-add-helper-checking-for-BCM4707-BCM53018-chip-.patch diff --git a/target/linux/generic/patches-4.4/071-0002-bgmac-support-Ethernet-device-on-BCM47094-SoC.patch b/target/linux/generic/patches-4.4/070-v4.6-0002-bgmac-support-Ethernet-device-on-BCM47094-SoC.patch similarity index 100% rename from target/linux/generic/patches-4.4/071-0002-bgmac-support-Ethernet-device-on-BCM47094-SoC.patch rename to target/linux/generic/patches-4.4/070-v4.6-0002-bgmac-support-Ethernet-device-on-BCM47094-SoC.patch diff --git a/target/linux/generic/patches-4.4/071-0003-bgmac-reset-enable-Ethernet-core-before-using-it.patch b/target/linux/generic/patches-4.4/070-v4.6-0003-bgmac-reset-enable-Ethernet-core-before-using-it.patch similarity index 100% rename from target/linux/generic/patches-4.4/071-0003-bgmac-reset-enable-Ethernet-core-before-using-it.patch rename to target/linux/generic/patches-4.4/070-v4.6-0003-bgmac-reset-enable-Ethernet-core-before-using-it.patch diff --git a/target/linux/generic/patches-4.4/071-0004-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch b/target/linux/generic/patches-4.4/070-v4.6-0004-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch similarity index 100% rename from target/linux/generic/patches-4.4/071-0004-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch rename to target/linux/generic/patches-4.4/070-v4.6-0004-bgmac-fix-MAC-soft-reset-bit-for-corerev-4.patch diff --git a/target/linux/generic/patches-4.4/072-0001-bgmac-Bind-net_device-with-backing-device-structure.patch b/target/linux/generic/patches-4.4/070-v4.8-0001-bgmac-Bind-net_device-with-backing-device-structure.patch similarity index 100% rename from target/linux/generic/patches-4.4/072-0001-bgmac-Bind-net_device-with-backing-device-structure.patch rename to target/linux/generic/patches-4.4/070-v4.8-0001-bgmac-Bind-net_device-with-backing-device-structure.patch diff --git a/target/linux/generic/patches-4.4/072-0002-bgmac-Add-support-for-ethtool-statistics.patch b/target/linux/generic/patches-4.4/070-v4.8-0002-bgmac-Add-support-for-ethtool-statistics.patch similarity index 100% rename from target/linux/generic/patches-4.4/072-0002-bgmac-Add-support-for-ethtool-statistics.patch rename to target/linux/generic/patches-4.4/070-v4.8-0002-bgmac-Add-support-for-ethtool-statistics.patch diff --git a/target/linux/generic/patches-4.4/072-0003-bgmac-Maintain-some-netdev-statistics.patch b/target/linux/generic/patches-4.4/070-v4.8-0003-bgmac-Maintain-some-netdev-statistics.patch similarity index 100% rename from target/linux/generic/patches-4.4/072-0003-bgmac-Maintain-some-netdev-statistics.patch rename to target/linux/generic/patches-4.4/070-v4.8-0003-bgmac-Maintain-some-netdev-statistics.patch diff --git a/target/linux/generic/patches-4.4/073-0001-net-ethernet-bgmac-use-phydev-from-struct-net_device.patch b/target/linux/generic/patches-4.4/070-v4.8-0004-net-ethernet-bgmac-use-phydev-from-struct-net_device.patch similarity index 100% rename from target/linux/generic/patches-4.4/073-0001-net-ethernet-bgmac-use-phydev-from-struct-net_device.patch rename to target/linux/generic/patches-4.4/070-v4.8-0004-net-ethernet-bgmac-use-phydev-from-struct-net_device.patch diff --git a/target/linux/generic/patches-4.4/074-0001-net-bgmac-Fix-SOF-bit-checking.patch b/target/linux/generic/patches-4.4/071-v4.7-0001-net-bgmac-Fix-SOF-bit-checking.patch similarity index 100% rename from target/linux/generic/patches-4.4/074-0001-net-bgmac-Fix-SOF-bit-checking.patch rename to target/linux/generic/patches-4.4/071-v4.7-0001-net-bgmac-Fix-SOF-bit-checking.patch diff --git a/target/linux/generic/patches-4.4/074-0002-net-bgmac-Start-transmit-queue-in-bgmac_open.patch b/target/linux/generic/patches-4.4/071-v4.7-0002-net-bgmac-Start-transmit-queue-in-bgmac_open.patch similarity index 100% rename from target/linux/generic/patches-4.4/074-0002-net-bgmac-Start-transmit-queue-in-bgmac_open.patch rename to target/linux/generic/patches-4.4/071-v4.7-0002-net-bgmac-Start-transmit-queue-in-bgmac_open.patch diff --git a/target/linux/generic/patches-4.4/074-0003-net-bgmac-Remove-superflous-netif_carrier_on.patch b/target/linux/generic/patches-4.4/071-v4.7-0003-net-bgmac-Remove-superflous-netif_carrier_on.patch similarity index 100% rename from target/linux/generic/patches-4.4/074-0003-net-bgmac-Remove-superflous-netif_carrier_on.patch rename to target/linux/generic/patches-4.4/071-v4.7-0003-net-bgmac-Remove-superflous-netif_carrier_on.patch diff --git a/target/linux/generic/patches-4.4/075-0001-net-ethernet-bgmac-change-bgmac_-prints-to-dev_-prin.patch b/target/linux/generic/patches-4.4/071-v4.8-0001-net-ethernet-bgmac-change-bgmac_-prints-to-dev_-prin.patch similarity index 100% rename from target/linux/generic/patches-4.4/075-0001-net-ethernet-bgmac-change-bgmac_-prints-to-dev_-prin.patch rename to target/linux/generic/patches-4.4/071-v4.8-0001-net-ethernet-bgmac-change-bgmac_-prints-to-dev_-prin.patch diff --git a/target/linux/generic/patches-4.4/075-0002-net-ethernet-bgmac-add-dma_dev-pointer.patch b/target/linux/generic/patches-4.4/071-v4.8-0002-net-ethernet-bgmac-add-dma_dev-pointer.patch similarity index 100% rename from target/linux/generic/patches-4.4/075-0002-net-ethernet-bgmac-add-dma_dev-pointer.patch rename to target/linux/generic/patches-4.4/071-v4.8-0002-net-ethernet-bgmac-add-dma_dev-pointer.patch diff --git a/target/linux/generic/patches-4.4/075-0003-net-ethernet-bgmac-move-BCMA-MDIO-Phy-code-into-a-se.patch b/target/linux/generic/patches-4.4/071-v4.8-0003-net-ethernet-bgmac-move-BCMA-MDIO-Phy-code-into-a-se.patch similarity index 100% rename from target/linux/generic/patches-4.4/075-0003-net-ethernet-bgmac-move-BCMA-MDIO-Phy-code-into-a-se.patch rename to target/linux/generic/patches-4.4/071-v4.8-0003-net-ethernet-bgmac-move-BCMA-MDIO-Phy-code-into-a-se.patch diff --git a/target/linux/generic/patches-4.4/075-0004-net-ethernet-bgmac-convert-to-feature-flags.patch b/target/linux/generic/patches-4.4/071-v4.8-0004-net-ethernet-bgmac-convert-to-feature-flags.patch similarity index 100% rename from target/linux/generic/patches-4.4/075-0004-net-ethernet-bgmac-convert-to-feature-flags.patch rename to target/linux/generic/patches-4.4/071-v4.8-0004-net-ethernet-bgmac-convert-to-feature-flags.patch diff --git a/target/linux/generic/patches-4.4/075-0005-net-ethernet-bgmac-Add-platform-device-support.patch b/target/linux/generic/patches-4.4/071-v4.8-0005-net-ethernet-bgmac-Add-platform-device-support.patch similarity index 100% rename from target/linux/generic/patches-4.4/075-0005-net-ethernet-bgmac-Add-platform-device-support.patch rename to target/linux/generic/patches-4.4/071-v4.8-0005-net-ethernet-bgmac-Add-platform-device-support.patch diff --git a/target/linux/generic/patches-4.4/076-0001-net-ethernet-bgmac-Fix-return-value-check-in-bgmac_p.patch b/target/linux/generic/patches-4.4/071-v4.8-0006-net-ethernet-bgmac-Fix-return-value-check-in-bgmac_p.patch similarity index 100% rename from target/linux/generic/patches-4.4/076-0001-net-ethernet-bgmac-Fix-return-value-check-in-bgmac_p.patch rename to target/linux/generic/patches-4.4/071-v4.8-0006-net-ethernet-bgmac-Fix-return-value-check-in-bgmac_p.patch diff --git a/target/linux/generic/patches-4.4/076-0002-net-ethernet-bgmac-Remove-redundant-dev_err-call-in-.patch b/target/linux/generic/patches-4.4/071-v4.8-0007-net-ethernet-bgmac-Remove-redundant-dev_err-call-in-.patch similarity index 100% rename from target/linux/generic/patches-4.4/076-0002-net-ethernet-bgmac-Remove-redundant-dev_err-call-in-.patch rename to target/linux/generic/patches-4.4/071-v4.8-0007-net-ethernet-bgmac-Remove-redundant-dev_err-call-in-.patch diff --git a/target/linux/generic/patches-4.4/076-0004-net-bgmac-fix-reversed-check-for-MII-registration-er.patch b/target/linux/generic/patches-4.4/071-v4.8-0009-net-bgmac-fix-reversed-check-for-MII-registration-er.patch similarity index 100% rename from target/linux/generic/patches-4.4/076-0004-net-bgmac-fix-reversed-check-for-MII-registration-er.patch rename to target/linux/generic/patches-4.4/071-v4.8-0009-net-bgmac-fix-reversed-check-for-MII-registration-er.patch diff --git a/target/linux/generic/patches-4.4/077-0001-net-bgmac-support-Ethernet-core-on-BCM53573-SoCs.patch b/target/linux/generic/patches-4.4/071-v4.9-0001-net-bgmac-support-Ethernet-core-on-BCM53573-SoCs.patch similarity index 100% rename from target/linux/generic/patches-4.4/077-0001-net-bgmac-support-Ethernet-core-on-BCM53573-SoCs.patch rename to target/linux/generic/patches-4.4/071-v4.9-0001-net-bgmac-support-Ethernet-core-on-BCM53573-SoCs.patch diff --git a/target/linux/generic/patches-4.4/077-0002-net-bgmac-make-it-clear-when-setting-interface-type-.patch b/target/linux/generic/patches-4.4/071-v4.9-0002-net-bgmac-make-it-clear-when-setting-interface-type-.patch similarity index 100% rename from target/linux/generic/patches-4.4/077-0002-net-bgmac-make-it-clear-when-setting-interface-type-.patch rename to target/linux/generic/patches-4.4/071-v4.9-0002-net-bgmac-make-it-clear-when-setting-interface-type-.patch diff --git a/target/linux/generic/patches-4.4/077-0003-net-bgmac-Fix-errant-feature-flag-check.patch b/target/linux/generic/patches-4.4/071-v4.9-0003-net-bgmac-Fix-errant-feature-flag-check.patch similarity index 100% rename from target/linux/generic/patches-4.4/077-0003-net-bgmac-Fix-errant-feature-flag-check.patch rename to target/linux/generic/patches-4.4/071-v4.9-0003-net-bgmac-Fix-errant-feature-flag-check.patch diff --git a/target/linux/generic/patches-4.4/077-0004-net-bgmac-fix-spelling-mistake-connecton-connection.patch b/target/linux/generic/patches-4.4/071-v4.9-0004-net-bgmac-fix-spelling-mistake-connecton-connection.patch similarity index 100% rename from target/linux/generic/patches-4.4/077-0004-net-bgmac-fix-spelling-mistake-connecton-connection.patch rename to target/linux/generic/patches-4.4/071-v4.9-0004-net-bgmac-fix-spelling-mistake-connecton-connection.patch diff --git a/target/linux/generic/patches-4.4/170-net-bgmac-fix-reversed-checks-for-clock-control-flag.patch b/target/linux/generic/patches-4.4/071-v4.9-0005-net-bgmac-fix-reversed-checks-for-clock-control-flag.patch similarity index 86% rename from target/linux/generic/patches-4.4/170-net-bgmac-fix-reversed-checks-for-clock-control-flag.patch rename to target/linux/generic/patches-4.4/071-v4.9-0005-net-bgmac-fix-reversed-checks-for-clock-control-flag.patch index 97d8951589..e9bf06c870 100644 --- a/target/linux/generic/patches-4.4/170-net-bgmac-fix-reversed-checks-for-clock-control-flag.patch +++ b/target/linux/generic/patches-4.4/071-v4.9-0005-net-bgmac-fix-reversed-checks-for-clock-control-flag.patch @@ -1,5 +1,6 @@ +From cdb26d3387f0cdf7b2a2eea581385173547ef21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Mon, 7 Nov 2016 13:19:42 +0100 +Date: Mon, 7 Nov 2016 13:53:27 +0100 Subject: [PATCH] net: bgmac: fix reversed checks for clock control flag This fixes regression introduced by patch adding feature flags. It was @@ -12,6 +13,8 @@ BCM47186B0. Fixes: db791eb2970b ("net: ethernet: bgmac: convert to feature flags") Fixes: 4af1474e6198 ("net: bgmac: Fix errant feature flag check") Cc: Jon Mason +Signed-off-by: Rafał Miłecki +Signed-off-by: David S. Miller --- drivers/net/ethernet/broadcom/bgmac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/generic/patches-4.4/072-net-add-devm-version-of-alloc_etherdev_mqs-function.patch b/target/linux/generic/patches-4.4/072-net-add-devm-version-of-alloc_etherdev_mqs-function.patch new file mode 100644 index 0000000000..be03cca9ee --- /dev/null +++ b/target/linux/generic/patches-4.4/072-net-add-devm-version-of-alloc_etherdev_mqs-function.patch @@ -0,0 +1,70 @@ +From 40be0dda0725886b623d67868db3219a2e74683b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sat, 28 Jan 2017 15:15:42 +0100 +Subject: [PATCH] net: add devm version of alloc_etherdev_mqs function + +This patch adds devm_alloc_etherdev_mqs function and devm_alloc_etherdev +macro. These can be used for simpler netdev allocation without having to +care about calling free_netdev. + +Thanks to this change drivers, their error paths and removal paths may +get simpler by a bit. + +Signed-off-by: Rafał Miłecki +Signed-off-by: David S. Miller +--- + include/linux/etherdevice.h | 5 +++++ + net/ethernet/eth.c | 28 ++++++++++++++++++++++++++++ + 2 files changed, 33 insertions(+) + +--- a/include/linux/etherdevice.h ++++ b/include/linux/etherdevice.h +@@ -51,6 +51,11 @@ struct net_device *alloc_etherdev_mqs(in + #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) + #define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) + ++struct net_device *devm_alloc_etherdev_mqs(struct device *dev, int sizeof_priv, ++ unsigned int txqs, ++ unsigned int rxqs); ++#define devm_alloc_etherdev(dev, sizeof_priv) devm_alloc_etherdev_mqs(dev, sizeof_priv, 1, 1) ++ + struct sk_buff **eth_gro_receive(struct sk_buff **head, + struct sk_buff *skb); + int eth_gro_complete(struct sk_buff *skb, int nhoff); +--- a/net/ethernet/eth.c ++++ b/net/ethernet/eth.c +@@ -388,6 +388,34 @@ struct net_device *alloc_etherdev_mqs(in + } + EXPORT_SYMBOL(alloc_etherdev_mqs); + ++static void devm_free_netdev(struct device *dev, void *res) ++{ ++ free_netdev(*(struct net_device **)res); ++} ++ ++struct net_device *devm_alloc_etherdev_mqs(struct device *dev, int sizeof_priv, ++ unsigned int txqs, unsigned int rxqs) ++{ ++ struct net_device **dr; ++ struct net_device *netdev; ++ ++ dr = devres_alloc(devm_free_netdev, sizeof(*dr), GFP_KERNEL); ++ if (!dr) ++ return NULL; ++ ++ netdev = alloc_etherdev_mqs(sizeof_priv, txqs, rxqs); ++ if (!netdev) { ++ devres_free(dr); ++ return NULL; ++ } ++ ++ *dr = netdev; ++ devres_add(dev, dr); ++ ++ return netdev; ++} ++EXPORT_SYMBOL(devm_alloc_etherdev_mqs); ++ + ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len) + { + return scnprintf(buf, PAGE_SIZE, "%*phC\n", len, addr); diff --git a/target/linux/generic/patches-4.4/073-v4.10-0001-net-bgmac-allocate-struct-bgmac-just-once-don-t-copy.patch b/target/linux/generic/patches-4.4/073-v4.10-0001-net-bgmac-allocate-struct-bgmac-just-once-don-t-copy.patch new file mode 100644 index 0000000000..544a074a78 --- /dev/null +++ b/target/linux/generic/patches-4.4/073-v4.10-0001-net-bgmac-allocate-struct-bgmac-just-once-don-t-copy.patch @@ -0,0 +1,139 @@ +From 34a5102c3235c470a6c77fba16cb971964d9c136 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 31 Jan 2017 19:37:54 +0100 +Subject: [PATCH 1/3] net: bgmac: allocate struct bgmac just once & don't copy + it +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +So far were were allocating struct bgmac in 3 places: platform code, +bcma code and shared bgmac_enet_probe function. The reason for this was +bgmac_enet_probe: +1) Requiring early-filled struct bgmac +2) Calling alloc_etherdev on its own in order to use netdev_priv later + +This solution got few drawbacks: +1) Was duplicating allocating code +2) Required copying early-filled struct +3) Resulted in platform/bcma code having access only to unused struct + +Solve this situation by simply extracting some probe code into the new +bgmac_alloc function. + +Signed-off-by: Rafał Miłecki +Reviewed-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/broadcom/bgmac-bcma.c | 4 +--- + drivers/net/ethernet/broadcom/bgmac-platform.c | 2 +- + drivers/net/ethernet/broadcom/bgmac.c | 25 +++++++++++++++++-------- + drivers/net/ethernet/broadcom/bgmac.h | 3 ++- + 4 files changed, 21 insertions(+), 13 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c ++++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c +@@ -99,12 +99,11 @@ static int bgmac_probe(struct bcma_devic + u8 *mac; + int err; + +- bgmac = kzalloc(sizeof(*bgmac), GFP_KERNEL); ++ bgmac = bgmac_alloc(&core->dev); + if (!bgmac) + return -ENOMEM; + + bgmac->bcma.core = core; +- bgmac->dev = &core->dev; + bgmac->dma_dev = core->dma_dev; + bgmac->irq = core->irq; + +@@ -285,7 +284,6 @@ static int bgmac_probe(struct bcma_devic + err1: + bcma_mdio_mii_unregister(bgmac->mii_bus); + err: +- kfree(bgmac); + bcma_set_drvdata(core, NULL); + + return err; +--- a/drivers/net/ethernet/broadcom/bgmac-platform.c ++++ b/drivers/net/ethernet/broadcom/bgmac-platform.c +@@ -93,7 +93,7 @@ static int bgmac_probe(struct platform_d + struct resource *regs; + const u8 *mac_addr; + +- bgmac = devm_kzalloc(&pdev->dev, sizeof(*bgmac), GFP_KERNEL); ++ bgmac = bgmac_alloc(&pdev->dev); + if (!bgmac) + return -ENOMEM; + +--- a/drivers/net/ethernet/broadcom/bgmac.c ++++ b/drivers/net/ethernet/broadcom/bgmac.c +@@ -1475,22 +1475,32 @@ static int bgmac_phy_connect(struct bgma + return 0; + } + +-int bgmac_enet_probe(struct bgmac *info) ++struct bgmac *bgmac_alloc(struct device *dev) + { + struct net_device *net_dev; + struct bgmac *bgmac; +- int err; + + /* Allocation and references */ +- net_dev = alloc_etherdev(sizeof(*bgmac)); ++ net_dev = devm_alloc_etherdev(dev, sizeof(*bgmac)); + if (!net_dev) +- return -ENOMEM; ++ return NULL; + + net_dev->netdev_ops = &bgmac_netdev_ops; + net_dev->ethtool_ops = &bgmac_ethtool_ops; ++ + bgmac = netdev_priv(net_dev); +- memcpy(bgmac, info, sizeof(*bgmac)); ++ bgmac->dev = dev; + bgmac->net_dev = net_dev; ++ ++ return bgmac; ++} ++EXPORT_SYMBOL_GPL(bgmac_alloc); ++ ++int bgmac_enet_probe(struct bgmac *bgmac) ++{ ++ struct net_device *net_dev = bgmac->net_dev; ++ int err; ++ + net_dev->irq = bgmac->irq; + SET_NETDEV_DEV(net_dev, bgmac->dev); + +@@ -1517,7 +1527,7 @@ int bgmac_enet_probe(struct bgmac *info) + err = bgmac_dma_alloc(bgmac); + if (err) { + dev_err(bgmac->dev, "Unable to alloc memory for DMA\n"); +- goto err_netdev_free; ++ goto err_out; + } + + bgmac->int_mask = BGMAC_IS_ERRMASK | BGMAC_IS_RX | BGMAC_IS_TX_MASK; +@@ -1553,8 +1563,7 @@ err_phy_disconnect: + phy_disconnect(net_dev->phydev); + err_dma_free: + bgmac_dma_free(bgmac); +-err_netdev_free: +- free_netdev(net_dev); ++err_out: + + return err; + } +--- a/drivers/net/ethernet/broadcom/bgmac.h ++++ b/drivers/net/ethernet/broadcom/bgmac.h +@@ -515,7 +515,8 @@ struct bgmac { + u32 set); + }; + +-int bgmac_enet_probe(struct bgmac *info); ++struct bgmac *bgmac_alloc(struct device *dev); ++int bgmac_enet_probe(struct bgmac *bgmac); + void bgmac_enet_remove(struct bgmac *bgmac); + + struct mii_bus *bcma_mdio_mii_register(struct bcma_device *core, u8 phyaddr); diff --git a/target/linux/generic/patches-4.4/073-v4.10-0002-net-bgmac-drop-struct-bcma_mdio-we-don-t-need-anymor.patch b/target/linux/generic/patches-4.4/073-v4.10-0002-net-bgmac-drop-struct-bcma_mdio-we-don-t-need-anymor.patch new file mode 100644 index 0000000000..8848f619ea --- /dev/null +++ b/target/linux/generic/patches-4.4/073-v4.10-0002-net-bgmac-drop-struct-bcma_mdio-we-don-t-need-anymor.patch @@ -0,0 +1,274 @@ +From aa8863e5d49417094b9457a0d53e8505e95a1863 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 31 Jan 2017 19:37:55 +0100 +Subject: [PATCH 2/3] net: bgmac: drop struct bcma_mdio we don't need anymore +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Adding struct bcma_mdio was a workaround for bcma code not having access +to the struct bgmac used in the core code. Now we don't duplicate this +struct we can just use it internally in bcma code. + +This simplifies code & allows access to all bgmac driver details from +all places in bcma code. + +Signed-off-by: Rafał Miłecki +Reviewed-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c | 98 ++++++++++--------------- + drivers/net/ethernet/broadcom/bgmac-bcma.c | 2 +- + drivers/net/ethernet/broadcom/bgmac.h | 2 +- + 3 files changed, 42 insertions(+), 60 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c ++++ b/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c +@@ -12,11 +12,6 @@ + #include + #include "bgmac.h" + +-struct bcma_mdio { +- struct bcma_device *core; +- u8 phyaddr; +-}; +- + static bool bcma_mdio_wait_value(struct bcma_device *core, u16 reg, u32 mask, + u32 value, int timeout) + { +@@ -37,7 +32,7 @@ static bool bcma_mdio_wait_value(struct + * PHY ops + **************************************************/ + +-static u16 bcma_mdio_phy_read(struct bcma_mdio *bcma_mdio, u8 phyaddr, u8 reg) ++static u16 bcma_mdio_phy_read(struct bgmac *bgmac, u8 phyaddr, u8 reg) + { + struct bcma_device *core; + u16 phy_access_addr; +@@ -56,12 +51,12 @@ static u16 bcma_mdio_phy_read(struct bcm + BUILD_BUG_ON(BGMAC_PC_MCT_SHIFT != BCMA_GMAC_CMN_PC_MCT_SHIFT); + BUILD_BUG_ON(BGMAC_PC_MTE != BCMA_GMAC_CMN_PC_MTE); + +- if (bcma_mdio->core->id.id == BCMA_CORE_4706_MAC_GBIT) { +- core = bcma_mdio->core->bus->drv_gmac_cmn.core; ++ if (bgmac->bcma.core->id.id == BCMA_CORE_4706_MAC_GBIT) { ++ core = bgmac->bcma.core->bus->drv_gmac_cmn.core; + phy_access_addr = BCMA_GMAC_CMN_PHY_ACCESS; + phy_ctl_addr = BCMA_GMAC_CMN_PHY_CTL; + } else { +- core = bcma_mdio->core; ++ core = bgmac->bcma.core; + phy_access_addr = BGMAC_PHY_ACCESS; + phy_ctl_addr = BGMAC_PHY_CNTL; + } +@@ -87,7 +82,7 @@ static u16 bcma_mdio_phy_read(struct bcm + } + + /* http://bcm-v4.sipsolutions.net/mac-gbit/gmac/chipphywr */ +-static int bcma_mdio_phy_write(struct bcma_mdio *bcma_mdio, u8 phyaddr, u8 reg, ++static int bcma_mdio_phy_write(struct bgmac *bgmac, u8 phyaddr, u8 reg, + u16 value) + { + struct bcma_device *core; +@@ -95,12 +90,12 @@ static int bcma_mdio_phy_write(struct bc + u16 phy_ctl_addr; + u32 tmp; + +- if (bcma_mdio->core->id.id == BCMA_CORE_4706_MAC_GBIT) { +- core = bcma_mdio->core->bus->drv_gmac_cmn.core; ++ if (bgmac->bcma.core->id.id == BCMA_CORE_4706_MAC_GBIT) { ++ core = bgmac->bcma.core->bus->drv_gmac_cmn.core; + phy_access_addr = BCMA_GMAC_CMN_PHY_ACCESS; + phy_ctl_addr = BCMA_GMAC_CMN_PHY_CTL; + } else { +- core = bcma_mdio->core; ++ core = bgmac->bcma.core; + phy_access_addr = BGMAC_PHY_ACCESS; + phy_ctl_addr = BGMAC_PHY_CNTL; + } +@@ -110,8 +105,8 @@ static int bcma_mdio_phy_write(struct bc + tmp |= phyaddr; + bcma_write32(core, phy_ctl_addr, tmp); + +- bcma_write32(bcma_mdio->core, BGMAC_INT_STATUS, BGMAC_IS_MDIO); +- if (bcma_read32(bcma_mdio->core, BGMAC_INT_STATUS) & BGMAC_IS_MDIO) ++ bcma_write32(bgmac->bcma.core, BGMAC_INT_STATUS, BGMAC_IS_MDIO); ++ if (bcma_read32(bgmac->bcma.core, BGMAC_INT_STATUS) & BGMAC_IS_MDIO) + dev_warn(&core->dev, "Error setting MDIO int\n"); + + tmp = BGMAC_PA_START; +@@ -132,39 +127,39 @@ static int bcma_mdio_phy_write(struct bc + } + + /* http://bcm-v4.sipsolutions.net/mac-gbit/gmac/chipphyinit */ +-static void bcma_mdio_phy_init(struct bcma_mdio *bcma_mdio) ++static void bcma_mdio_phy_init(struct bgmac *bgmac) + { +- struct bcma_chipinfo *ci = &bcma_mdio->core->bus->chipinfo; ++ struct bcma_chipinfo *ci = &bgmac->bcma.core->bus->chipinfo; + u8 i; + + if (ci->id == BCMA_CHIP_ID_BCM5356) { + for (i = 0; i < 5; i++) { +- bcma_mdio_phy_write(bcma_mdio, i, 0x1f, 0x008b); +- bcma_mdio_phy_write(bcma_mdio, i, 0x15, 0x0100); +- bcma_mdio_phy_write(bcma_mdio, i, 0x1f, 0x000f); +- bcma_mdio_phy_write(bcma_mdio, i, 0x12, 0x2aaa); +- bcma_mdio_phy_write(bcma_mdio, i, 0x1f, 0x000b); ++ bcma_mdio_phy_write(bgmac, i, 0x1f, 0x008b); ++ bcma_mdio_phy_write(bgmac, i, 0x15, 0x0100); ++ bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000f); ++ bcma_mdio_phy_write(bgmac, i, 0x12, 0x2aaa); ++ bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000b); + } + } + if ((ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg != 10) || + (ci->id == BCMA_CHIP_ID_BCM4749 && ci->pkg != 10) || + (ci->id == BCMA_CHIP_ID_BCM53572 && ci->pkg != 9)) { +- struct bcma_drv_cc *cc = &bcma_mdio->core->bus->drv_cc; ++ struct bcma_drv_cc *cc = &bgmac->bcma.core->bus->drv_cc; + + bcma_chipco_chipctl_maskset(cc, 2, ~0xc0000000, 0); + bcma_chipco_chipctl_maskset(cc, 4, ~0x80000000, 0); + for (i = 0; i < 5; i++) { +- bcma_mdio_phy_write(bcma_mdio, i, 0x1f, 0x000f); +- bcma_mdio_phy_write(bcma_mdio, i, 0x16, 0x5284); +- bcma_mdio_phy_write(bcma_mdio, i, 0x1f, 0x000b); +- bcma_mdio_phy_write(bcma_mdio, i, 0x17, 0x0010); +- bcma_mdio_phy_write(bcma_mdio, i, 0x1f, 0x000f); +- bcma_mdio_phy_write(bcma_mdio, i, 0x16, 0x5296); +- bcma_mdio_phy_write(bcma_mdio, i, 0x17, 0x1073); +- bcma_mdio_phy_write(bcma_mdio, i, 0x17, 0x9073); +- bcma_mdio_phy_write(bcma_mdio, i, 0x16, 0x52b6); +- bcma_mdio_phy_write(bcma_mdio, i, 0x17, 0x9273); +- bcma_mdio_phy_write(bcma_mdio, i, 0x1f, 0x000b); ++ bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000f); ++ bcma_mdio_phy_write(bgmac, i, 0x16, 0x5284); ++ bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000b); ++ bcma_mdio_phy_write(bgmac, i, 0x17, 0x0010); ++ bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000f); ++ bcma_mdio_phy_write(bgmac, i, 0x16, 0x5296); ++ bcma_mdio_phy_write(bgmac, i, 0x17, 0x1073); ++ bcma_mdio_phy_write(bgmac, i, 0x17, 0x9073); ++ bcma_mdio_phy_write(bgmac, i, 0x16, 0x52b6); ++ bcma_mdio_phy_write(bgmac, i, 0x17, 0x9273); ++ bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000b); + } + } + } +@@ -172,17 +167,17 @@ static void bcma_mdio_phy_init(struct bc + /* http://bcm-v4.sipsolutions.net/mac-gbit/gmac/chipphyreset */ + static int bcma_mdio_phy_reset(struct mii_bus *bus) + { +- struct bcma_mdio *bcma_mdio = bus->priv; +- u8 phyaddr = bcma_mdio->phyaddr; ++ struct bgmac *bgmac = bus->priv; ++ u8 phyaddr = bgmac->phyaddr; + +- if (bcma_mdio->phyaddr == BGMAC_PHY_NOREGS) ++ if (phyaddr == BGMAC_PHY_NOREGS) + return 0; + +- bcma_mdio_phy_write(bcma_mdio, phyaddr, MII_BMCR, BMCR_RESET); ++ bcma_mdio_phy_write(bgmac, phyaddr, MII_BMCR, BMCR_RESET); + udelay(100); +- if (bcma_mdio_phy_read(bcma_mdio, phyaddr, MII_BMCR) & BMCR_RESET) +- dev_err(&bcma_mdio->core->dev, "PHY reset failed\n"); +- bcma_mdio_phy_init(bcma_mdio); ++ if (bcma_mdio_phy_read(bgmac, phyaddr, MII_BMCR) & BMCR_RESET) ++ dev_err(bgmac->dev, "PHY reset failed\n"); ++ bcma_mdio_phy_init(bgmac); + + return 0; + } +@@ -202,16 +197,12 @@ static int bcma_mdio_mii_write(struct mi + return bcma_mdio_phy_write(bus->priv, mii_id, regnum, value); + } + +-struct mii_bus *bcma_mdio_mii_register(struct bcma_device *core, u8 phyaddr) ++struct mii_bus *bcma_mdio_mii_register(struct bgmac *bgmac) + { +- struct bcma_mdio *bcma_mdio; ++ struct bcma_device *core = bgmac->bcma.core; + struct mii_bus *mii_bus; + int i, err; + +- bcma_mdio = kzalloc(sizeof(*bcma_mdio), GFP_KERNEL); +- if (!bcma_mdio) +- return ERR_PTR(-ENOMEM); +- + mii_bus = mdiobus_alloc(); + if (!mii_bus) { + err = -ENOMEM; +@@ -221,12 +212,12 @@ struct mii_bus *bcma_mdio_mii_register(s + mii_bus->name = "bcma_mdio mii bus"; + sprintf(mii_bus->id, "%s-%d-%d", "bcma_mdio", core->bus->num, + core->core_unit); +- mii_bus->priv = bcma_mdio; ++ mii_bus->priv = bgmac; + mii_bus->read = bcma_mdio_mii_read; + mii_bus->write = bcma_mdio_mii_write; + mii_bus->reset = bcma_mdio_phy_reset; + mii_bus->parent = &core->dev; +- mii_bus->phy_mask = ~(1 << phyaddr); ++ mii_bus->phy_mask = ~(1 << bgmac->phyaddr); + + mii_bus->irq = kmalloc_array(PHY_MAX_ADDR, sizeof(int), GFP_KERNEL); + if (!mii_bus->irq) { +@@ -236,9 +227,6 @@ struct mii_bus *bcma_mdio_mii_register(s + for (i = 0; i < PHY_MAX_ADDR; i++) + mii_bus->irq[i] = PHY_POLL; + +- bcma_mdio->core = core; +- bcma_mdio->phyaddr = phyaddr; +- + err = mdiobus_register(mii_bus); + if (err) { + dev_err(&core->dev, "Registration of mii bus failed\n"); +@@ -252,24 +240,18 @@ err_free_irq: + err_free_bus: + mdiobus_free(mii_bus); + err: +- kfree(bcma_mdio); + return ERR_PTR(err); + } + EXPORT_SYMBOL_GPL(bcma_mdio_mii_register); + + void bcma_mdio_mii_unregister(struct mii_bus *mii_bus) + { +- struct bcma_mdio *bcma_mdio; +- + if (!mii_bus) + return; + +- bcma_mdio = mii_bus->priv; +- + mdiobus_unregister(mii_bus); + kfree(mii_bus->irq); + mdiobus_free(mii_bus); +- kfree(bcma_mdio); + } + EXPORT_SYMBOL_GPL(bcma_mdio_mii_unregister); + +--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c ++++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c +@@ -159,7 +159,7 @@ static int bgmac_probe(struct bcma_devic + + if (!bgmac_is_bcm4707_family(core) && + !(ci->id == BCMA_CHIP_ID_BCM53573 && core->core_unit == 1)) { +- mii_bus = bcma_mdio_mii_register(core, bgmac->phyaddr); ++ mii_bus = bcma_mdio_mii_register(bgmac); + if (IS_ERR(mii_bus)) { + err = PTR_ERR(mii_bus); + goto err; +--- a/drivers/net/ethernet/broadcom/bgmac.h ++++ b/drivers/net/ethernet/broadcom/bgmac.h +@@ -519,7 +519,7 @@ struct bgmac *bgmac_alloc(struct device + int bgmac_enet_probe(struct bgmac *bgmac); + void bgmac_enet_remove(struct bgmac *bgmac); + +-struct mii_bus *bcma_mdio_mii_register(struct bcma_device *core, u8 phyaddr); ++struct mii_bus *bcma_mdio_mii_register(struct bgmac *bgmac); + void bcma_mdio_mii_unregister(struct mii_bus *mii_bus); + + static inline u32 bgmac_read(struct bgmac *bgmac, u16 offset) diff --git a/target/linux/generic/patches-4.4/073-v4.10-0003-net-bgmac-use-PHY-subsystem-for-initializing-PHY.patch b/target/linux/generic/patches-4.4/073-v4.10-0003-net-bgmac-use-PHY-subsystem-for-initializing-PHY.patch new file mode 100644 index 0000000000..d1be3e3f4c --- /dev/null +++ b/target/linux/generic/patches-4.4/073-v4.10-0003-net-bgmac-use-PHY-subsystem-for-initializing-PHY.patch @@ -0,0 +1,53 @@ +From 8e6f31baba7e2c13ab7e954fe6179420a7545a8b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 31 Jan 2017 19:37:56 +0100 +Subject: [PATCH 3/3] net: bgmac: use PHY subsystem for initializing PHY +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This adds support for using bgmac with PHYs supported by standalone PHY +drivers. Having any PHY initialization in bgmac is hacky and shouldn't +be extended but rather removed if anyone has hardware to test it. + +Signed-off-by: Rafał Miłecki +Reviewed-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c ++++ b/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c +@@ -132,6 +132,10 @@ static void bcma_mdio_phy_init(struct bg + struct bcma_chipinfo *ci = &bgmac->bcma.core->bus->chipinfo; + u8 i; + ++ /* For some legacy hardware we do chipset-based PHY initialization here ++ * without even detecting PHY ID. It's hacky and should be cleaned as ++ * soon as someone can test it. ++ */ + if (ci->id == BCMA_CHIP_ID_BCM5356) { + for (i = 0; i < 5; i++) { + bcma_mdio_phy_write(bgmac, i, 0x1f, 0x008b); +@@ -140,6 +144,7 @@ static void bcma_mdio_phy_init(struct bg + bcma_mdio_phy_write(bgmac, i, 0x12, 0x2aaa); + bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000b); + } ++ return; + } + if ((ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg != 10) || + (ci->id == BCMA_CHIP_ID_BCM4749 && ci->pkg != 10) || +@@ -161,7 +166,12 @@ static void bcma_mdio_phy_init(struct bg + bcma_mdio_phy_write(bgmac, i, 0x17, 0x9273); + bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000b); + } ++ return; + } ++ ++ /* For all other hw do initialization using PHY subsystem. */ ++ if (bgmac->net_dev && bgmac->net_dev->phydev) ++ phy_init_hw(bgmac->net_dev->phydev); + } + + /* http://bcm-v4.sipsolutions.net/mac-gbit/gmac/chipphyreset */ diff --git a/target/linux/generic/patches-4.4/078-0003-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch b/target/linux/generic/patches-4.4/078-0003-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch new file mode 100644 index 0000000000..1186559bbc --- /dev/null +++ b/target/linux/generic/patches-4.4/078-0003-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch @@ -0,0 +1,278 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Subject: [PATCH 1/2] net: phy: cherry-pick Broadcom drivers updates from + v4.10-rc1 + +Signed-off-by: Rafał Miłecki +--- + +--- a/drivers/net/phy/broadcom.c ++++ b/drivers/net/phy/broadcom.c +@@ -18,7 +18,7 @@ + #include + #include + #include +- ++#include + + #define BRCM_PHY_MODEL(phydev) \ + ((phydev)->drv->phy_id & (phydev)->drv->phy_id_mask) +@@ -30,9 +30,32 @@ MODULE_DESCRIPTION("Broadcom PHY driver" + MODULE_AUTHOR("Maciej W. Rozycki"); + MODULE_LICENSE("GPL"); + +-static int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val) ++static int bcm54810_config(struct phy_device *phydev) + { +- return phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum | val); ++ int rc, val; ++ ++ val = bcm_phy_read_exp(phydev, BCM54810_EXP_BROADREACH_LRE_MISC_CTL); ++ val &= ~BCM54810_EXP_BROADREACH_LRE_MISC_CTL_EN; ++ rc = bcm_phy_write_exp(phydev, BCM54810_EXP_BROADREACH_LRE_MISC_CTL, ++ val); ++ if (rc < 0) ++ return rc; ++ ++ val = bcm54xx_auxctl_read(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC); ++ val &= ~MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN; ++ val |= MII_BCM54XX_AUXCTL_MISC_WREN; ++ rc = bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC, ++ val); ++ if (rc < 0) ++ return rc; ++ ++ val = bcm_phy_read_shadow(phydev, BCM54810_SHD_CLK_CTL); ++ val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN; ++ rc = bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val); ++ if (rc < 0) ++ return rc; ++ ++ return 0; + } + + /* Needs SMDSP clock enabled via bcm54xx_phydsp_config() */ +@@ -207,6 +230,12 @@ static int bcm54xx_config_init(struct ph + (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE)) + bcm54xx_adjust_rxrefclk(phydev); + ++ if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54810) { ++ err = bcm54810_config(phydev); ++ if (err) ++ return err; ++ } ++ + bcm54xx_phydsp_config(phydev); + + return 0; +@@ -304,6 +333,7 @@ static int bcm5482_read_status(struct ph + + static int bcm5481_config_aneg(struct phy_device *phydev) + { ++ struct device_node *np = phydev->dev.of_node; + int ret; + + /* Aneg firsly. */ +@@ -334,6 +364,49 @@ static int bcm5481_config_aneg(struct ph + phy_write(phydev, 0x18, reg); + } + ++ if (of_property_read_bool(np, "enet-phy-lane-swap")) { ++ /* Lane Swap - Undocumented register...magic! */ ++ ret = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_SEL_ER + 0x9, ++ 0x11B); ++ if (ret < 0) ++ return ret; ++ } ++ ++ return ret; ++} ++ ++static int bcm54612e_config_aneg(struct phy_device *phydev) ++{ ++ int ret; ++ ++ /* First, auto-negotiate. */ ++ ret = genphy_config_aneg(phydev); ++ ++ /* Clear TX internal delay unless requested. */ ++ if ((phydev->interface != PHY_INTERFACE_MODE_RGMII_ID) && ++ (phydev->interface != PHY_INTERFACE_MODE_RGMII_TXID)) { ++ /* Disable TXD to GTXCLK clock delay (default set) */ ++ /* Bit 9 is the only field in shadow register 00011 */ ++ bcm_phy_write_shadow(phydev, 0x03, 0); ++ } ++ ++ /* Clear RX internal delay unless requested. */ ++ if ((phydev->interface != PHY_INTERFACE_MODE_RGMII_ID) && ++ (phydev->interface != PHY_INTERFACE_MODE_RGMII_RXID)) { ++ u16 reg; ++ ++ /* Errata: reads require filling in the write selector field */ ++ bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC, ++ MII_BCM54XX_AUXCTL_MISC_RDSEL_MISC); ++ reg = phy_read(phydev, MII_BCM54XX_AUX_CTL); ++ /* Disable RXD to RXC delay (default set) */ ++ reg &= ~MII_BCM54XX_AUXCTL_MISC_RXD_RXC_SKEW; ++ /* Clear shadow selector field */ ++ reg &= ~MII_BCM54XX_AUXCTL_SHDWSEL_MASK; ++ bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC, ++ MII_BCM54XX_AUXCTL_MISC_WREN | reg); ++ } ++ + return ret; + } + +@@ -488,6 +561,19 @@ static struct phy_driver broadcom_driver + .config_intr = bcm_phy_config_intr, + .driver = { .owner = THIS_MODULE }, + }, { ++ .phy_id = PHY_ID_BCM54612E, ++ .phy_id_mask = 0xfffffff0, ++ .name = "Broadcom BCM54612E", ++ .features = PHY_GBIT_FEATURES | ++ SUPPORTED_Pause | SUPPORTED_Asym_Pause, ++ .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, ++ .config_init = bcm54xx_config_init, ++ .config_aneg = bcm54612e_config_aneg, ++ .read_status = genphy_read_status, ++ .ack_interrupt = bcm_phy_ack_intr, ++ .config_intr = bcm_phy_config_intr, ++ .driver = { .owner = THIS_MODULE }, ++}, { + .phy_id = PHY_ID_BCM54616S, + .phy_id_mask = 0xfffffff0, + .name = "Broadcom BCM54616S", +@@ -527,6 +613,19 @@ static struct phy_driver broadcom_driver + .config_intr = bcm_phy_config_intr, + .driver = { .owner = THIS_MODULE }, + }, { ++ .phy_id = PHY_ID_BCM54810, ++ .phy_id_mask = 0xfffffff0, ++ .name = "Broadcom BCM54810", ++ .features = PHY_GBIT_FEATURES | ++ SUPPORTED_Pause | SUPPORTED_Asym_Pause, ++ .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, ++ .config_init = bcm54xx_config_init, ++ .config_aneg = bcm5481_config_aneg, ++ .read_status = genphy_read_status, ++ .ack_interrupt = bcm_phy_ack_intr, ++ .config_intr = bcm_phy_config_intr, ++ .driver = { .owner = THIS_MODULE }, ++}, { + .phy_id = PHY_ID_BCM5482, + .phy_id_mask = 0xfffffff0, + .name = "Broadcom BCM5482", +@@ -612,9 +711,11 @@ static struct mdio_device_id __maybe_unu + { PHY_ID_BCM5411, 0xfffffff0 }, + { PHY_ID_BCM5421, 0xfffffff0 }, + { PHY_ID_BCM5461, 0xfffffff0 }, ++ { PHY_ID_BCM54612E, 0xfffffff0 }, + { PHY_ID_BCM54616S, 0xfffffff0 }, + { PHY_ID_BCM5464, 0xfffffff0 }, + { PHY_ID_BCM5481, 0xfffffff0 }, ++ { PHY_ID_BCM54810, 0xfffffff0 }, + { PHY_ID_BCM5482, 0xfffffff0 }, + { PHY_ID_BCM50610, 0xfffffff0 }, + { PHY_ID_BCM50610M, 0xfffffff0 }, +--- a/include/linux/brcmphy.h ++++ b/include/linux/brcmphy.h +@@ -13,11 +13,13 @@ + #define PHY_ID_BCM5241 0x0143bc30 + #define PHY_ID_BCMAC131 0x0143bc70 + #define PHY_ID_BCM5481 0x0143bca0 ++#define PHY_ID_BCM54810 0x03625d00 + #define PHY_ID_BCM5482 0x0143bcb0 + #define PHY_ID_BCM5411 0x00206070 + #define PHY_ID_BCM5421 0x002060e0 + #define PHY_ID_BCM5464 0x002060b0 + #define PHY_ID_BCM5461 0x002060c0 ++#define PHY_ID_BCM54612E 0x03625e60 + #define PHY_ID_BCM54616S 0x03625d10 + #define PHY_ID_BCM57780 0x03625d90 + +@@ -52,6 +54,7 @@ + #define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00002000 + #define PHY_BRCM_CLEAR_RGMII_MODE 0x00004000 + #define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00008000 ++ + /* Broadcom BCM7xxx specific workarounds */ + #define PHY_BRCM_7XXX_REV(x) (((x) >> 8) & 0xff) + #define PHY_BRCM_7XXX_PATCH(x) ((x) & 0xff) +@@ -102,11 +105,14 @@ + #define MII_BCM54XX_AUXCTL_ACTL_SMDSP_ENA 0x0800 + + #define MII_BCM54XX_AUXCTL_MISC_WREN 0x8000 ++#define MII_BCM54XX_AUXCTL_MISC_RXD_RXC_SKEW 0x0100 + #define MII_BCM54XX_AUXCTL_MISC_FORCE_AMDIX 0x0200 + #define MII_BCM54XX_AUXCTL_MISC_RDSEL_MISC 0x7000 + #define MII_BCM54XX_AUXCTL_SHDWSEL_MISC 0x0007 ++#define MII_BCM54XX_AUXCTL_SHDWSEL_READ_SHIFT 12 ++#define MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN (1 << 8) + +-#define MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL 0x0000 ++#define MII_BCM54XX_AUXCTL_SHDWSEL_MASK 0x0007 + + /* + * Broadcom LED source encodings. These are used in BCM5461, BCM5481, +@@ -186,6 +192,12 @@ + #define BCM5482_SSD_SGMII_SLAVE_EN 0x0002 /* Slave mode enable */ + #define BCM5482_SSD_SGMII_SLAVE_AD 0x0001 /* Slave auto-detection */ + ++/* BCM54810 Registers */ ++#define BCM54810_EXP_BROADREACH_LRE_MISC_CTL (MII_BCM54XX_EXP_SEL_ER + 0x90) ++#define BCM54810_EXP_BROADREACH_LRE_MISC_CTL_EN (1 << 0) ++#define BCM54810_SHD_CLK_CTL 0x3 ++#define BCM54810_SHD_CLK_CTL_GTXCLK_EN (1 << 9) ++ + + /*****************************************************************************/ + /* Fast Ethernet Transceiver definitions. */ +--- a/drivers/net/phy/Kconfig ++++ b/drivers/net/phy/Kconfig +@@ -77,7 +77,7 @@ config BROADCOM_PHY + select BCM_NET_PHYLIB + ---help--- + Currently supports the BCM5411, BCM5421, BCM5461, BCM54616S, BCM5464, +- BCM5481 and BCM5482 PHYs. ++ BCM5481, BCM54810 and BCM5482 PHYs. + + config BCM_CYGNUS_PHY + tristate "Drivers for Broadcom Cygnus SoC internal PHY" +--- a/drivers/net/phy/bcm-phy-lib.c ++++ b/drivers/net/phy/bcm-phy-lib.c +@@ -50,6 +50,23 @@ int bcm_phy_read_exp(struct phy_device * + } + EXPORT_SYMBOL_GPL(bcm_phy_read_exp); + ++int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum) ++{ ++ /* The register must be written to both the Shadow Register Select and ++ * the Shadow Read Register Selector ++ */ ++ phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum | ++ regnum << MII_BCM54XX_AUXCTL_SHDWSEL_READ_SHIFT); ++ return phy_read(phydev, MII_BCM54XX_AUX_CTL); ++} ++EXPORT_SYMBOL_GPL(bcm54xx_auxctl_read); ++ ++int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val) ++{ ++ return phy_write(phydev, MII_BCM54XX_AUX_CTL, regnum | val); ++} ++EXPORT_SYMBOL(bcm54xx_auxctl_write); ++ + int bcm_phy_write_misc(struct phy_device *phydev, + u16 reg, u16 chl, u16 val) + { +--- a/drivers/net/phy/bcm-phy-lib.h ++++ b/drivers/net/phy/bcm-phy-lib.h +@@ -19,6 +19,9 @@ + int bcm_phy_write_exp(struct phy_device *phydev, u16 reg, u16 val); + int bcm_phy_read_exp(struct phy_device *phydev, u16 reg); + ++int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val); ++int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum); ++ + int bcm_phy_write_misc(struct phy_device *phydev, + u16 reg, u16 chl, u16 value); + int bcm_phy_read_misc(struct phy_device *phydev, diff --git a/target/linux/generic/patches-4.4/078-0004-net-phy-pick-Broadcom-drivers-updates-from-net-next-.patch b/target/linux/generic/patches-4.4/078-0004-net-phy-pick-Broadcom-drivers-updates-from-net-next-.patch new file mode 100644 index 0000000000..d050691841 --- /dev/null +++ b/target/linux/generic/patches-4.4/078-0004-net-phy-pick-Broadcom-drivers-updates-from-net-next-.patch @@ -0,0 +1,159 @@ +--- a/drivers/net/phy/broadcom.c ++++ b/drivers/net/phy/broadcom.c +@@ -30,6 +30,50 @@ MODULE_DESCRIPTION("Broadcom PHY driver" + MODULE_AUTHOR("Maciej W. Rozycki"); + MODULE_LICENSE("GPL"); + ++static int bcm54210e_config_init(struct phy_device *phydev) ++{ ++ int val; ++ ++ val = bcm54xx_auxctl_read(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC); ++ val &= ~MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN; ++ val |= MII_BCM54XX_AUXCTL_MISC_WREN; ++ bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC, val); ++ ++ val = bcm_phy_read_shadow(phydev, BCM54810_SHD_CLK_CTL); ++ val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN; ++ bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val); ++ ++ return 0; ++} ++ ++static int bcm54612e_config_init(struct phy_device *phydev) ++{ ++ /* Clear TX internal delay unless requested. */ ++ if ((phydev->interface != PHY_INTERFACE_MODE_RGMII_ID) && ++ (phydev->interface != PHY_INTERFACE_MODE_RGMII_TXID)) { ++ /* Disable TXD to GTXCLK clock delay (default set) */ ++ /* Bit 9 is the only field in shadow register 00011 */ ++ bcm_phy_write_shadow(phydev, 0x03, 0); ++ } ++ ++ /* Clear RX internal delay unless requested. */ ++ if ((phydev->interface != PHY_INTERFACE_MODE_RGMII_ID) && ++ (phydev->interface != PHY_INTERFACE_MODE_RGMII_RXID)) { ++ u16 reg; ++ ++ reg = bcm54xx_auxctl_read(phydev, ++ MII_BCM54XX_AUXCTL_SHDWSEL_MISC); ++ /* Disable RXD to RXC delay (default set) */ ++ reg &= ~MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN; ++ /* Clear shadow selector field */ ++ reg &= ~MII_BCM54XX_AUXCTL_SHDWSEL_MASK; ++ bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC, ++ MII_BCM54XX_AUXCTL_MISC_WREN | reg); ++ } ++ ++ return 0; ++} ++ + static int bcm54810_config(struct phy_device *phydev) + { + int rc, val; +@@ -230,7 +274,15 @@ static int bcm54xx_config_init(struct ph + (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE)) + bcm54xx_adjust_rxrefclk(phydev); + +- if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54810) { ++ if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54210E) { ++ err = bcm54210e_config_init(phydev); ++ if (err) ++ return err; ++ } else if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54612E) { ++ err = bcm54612e_config_init(phydev); ++ if (err) ++ return err; ++ } else if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54810) { + err = bcm54810_config(phydev); + if (err) + return err; +@@ -375,41 +427,6 @@ static int bcm5481_config_aneg(struct ph + return ret; + } + +-static int bcm54612e_config_aneg(struct phy_device *phydev) +-{ +- int ret; +- +- /* First, auto-negotiate. */ +- ret = genphy_config_aneg(phydev); +- +- /* Clear TX internal delay unless requested. */ +- if ((phydev->interface != PHY_INTERFACE_MODE_RGMII_ID) && +- (phydev->interface != PHY_INTERFACE_MODE_RGMII_TXID)) { +- /* Disable TXD to GTXCLK clock delay (default set) */ +- /* Bit 9 is the only field in shadow register 00011 */ +- bcm_phy_write_shadow(phydev, 0x03, 0); +- } +- +- /* Clear RX internal delay unless requested. */ +- if ((phydev->interface != PHY_INTERFACE_MODE_RGMII_ID) && +- (phydev->interface != PHY_INTERFACE_MODE_RGMII_RXID)) { +- u16 reg; +- +- /* Errata: reads require filling in the write selector field */ +- bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC, +- MII_BCM54XX_AUXCTL_MISC_RDSEL_MISC); +- reg = phy_read(phydev, MII_BCM54XX_AUX_CTL); +- /* Disable RXD to RXC delay (default set) */ +- reg &= ~MII_BCM54XX_AUXCTL_MISC_RXD_RXC_SKEW; +- /* Clear shadow selector field */ +- reg &= ~MII_BCM54XX_AUXCTL_SHDWSEL_MASK; +- bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC, +- MII_BCM54XX_AUXCTL_MISC_WREN | reg); +- } +- +- return ret; +-} +- + static int brcm_phy_setbits(struct phy_device *phydev, int reg, int set) + { + int val; +@@ -548,6 +565,19 @@ static struct phy_driver broadcom_driver + .config_intr = bcm_phy_config_intr, + .driver = { .owner = THIS_MODULE }, + }, { ++ .phy_id = PHY_ID_BCM54210E, ++ .phy_id_mask = 0xfffffff0, ++ .name = "Broadcom BCM54210E", ++ .features = PHY_GBIT_FEATURES | ++ SUPPORTED_Pause | SUPPORTED_Asym_Pause, ++ .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, ++ .config_init = bcm54xx_config_init, ++ .config_aneg = genphy_config_aneg, ++ .read_status = genphy_read_status, ++ .ack_interrupt = bcm_phy_ack_intr, ++ .config_intr = bcm_phy_config_intr, ++ .driver = { .owner = THIS_MODULE }, ++}, { + .phy_id = PHY_ID_BCM5461, + .phy_id_mask = 0xfffffff0, + .name = "Broadcom BCM5461", +@@ -568,7 +598,7 @@ static struct phy_driver broadcom_driver + SUPPORTED_Pause | SUPPORTED_Asym_Pause, + .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, + .config_init = bcm54xx_config_init, +- .config_aneg = bcm54612e_config_aneg, ++ .config_aneg = genphy_config_aneg, + .read_status = genphy_read_status, + .ack_interrupt = bcm_phy_ack_intr, + .config_intr = bcm_phy_config_intr, +@@ -710,6 +740,7 @@ module_phy_driver(broadcom_drivers); + static struct mdio_device_id __maybe_unused broadcom_tbl[] = { + { PHY_ID_BCM5411, 0xfffffff0 }, + { PHY_ID_BCM5421, 0xfffffff0 }, ++ { PHY_ID_BCM54210E, 0xfffffff0 }, + { PHY_ID_BCM5461, 0xfffffff0 }, + { PHY_ID_BCM54612E, 0xfffffff0 }, + { PHY_ID_BCM54616S, 0xfffffff0 }, +--- a/include/linux/brcmphy.h ++++ b/include/linux/brcmphy.h +@@ -17,6 +17,7 @@ + #define PHY_ID_BCM5482 0x0143bcb0 + #define PHY_ID_BCM5411 0x00206070 + #define PHY_ID_BCM5421 0x002060e0 ++#define PHY_ID_BCM54210E 0x600d84a0 + #define PHY_ID_BCM5464 0x002060b0 + #define PHY_ID_BCM5461 0x002060c0 + #define PHY_ID_BCM54612E 0x03625e60 diff --git a/target/linux/generic/patches-4.4/092-MIPS-ZBOOT-copy-appended-dtb-to-the-end-of-the-kerne.patch b/target/linux/generic/patches-4.4/092-MIPS-ZBOOT-copy-appended-dtb-to-the-end-of-the-kerne.patch index 71df42992b..78188dd298 100644 --- a/target/linux/generic/patches-4.4/092-MIPS-ZBOOT-copy-appended-dtb-to-the-end-of-the-kerne.patch +++ b/target/linux/generic/patches-4.4/092-MIPS-ZBOOT-copy-appended-dtb-to-the-end-of-the-kerne.patch @@ -27,7 +27,7 @@ Signed-off-by: Ralf Baechle --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2752,10 +2752,10 @@ choice +@@ -2753,10 +2753,10 @@ choice the documented boot protocol using a device tree. config MIPS_RAW_APPENDED_DTB @@ -40,7 +40,7 @@ Signed-off-by: Ralf Baechle (e.g. cat vmlinux.bin .dtb > vmlinux_w_dtb). This is meant as a backward compatibility convenience for those -@@ -2767,24 +2767,6 @@ choice +@@ -2768,24 +2768,6 @@ choice look like a DTB header after a reboot if no actual DTB is appended to vmlinux.bin. Do not leave this option active in a production kernel if you don't intend to always append a DTB. diff --git a/target/linux/generic/patches-4.4/132-mips_inline_dma_ops.patch b/target/linux/generic/patches-4.4/132-mips_inline_dma_ops.patch index bf7dca6a33..143b0bb3ff 100644 --- a/target/linux/generic/patches-4.4/132-mips_inline_dma_ops.patch +++ b/target/linux/generic/patches-4.4/132-mips_inline_dma_ops.patch @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1618,6 +1618,7 @@ config CPU_CAVIUM_OCTEON +@@ -1619,6 +1619,7 @@ config CPU_CAVIUM_OCTEON select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN select USB_OHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN select MIPS_L1_CACHE_SHIFT_7 @@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau help The Cavium Octeon processor is a highly integrated chip containing many ethernet hardware widgets for networking tasks. The processor -@@ -1913,6 +1914,9 @@ config MIPS_MALTA_PM +@@ -1914,6 +1915,9 @@ config MIPS_MALTA_PM bool default y diff --git a/target/linux/generic/patches-4.4/180-Revert-bcma-init-serial-console-directly-from-ChipCo.patch b/target/linux/generic/patches-4.4/180-Revert-bcma-init-serial-console-directly-from-ChipCo.patch new file mode 100644 index 0000000000..affe090457 --- /dev/null +++ b/target/linux/generic/patches-4.4/180-Revert-bcma-init-serial-console-directly-from-ChipCo.patch @@ -0,0 +1,92 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Subject: [PATCH] Revert "bcma: init serial console directly from ChipCommon + code" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This reverts commit 4c81acab3816 ("bcma: init serial console directly +from ChipCommon code") as it broke IRQ assignment. Getting IRQ with +bcma_core_irq helper on SoC requires MIPS core to be set. It happens +*after* ChipCommon initialization so we can't do this so early. + +This fixes a user reported regression. It wasn't critical as serial was +still somehow working but lack of IRQs was making in unreliable. + +Fixes: 4c81acab3816 ("bcma: init serial console directly from ChipCommon code") +Reported-by: Felix Fietkau +Cc: stable@vger.kernel.org # 4.6+ +Signed-off-by: Rafał Miłecki +--- + drivers/bcma/bcma_private.h | 3 +++ + drivers/bcma/driver_chipcommon.c | 11 +++-------- + drivers/bcma/driver_mips.c | 3 +++ + 3 files changed, 9 insertions(+), 8 deletions(-) + +--- a/drivers/bcma/bcma_private.h ++++ b/drivers/bcma/bcma_private.h +@@ -45,6 +45,9 @@ int bcma_sprom_get(struct bcma_bus *bus) + void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc); + void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); + void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable); ++#ifdef CONFIG_BCMA_DRIVER_MIPS ++void bcma_chipco_serial_init(struct bcma_drv_cc *cc); ++#endif /* CONFIG_BCMA_DRIVER_MIPS */ + + /* driver_chipcommon_b.c */ + int bcma_core_chipcommon_b_init(struct bcma_drv_cc_b *ccb); +--- a/drivers/bcma/driver_chipcommon.c ++++ b/drivers/bcma/driver_chipcommon.c +@@ -15,8 +15,6 @@ + #include + #include + +-static void bcma_chipco_serial_init(struct bcma_drv_cc *cc); +- + static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset, + u32 mask, u32 value) + { +@@ -186,9 +184,6 @@ void bcma_core_chipcommon_early_init(str + if (cc->capabilities & BCMA_CC_CAP_PMU) + bcma_pmu_early_init(cc); + +- if (IS_BUILTIN(CONFIG_BCM47XX) && bus->hosttype == BCMA_HOSTTYPE_SOC) +- bcma_chipco_serial_init(cc); +- + if (bus->hosttype == BCMA_HOSTTYPE_SOC) + bcma_core_chipcommon_flash_detect(cc); + +@@ -378,9 +373,9 @@ u32 bcma_chipco_gpio_pulldown(struct bcm + return res; + } + +-static void bcma_chipco_serial_init(struct bcma_drv_cc *cc) ++#ifdef CONFIG_BCMA_DRIVER_MIPS ++void bcma_chipco_serial_init(struct bcma_drv_cc *cc) + { +-#if IS_BUILTIN(CONFIG_BCM47XX) + unsigned int irq; + u32 baud_base; + u32 i; +@@ -422,5 +417,5 @@ static void bcma_chipco_serial_init(stru + ports[i].baud_base = baud_base; + ports[i].reg_shift = 0; + } +-#endif /* CONFIG_BCM47XX */ + } ++#endif /* CONFIG_BCMA_DRIVER_MIPS */ +--- a/drivers/bcma/driver_mips.c ++++ b/drivers/bcma/driver_mips.c +@@ -278,9 +278,12 @@ static void bcma_core_mips_nvram_init(st + + void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) + { ++ struct bcma_bus *bus = mcore->core->bus; ++ + if (mcore->early_setup_done) + return; + ++ bcma_chipco_serial_init(&bus->drv_cc); + bcma_core_mips_nvram_init(mcore); + + mcore->early_setup_done = true; diff --git a/target/linux/generic/patches-4.4/300-mips_expose_boot_raw.patch b/target/linux/generic/patches-4.4/300-mips_expose_boot_raw.patch index 76c70782a9..0980c26d50 100644 --- a/target/linux/generic/patches-4.4/300-mips_expose_boot_raw.patch +++ b/target/linux/generic/patches-4.4/300-mips_expose_boot_raw.patch @@ -8,7 +8,7 @@ Acked-by: Rob Landley --- --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1032,9 +1032,6 @@ config FW_ARC +@@ -1033,9 +1033,6 @@ config FW_ARC config ARCH_MAY_HAVE_PC_FDC bool @@ -18,7 +18,7 @@ Acked-by: Rob Landley config CEVT_BCM1480 bool -@@ -2792,6 +2789,18 @@ choice +@@ -2793,6 +2790,18 @@ choice bool "Bootloader kernel arguments if available" endchoice diff --git a/target/linux/generic/patches-4.4/301-mips_image_cmdline_hack.patch b/target/linux/generic/patches-4.4/301-mips_image_cmdline_hack.patch index 878f74d69f..625a84c814 100644 --- a/target/linux/generic/patches-4.4/301-mips_image_cmdline_hack.patch +++ b/target/linux/generic/patches-4.4/301-mips_image_cmdline_hack.patch @@ -1,6 +1,6 @@ --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1123,6 +1123,10 @@ config SYNC_R4K +@@ -1124,6 +1124,10 @@ config SYNC_R4K config MIPS_MACHINE def_bool n diff --git a/target/linux/generic/patches-4.4/304-mips_disable_fpu.patch b/target/linux/generic/patches-4.4/304-mips_disable_fpu.patch index aabb4f12b2..a08564dcea 100644 --- a/target/linux/generic/patches-4.4/304-mips_disable_fpu.patch +++ b/target/linux/generic/patches-4.4/304-mips_disable_fpu.patch @@ -26,7 +26,7 @@ v2: incorporated changes suggested by Jonas Gorski --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2724,6 +2724,20 @@ config MIPS_O32_FP64_SUPPORT +@@ -2725,6 +2725,20 @@ config MIPS_O32_FP64_SUPPORT If unsure, say N. diff --git a/target/linux/generic/patches-4.4/305-mips_module_reloc.patch b/target/linux/generic/patches-4.4/305-mips_module_reloc.patch index 8b3975fe09..944921fff7 100644 --- a/target/linux/generic/patches-4.4/305-mips_module_reloc.patch +++ b/target/linux/generic/patches-4.4/305-mips_module_reloc.patch @@ -316,7 +316,7 @@ return 0; } -@@ -287,9 +528,33 @@ int module_finalize(const Elf_Ehdr *hdr, +@@ -287,9 +528,36 @@ int module_finalize(const Elf_Ehdr *hdr, list_add(&me->arch.dbe_list, &dbe_list); spin_unlock_irq(&dbe_lock); } @@ -337,6 +337,9 @@ +void module_arch_freeing_init(struct module *mod) +{ ++ if (mod->state == MODULE_STATE_LIVE) ++ return; ++ + if (mod->arch.phys_plt_tbl) { + __module_free(mod->arch.phys_plt_tbl); + mod->arch.phys_plt_tbl = NULL; diff --git a/target/linux/generic/patches-4.4/630-packet_socket_type.patch b/target/linux/generic/patches-4.4/630-packet_socket_type.patch index eb79b2dd37..0c248639ba 100644 --- a/target/linux/generic/patches-4.4/630-packet_socket_type.patch +++ b/target/linux/generic/patches-4.4/630-packet_socket_type.patch @@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1763,6 +1763,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1776,6 +1776,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1770,6 +1771,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1783,6 +1784,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1782,7 +1784,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1795,7 +1797,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -1985,12 +1987,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -1998,12 +2000,12 @@ static int packet_rcv(struct sk_buff *sk int skb_len = skb->len; unsigned int snaplen, res; @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2110,12 +2112,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2123,12 +2125,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3091,6 +3093,7 @@ static int packet_create(struct net *net +@@ -3111,6 +3113,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3713,6 +3716,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3733,6 +3736,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -108,7 +108,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3765,6 +3778,13 @@ static int packet_getsockopt(struct sock +@@ -3785,6 +3798,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/patches-4.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/patches-4.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch index c86f4c7169..da8e8a64f5 100644 --- a/target/linux/generic/patches-4.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch +++ b/target/linux/generic/patches-4.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch @@ -160,7 +160,7 @@ Signed-off-by: Steven Barth if (dev == ip6n->fb_tnl_dev) RCU_INIT_POINTER(ip6n->tnls_wc[0], NULL); else -@@ -846,6 +861,108 @@ int ip6_tnl_rcv_ctl(struct ip6_tnl *t, +@@ -856,6 +871,108 @@ int ip6_tnl_rcv_ctl(struct ip6_tnl *t, } EXPORT_SYMBOL_GPL(ip6_tnl_rcv_ctl); @@ -269,7 +269,7 @@ Signed-off-by: Steven Barth /** * ip6_tnl_rcv - decapsulate IPv6 packet and retransmit it locally * @skb: received socket buffer -@@ -891,6 +1008,26 @@ static int ip6_tnl_rcv(struct sk_buff *s +@@ -901,6 +1018,26 @@ static int ip6_tnl_rcv(struct sk_buff *s skb_reset_network_header(skb); skb->protocol = htons(protocol); memset(skb->cb, 0, sizeof(struct inet6_skb_parm)); @@ -296,7 +296,7 @@ Signed-off-by: Steven Barth __skb_tunnel_rx(skb, t->dev, t->net); -@@ -1235,6 +1372,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1245,6 +1382,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str __u32 mtu; u8 tproto; int err; @@ -304,7 +304,7 @@ Signed-off-by: Steven Barth tproto = ACCESS_ONCE(t->parms.proto); if ((tproto != IPPROTO_IPV6 && tproto != 0) || -@@ -1265,6 +1403,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1275,6 +1413,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK) fl6.flowi6_mark = skb->mark; @@ -323,7 +323,7 @@ Signed-off-by: Steven Barth err = ip6_tnl_xmit2(skb, dev, dsfield, &fl6, encap_limit, &mtu); if (err != 0) { if (err == -EMSGSIZE) -@@ -1379,6 +1529,14 @@ ip6_tnl_change(struct ip6_tnl *t, const +@@ -1389,6 +1539,14 @@ ip6_tnl_change(struct ip6_tnl *t, const t->parms.flowinfo = p->flowinfo; t->parms.link = p->link; t->parms.proto = p->proto; @@ -338,7 +338,7 @@ Signed-off-by: Steven Barth ip6_tnl_dst_reset(t); ip6_tnl_link_config(t); return 0; -@@ -1417,6 +1575,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ +@@ -1427,6 +1585,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ p->flowinfo = u->flowinfo; p->link = u->link; p->proto = u->proto; @@ -346,7 +346,7 @@ Signed-off-by: Steven Barth memcpy(p->name, u->name, sizeof(u->name)); } -@@ -1712,6 +1871,15 @@ static int ip6_tnl_validate(struct nlatt +@@ -1722,6 +1881,15 @@ static int ip6_tnl_validate(struct nlatt return 0; } @@ -362,7 +362,7 @@ Signed-off-by: Steven Barth static void ip6_tnl_netlink_parms(struct nlattr *data[], struct __ip6_tnl_parm *parms) { -@@ -1743,6 +1911,46 @@ static void ip6_tnl_netlink_parms(struct +@@ -1753,6 +1921,46 @@ static void ip6_tnl_netlink_parms(struct if (data[IFLA_IPTUN_PROTO]) parms->proto = nla_get_u8(data[IFLA_IPTUN_PROTO]); @@ -409,7 +409,7 @@ Signed-off-by: Steven Barth } static int ip6_tnl_newlink(struct net *src_net, struct net_device *dev, -@@ -1795,6 +2003,12 @@ static void ip6_tnl_dellink(struct net_d +@@ -1805,6 +2013,12 @@ static void ip6_tnl_dellink(struct net_d static size_t ip6_tnl_get_size(const struct net_device *dev) { @@ -422,7 +422,7 @@ Signed-off-by: Steven Barth return /* IFLA_IPTUN_LINK */ nla_total_size(4) + -@@ -1812,6 +2026,24 @@ static size_t ip6_tnl_get_size(const str +@@ -1822,6 +2036,24 @@ static size_t ip6_tnl_get_size(const str nla_total_size(4) + /* IFLA_IPTUN_PROTO */ nla_total_size(1) + @@ -447,7 +447,7 @@ Signed-off-by: Steven Barth 0; } -@@ -1819,6 +2051,9 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -1829,6 +2061,9 @@ static int ip6_tnl_fill_info(struct sk_b { struct ip6_tnl *tunnel = netdev_priv(dev); struct __ip6_tnl_parm *parm = &tunnel->parms; @@ -457,7 +457,7 @@ Signed-off-by: Steven Barth if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) || -@@ -1827,8 +2062,27 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -1837,8 +2072,27 @@ static int ip6_tnl_fill_info(struct sk_b nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) || nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) || nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) || @@ -486,7 +486,7 @@ Signed-off-by: Steven Barth return 0; nla_put_failure: -@@ -1852,6 +2106,7 @@ static const struct nla_policy ip6_tnl_p +@@ -1862,6 +2116,7 @@ static const struct nla_policy ip6_tnl_p [IFLA_IPTUN_FLOWINFO] = { .type = NLA_U32 }, [IFLA_IPTUN_FLAGS] = { .type = NLA_U32 }, [IFLA_IPTUN_PROTO] = { .type = NLA_U8 }, diff --git a/target/linux/generic/patches-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/patches-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 5e84542bf7..a82073b3e8 100644 --- a/target/linux/generic/patches-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/patches-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -193,7 +193,7 @@ Signed-off-by: Jonas Gorski case -EAGAIN: rtm->rtm_type = RTN_THROW; break; -@@ -3362,6 +3399,8 @@ static int ip6_route_dev_notify(struct n +@@ -3363,6 +3400,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -3578,6 +3617,17 @@ static int __net_init ip6_route_net_init +@@ -3579,6 +3618,17 @@ static int __net_init ip6_route_net_init net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); @@ -220,7 +220,7 @@ Signed-off-by: Jonas Gorski #endif net->ipv6.sysctl.flush_delay = 0; -@@ -3596,6 +3646,8 @@ out: +@@ -3597,6 +3647,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -229,7 +229,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -3613,6 +3665,7 @@ static void __net_exit ip6_route_net_exi +@@ -3614,6 +3666,7 @@ static void __net_exit ip6_route_net_exi #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); kfree(net->ipv6.ip6_blk_hole_entry); @@ -237,7 +237,7 @@ Signed-off-by: Jonas Gorski #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); } -@@ -3710,6 +3763,9 @@ int __init ip6_route_init(void) +@@ -3711,6 +3764,9 @@ int __init ip6_route_init(void) init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 698d394b8c..0794d891c8 100644 --- a/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4222,6 +4222,9 @@ static enum gro_result dev_gro_receive(s +@@ -4219,6 +4219,9 @@ static enum gro_result dev_gro_receive(s enum gro_result ret; int grow; @@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau if (!(skb->dev->features & NETIF_F_GRO)) goto normal; -@@ -5381,6 +5384,48 @@ static void __netdev_adjacent_dev_unlink +@@ -5378,6 +5381,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *private) -@@ -5452,6 +5497,7 @@ static int __netdev_upper_dev_link(struc +@@ -5449,6 +5494,7 @@ static int __netdev_upper_dev_link(struc goto rollback_lower_mesh; } @@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); return 0; -@@ -5578,6 +5624,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -5575,6 +5621,7 @@ void netdev_upper_dev_unlink(struct net_ list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr); @@ -92,7 +92,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); } -@@ -6118,6 +6165,7 @@ int dev_set_mac_address(struct net_devic +@@ -6115,6 +6162,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; @@ -102,7 +102,7 @@ Signed-off-by: Felix Fietkau return 0; --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -1637,6 +1637,8 @@ struct net_device { +@@ -1639,6 +1639,8 @@ struct net_device { struct netdev_hw_addr_list mc; struct netdev_hw_addr_list dev_addrs; diff --git a/target/linux/generic/patches-4.4/721-phy_packets.patch b/target/linux/generic/patches-4.4/721-phy_packets.patch index 7f288f884c..8333dcca8f 100644 --- a/target/linux/generic/patches-4.4/721-phy_packets.patch +++ b/target/linux/generic/patches-4.4/721-phy_packets.patch @@ -16,7 +16,7 @@ /** * struct net_device - The DEVICE structure. -@@ -1602,6 +1604,11 @@ struct net_device { +@@ -1603,6 +1605,11 @@ struct net_device { const struct l3mdev_ops *l3mdev_ops; #endif @@ -28,7 +28,7 @@ const struct header_ops *header_ops; unsigned int flags; -@@ -1668,6 +1675,10 @@ struct net_device { +@@ -1670,6 +1677,10 @@ struct net_device { struct mpls_dev __rcu *mpls_ptr; #endif @@ -86,7 +86,7 @@ help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2713,10 +2713,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -2708,10 +2708,20 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/patches-4.4/773-bgmac-add-srab-switch.patch b/target/linux/generic/patches-4.4/773-bgmac-add-srab-switch.patch index 990d23dc8e..5e358c38c1 100644 --- a/target/linux/generic/patches-4.4/773-bgmac-add-srab-switch.patch +++ b/target/linux/generic/patches-4.4/773-bgmac-add-srab-switch.patch @@ -30,7 +30,7 @@ Signed-off-by: Hauke Mehrtens /************************************************** * MII **************************************************/ -@@ -1539,6 +1551,14 @@ int bgmac_enet_probe(struct bgmac *info) +@@ -1549,6 +1561,14 @@ int bgmac_enet_probe(struct bgmac *bgmac net_dev->hw_features = net_dev->features; net_dev->vlan_features = net_dev->features; @@ -45,7 +45,7 @@ Signed-off-by: Hauke Mehrtens err = register_netdev(bgmac->net_dev); if (err) { dev_err(bgmac->dev, "Cannot register net device\n"); -@@ -1562,6 +1582,10 @@ EXPORT_SYMBOL_GPL(bgmac_enet_probe); +@@ -1571,6 +1591,10 @@ EXPORT_SYMBOL_GPL(bgmac_enet_probe); void bgmac_enet_remove(struct bgmac *bgmac) { @@ -75,10 +75,10 @@ Signed-off-by: Hauke Mehrtens + struct platform_device *b53_device; }; - int bgmac_enet_probe(struct bgmac *info); + struct bgmac *bgmac_alloc(struct device *dev); --- a/drivers/net/ethernet/broadcom/bgmac-bcma.c +++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c -@@ -231,6 +231,7 @@ static int bgmac_probe(struct bcma_devic +@@ -230,6 +230,7 @@ static int bgmac_probe(struct bcma_devic bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST; bgmac->feature_flags |= BGMAC_FEAT_NO_RESET; bgmac->feature_flags |= BGMAC_FEAT_FORCE_SPEED_2500; diff --git a/target/linux/ramips/Makefile b/target/linux/ramips/Makefile index 51cd8f3e06..25859024c1 100644 --- a/target/linux/ramips/Makefile +++ b/target/linux/ramips/Makefile @@ -10,7 +10,7 @@ ARCH:=mipsel BOARD:=ramips BOARDNAME:=MediaTek Ralink MIPS SUBTARGETS:=rt305x mt7620 mt7621 mt7628 mt7688 rt3883 rt288x -FEATURES:=squashfs gpio mips16 +FEATURES:=squashfs gpio MAINTAINER:=John Crispin KERNEL_PATCHVER:=4.4 diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds index 5b15a9617c..3d3aa0ac01 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -171,9 +171,6 @@ fonera20n) set_usb_led "$board:orange:usb" set_wifi_led "$board:orange:wifi" ;; -gb-pc1|\ - ucidef_set_led_default "$board:green:status" - ;; gl-mt300a|\ gl-mt300n|\ gl-mt750) @@ -314,6 +311,9 @@ vocore) ucidef_set_led_netdev "eth" "ETH" "$board:orange:eth" "eth0" set_wifi_led "$board:green:status" ;; +vocore2) + set_wifi_led "$board:fuchsia:status" + ;; w502u) set_usb_led "$board:blue:usb" set_wifi_led "rt2800pci-phy0::radio" diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network index bc212754df..2dd6793476 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -53,6 +53,8 @@ ramips_setup_interfaces() microwrt|\ mpr-a2|\ ncs601w|\ + omega2 | \ + omega2p | \ timecloud|\ w150m|\ widora-neo|\ @@ -75,7 +77,6 @@ ramips_setup_interfaces() dir-320-b1|\ dir-610-a1|\ dir-615-h1|\ - gb-pc1|\ firewrt|\ hlk-rm04|\ mac1200rv2|\ @@ -123,7 +124,6 @@ ramips_setup_interfaces() "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0" ;; asl26555|\ - re6500|\ rp-n53) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0" @@ -234,11 +234,12 @@ ramips_setup_interfaces() "0:lan" "4:lan" "6t@eth0" ;; newifi-d1) - ucidef_set_interface_lan_wan "eth0.1" "eth0.2" ucidef_add_switch "switch0" \ - "0:lan" "1:lan" "2:lan" "3:lan" "5:wan" "6t@eth0" "7t@eth0" - ucidef_add_switch "switch1" \ - "4:lan" "6t@eth0" "7t@eth0" + "1:lan:2" "2:lan:1" "4:wan" "6@eth0" + ;; + re6500) + ucidef_add_switch "switch0" \ + "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "6@eth0" ;; rt-n56u) ucidef_add_switch "switch0" \ @@ -250,6 +251,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0" ;; + vocore2) + ucidef_add_switch "switch0" \ + "0:lan" "2:lan" "6t@eth0" + ;; f5d8235-v1|\ tew-714tru|\ v11st-fe|\ @@ -363,6 +368,11 @@ ramips_setup_macs() lan_mac=$(cat /sys/class/net/eth0/address) lan_mac=$(macaddr_add "$lan_mac" 2) ;; + omega2|\ + omega2p) + wan_mac=$(mtd_get_mac_binary factory 4) + lan_mac=$(mtd_get_mac_binary factory 46) + ;; oy-0001) lan_mac=$(mtd_get_mac_binary factory 40) wan_mac=$(mtd_get_mac_binary factory 46) diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index a4ad72b086..5367e651ba 100644 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -69,7 +69,6 @@ get_status_led() { dir-620-a1|\ dir-620-d1|\ dwr-512-b|\ - gb-pc1|\ hpm|\ hw550-3g|\ mac1200rv2|\ @@ -173,6 +172,10 @@ get_status_led() { newifi-d1) status_led="$board:blue:status" ;; + omega2| \ + omega2p) + status_led="$board:amber:system" + ;; oy-0001|\ sl-r7205|\ zbt-we826) @@ -207,6 +210,9 @@ get_status_led() { v22rw-2x2) status_led="$board:green:security" ;; + vocore2) + status_led="$board:fuchsia:status" + ;; w306r-v20|\ witi|\ zbt-wr8305rt) diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 815de60f99..6afe709cbe 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -202,9 +202,6 @@ ramips_board_detect() { *"FreeStation5") name="freestation5" ;; - *"GB-PC1") - name="gb-pc1" - ;; *"GL-MT300A") name="gl-mt300a" ;; @@ -367,6 +364,12 @@ ramips_board_detect() { *"NW718") name="nw718" ;; + *"Onion Omega2") + name="omega2" + ;; + *"Onion Omega2+") + name="omega2p" + ;; *"OY-0001") name="oy-0001" ;; @@ -478,6 +481,9 @@ ramips_board_detect() { *"VoCore (16M)") name="vocore-16M" ;; + *"VoCore2") + name="vocore2" + ;; *"VR500") name="vr500" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 6cb9154a38..0f2510c4bd 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -57,7 +57,6 @@ platform_check_image() { firewrt|\ fonera20n|\ freestation5|\ - gb-pc1|\ gl-mt300a|\ gl-mt300n|\ gl-mt750|\ @@ -103,6 +102,8 @@ platform_check_image() { newifi-d1|\ nixcore|\ nw718|\ + omega2|\ + omega2p|\ oy-0001|\ pbr-d1|\ pbr-m1|\ @@ -134,6 +135,7 @@ platform_check_image() { ur-336un|\ v22rw-2x2|\ vocore|\ + vocore2|\ vr500|\ w150m|\ w2914nsv2|\ diff --git a/target/linux/ramips/dts/GB-PC1.dts b/target/linux/ramips/dts/GB-PC1.dts deleted file mode 100644 index e36cf2605e..0000000000 --- a/target/linux/ramips/dts/GB-PC1.dts +++ /dev/null @@ -1,135 +0,0 @@ -/dts-v1/; - -#include "mt7621.dtsi" - -#include -#include - -/ { - compatible = "mediatek,mt7621-eval-board", "mediatek,mt7621-soc"; - model = "GB-PC1"; - - memory@0 { - device_type = "memory"; - reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; - }; - - chosen { - bootargs = "console=ttyS0,57600"; - }; - - sdhci@10130000 { - status = "okay"; - }; - - palmbus@1E000000 { - spi@b00 { - status = "okay"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "jedec,spi-nor"; - reg = <0 0>; - linux,modalias = "m25p80"; - spi-max-frequency = <10000000>; - m25p,chunked-io = <32>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - }; - - partition@40000 { - label = "firmware"; - reg = <0x50000 0x1fb0000>; - }; - - }; - }; - - i2c@900 { - compatible = "ralink,i2c-mt7621"; - reg = <0x900 0x100>; - #address-cells = <1>; - #size-cells = <0>; - pinctrl-names = "default"; - pinctrl-0 = <&i2c_pins>; - status = "okay"; - }; - }; - - pcie@1e140000 { - status = "okay"; - }; - - ethernet@1e100000 { - status = "okay"; - }; - - gpio-keys-polled { - compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; - poll-interval = <20>; - - reset { - label = "reset"; - gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>; - linux,code = ; - }; - }; - - gpio-leds { - compatible = "gpio-leds"; - - status { - label = "gnubee:green:status"; - gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; - }; - - system { - label = "gnubee:green:system"; - gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; - }; - }; - - gpio-power { - compatible = "gpio-power"; - - 26 { - label = "gnubee:power:gpio26"; - gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; - }; - - 28 { - label = "gnubee:power:gpio28"; - gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; - }; - - 29 { - label = "gnubee:power:gpio29"; - gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; - }; - - 30 { - label = "gnubee:power:gpio30"; - gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>; - }; - }; - - pinctrl { - state_default: pinctrl0 { - gpio { - ralink,group = "wdt", "rgmii2", "mdio"; - ralink,function = "gpio"; - }; - }; - }; -}; diff --git a/target/linux/ramips/dts/OMEGA2.dts b/target/linux/ramips/dts/OMEGA2.dts new file mode 100644 index 0000000000..f419dc9c74 --- /dev/null +++ b/target/linux/ramips/dts/OMEGA2.dts @@ -0,0 +1,20 @@ +/dts-v1/; + +#include "OMEGA2.dtsi" + +/ { + model = "Onion Omega2"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x4000000>; + }; +}; + +&firmware { + reg = <0x50000 0xfb0000>; +}; + +&system_led { + label = "omega2:amber:system"; +}; diff --git a/target/linux/ramips/dts/OMEGA2.dtsi b/target/linux/ramips/dts/OMEGA2.dtsi new file mode 100644 index 0000000000..5d9b6198f9 --- /dev/null +++ b/target/linux/ramips/dts/OMEGA2.dtsi @@ -0,0 +1,170 @@ +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "onion,omega", "mediatek,mt7628an-soc"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-leds { + compatible = "gpio-leds"; + + system_led: system { + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "gpio"; + ralink,function = "gpio"; + }; + + perst { + ralink,group = "perst"; + ralink,function = "gpio"; + }; + + refclk { + ralink,group = "refclk"; + ralink,function = "gpio"; + }; + + i2s { + ralink,group = "i2s"; + ralink,function = "gpio"; + }; + + spis { + ralink,group = "spis"; + ralink,function = "gpio"; + }; + + wled_kn { + ralink,group = "wled_kn"; + ralink,function = "gpio"; + }; + + wled_an { + ralink,group = "wled_an"; + ralink,function = "gpio"; + }; + + wdt { + ralink,group = "wdt"; + ralink,function = "gpio"; + }; + + pwm0 { + ralink,group = "pwm0"; + ralink,function = "gpio"; + }; + + pwm1 { + ralink,group = "pwm1"; + ralink,function = "gpio"; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&wmac { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + m25p,chunked-io = <31>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + label = "firmware"; + }; + }; + + spidev@1 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "linux,spidev"; + reg = <1>; + spi-max-frequency = <40000000>; + }; +}; + +&i2c { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; +}; + +&sdhci { + status = "okay"; + mediatek,cd-low; +}; + +&wmac { + status = "okay"; +}; diff --git a/target/linux/ramips/dts/OMEGA2P.dts b/target/linux/ramips/dts/OMEGA2P.dts new file mode 100644 index 0000000000..a49d94c08f --- /dev/null +++ b/target/linux/ramips/dts/OMEGA2P.dts @@ -0,0 +1,20 @@ +/dts-v1/; + +#include "OMEGA2.dtsi" + +/ { + model = "Onion Omega2+"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; +}; + +&firmware { + reg = <0x50000 0x1fb0000>; +}; + +&system_led { + label = "omega2p:amber:system"; +}; diff --git a/target/linux/ramips/dts/VOCORE2.dts b/target/linux/ramips/dts/VOCORE2.dts new file mode 100644 index 0000000000..297cd1bb99 --- /dev/null +++ b/target/linux/ramips/dts/VOCORE2.dts @@ -0,0 +1,123 @@ +/dts-v1/; + +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "vocore,VoCore2", "mediatek,mt7628an-soc"; + model = "VoCore2"; + + chosen { + bootargs = "console=ttyS2,115200"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x4000000>; + }; + + gpio-leds { + compatible = "gpio-leds"; + + status { + label = "vocore2:fuchsia:status"; + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "refclk", "gpio"; + ralink,function = "gpio"; + }; + + agpio { + ralink,group = "agpio"; + ralink,function = "uart2"; + }; + }; + + uart1_pins: uart1 { + uart1 { + ralink,group = "uart1"; + ralink,function = "uart1"; + }; + }; + + uart2_pins: uart2 { + uart2 { + ralink,group = "spis"; + ralink,function = "pwm"; + }; + }; +}; + +&wmac { + status = "okay"; + ralink,mtd-eeprom = <&factory 0x4>; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + m25p,chunked-io = <32>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; +}; + +&esw { + mediatek,portmap = <0x7>; + mediatek,portdisable = <0x3a>; +}; + +&i2s { + status = "okay"; +}; + +&gdma { + status = "okay"; +}; + +&pwm { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; diff --git a/target/linux/ramips/dts/WLI-TX4-AG300N.dts b/target/linux/ramips/dts/WLI-TX4-AG300N.dts index 9d9b222bd7..79e5c341d8 100644 --- a/target/linux/ramips/dts/WLI-TX4-AG300N.dts +++ b/target/linux/ramips/dts/WLI-TX4-AG300N.dts @@ -37,7 +37,7 @@ }; partition@50000 { - label = "linux"; + label = "firmware"; reg = <0x50000 0x3b0000>; }; }; @@ -96,7 +96,16 @@ mtd-mac-address = <&factory 0x4>; port@0 { - mediatek,fixed-link = <1000 1 1 1>; + mediatek,fixed-link = <100 1 1 1>; + }; + + mdio-bus { + status = "okay"; + + phy0: ethernet-phy@0 { + phy-mode = "mii"; + reg = <0>; + }; }; }; diff --git a/target/linux/ramips/dts/WSR-600.dts b/target/linux/ramips/dts/WSR-600.dts index d5439fa4c1..63206b4d61 100644 --- a/target/linux/ramips/dts/WSR-600.dts +++ b/target/linux/ramips/dts/WSR-600.dts @@ -157,6 +157,27 @@ }; }; +&pcie { + status = "okay"; + + pcie0 { + rt5592@0,0 { + reg = <0x0000 0 0 0 0>; + device_type = "pci"; + ralink,mtd-eeprom = <&factory 0x8000>; + }; + }; + + pcie1 { + mt76@1,0 { + reg = <0x0000 0 0 0 0>; + device_type = "pci"; + mediatek,mtd-eeprom = <&factory 0x0000>; + mediatek,5ghz = <0>; + }; + }; +}; + &xhci { status = "disabled"; }; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk new file mode 100644 index 0000000000..1889bcf708 --- /dev/null +++ b/target/linux/ramips/image/mt7620.mk @@ -0,0 +1,464 @@ +# +# MT7620A Profiles +# + +define Build/tplink-header + $(STAGING_DIR_HOST)/bin/mktplinkfw2 -a 0x4 -V "ver. 2.0" -B $(1) \ + -o $@.new -k $@ -r $(IMAGE_ROOTFS) && mv $@.new $@ +endef + +define Build/pad-kernel-ex2700 + cp $@ $@.tmp && dd if=/dev/zero bs=64 count=1 >> $@.tmp \ + && dd if=$@.tmp of=$@.new bs=64k conv=sync && truncate -s -64 $@.new \ + && cat ex2700-fakeroot.uImage >> $@.new && rm $@.tmp && mv $@.new $@ +endef + +define Build/netgear-header + $(STAGING_DIR_HOST)/bin/mkdniimg \ + $(1) -v OpenWrt -i $@ \ + -o $@.new && mv $@.new $@ +endef + +define Build/elecom-header + cp $@ $(KDIR)/v_0.0.0.bin + ( \ + mkhash md5 $(KDIR)/v_0.0.0.bin && \ + echo 458 \ + ) | mkhash md5 > $(KDIR)/v_0.0.0.md5 + $(STAGING_DIR_HOST)/bin/tar -cf $@ -C $(KDIR) v_0.0.0.bin v_0.0.0.md5 +endef + +define Build/zyimage + $(STAGING_DIR_HOST)/bin/zyimage $(1) $@ +endef + +define Device/ArcherC20i + DTS := ArcherC20i + SUPPORTED_DEVICES := c20i + KERNEL := $(KERNEL_DTB) + KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-header ArcherC20i -c + IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherC20i -j | append-metadata + DEVICE_TITLE := TP-Link ArcherC20i +endef +TARGET_DEVICES += ArcherC20i + +define Device/ArcherC50 + DTS := ArcherC50 + SUPPORTED_DEVICES := c50 + KERNEL := $(KERNEL_DTB) + KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-header ArcherC50 -c + IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherC50 -j | append-metadata + DEVICE_TITLE := TP-Link ArcherC50 +endef +TARGET_DEVICES += ArcherC50 + +define Device/ArcherMR200 + DTS := ArcherMR200 + SUPPORTED_DEVICES := mr200 + KERNEL := $(KERNEL_DTB) + KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-header ArcherMR200 -c + IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherMR200 -j | append-metadata + DEVICE_PACKAGES := kmod-usb2 kmod-usb-net kmod-usb-net-rndis kmod-usb-serial kmod-usb-serial-option adb + DEVICE_TITLE := TP-Link ArcherMR200 +endef +TARGET_DEVICES += ArcherMR200 + +define Device/ex2700 + DTS := EX2700 + BLOCKSIZE := 4k + IMAGE_SIZE := $(ralink_default_fw_size_4M) + IMAGES += factory.bin + KERNEL := $(KERNEL_DTB) | uImage lzma | pad-kernel-ex2700 + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + netgear-header -B EX2700 -H 29764623+4+0+32+2x2+0 + DEVICE_TITLE := Netgear EX2700 +endef +TARGET_DEVICES += ex2700 + +define Device/wt3020-4M + DTS := WT3020-4M + BLOCKSIZE := 4k + IMAGE_SIZE := $(ralink_default_fw_size_4M) + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + poray-header -B WT3020 -F 4M + DEVICE_TITLE := Nexx WT3020 (4MB) +endef +TARGET_DEVICES += wt3020-4M + +define Device/wt3020-8M + DTS := WT3020-8M + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + poray-header -B WT3020 -F 8M + DEVICE_TITLE := Nexx WT3020 (8MB) +endef +TARGET_DEVICES += wt3020-8M + +define Device/wrh-300cr + DTS := WRH-300CR + IMAGE_SIZE := $(ralink_default_fw_size_16M) + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + elecom-header + DEVICE_TITLE := Elecom WRH-300CR + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci +endef +TARGET_DEVICES += wrh-300cr + +define Device/e1700 + DTS := E1700 + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + umedia-header 0x013326 + DEVICE_TITLE := Linksys E1700 +endef +TARGET_DEVICES += e1700 + +define Device/ai-br100 + DTS := AI-BR100 + IMAGE_SIZE := 7936k + DEVICE_TITLE := Aigale Ai-BR100 + DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci +endef +TARGET_DEVICES += ai-br100 + +define Device/whr-300hp2 + DTS := WHR-300HP2 + IMAGE_SIZE := 6848k + DEVICE_TITLE := Buffalo WHR-300HP2 +endef +TARGET_DEVICES += whr-300hp2 + +define Device/whr-600d + DTS := WHR-600D + IMAGE_SIZE := 6848k + DEVICE_TITLE := Buffalo WHR-600D +endef +TARGET_DEVICES += whr-600d + +define Device/whr-1166d + DTS := WHR-1166D + IMAGE_SIZE := 15040k + DEVICE_TITLE := Buffalo WHR-1166D +endef +TARGET_DEVICES += whr-1166d + +define Device/dir-810l + DTS := DIR-810L + IMAGE_SIZE := 6720k + DEVICE_TITLE := D-Link DIR-810L +endef +TARGET_DEVICES += dir-810l + +define Device/na930 + DTS := NA930 + IMAGE_SIZE := 20m + DEVICE_TITLE := Sercomm NA930 +endef +TARGET_DEVICES += na930 + +define Device/microwrt + DTS := MicroWRT + IMAGE_SIZE := 16128k + DEVICE_TITLE := Microduino MicroWRT +endef +TARGET_DEVICES += microwrt + +define Device/mt7620a + DTS := MT7620a + DEVICE_TITLE := MediaTek MT7620a EVB +endef +TARGET_DEVICES += mt7620a + +define Device/mt7620a_mt7610e + DTS := MT7620a_MT7610e + DEVICE_TITLE := MediaTek MT7620a + MT7610e EVB +endef +TARGET_DEVICES += mt7620a_mt7610e + +define Device/mt7620a_mt7530 + DTS := MT7620a_MT7530 + DEVICE_TITLE := MediaTek MT7620a + MT7530 EVB +endef +TARGET_DEVICES += mt7620a_mt7530 + +define Device/mt7620a_v22sg + DTS := MT7620a_V22SG + DEVICE_TITLE := MediaTek MT7620a V22SG +endef +TARGET_DEVICES += mt7620a_v22sg + +define Device/rp-n53 + DTS := RP-N53 + DEVICE_TITLE := Asus RP-N53 +endef +TARGET_DEVICES += rp-n53 + +define Device/cf-wr800n + DTS := CF-WR800N + DEVICE_TITLE := Comfast CF-WR800N +endef +TARGET_DEVICES += cf-wr800n + +define Device/cs-qr10 + DTS := CS-QR10 + DEVICE_TITLE := Planex CS-QR10 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-i2c-core kmod-i2c-ralink kmod-sound-core kmod-sound-mtk kmod-sdhci-mt7620 +endef +TARGET_DEVICES += cs-qr10 + +define Device/db-wrt01 + DTS := DB-WRT01 + DEVICE_TITLE := Planex DB-WRT01 +endef +TARGET_DEVICES += db-wrt01 + +define Device/mzk-750dhp + DTS := MZK-750DHP + DEVICE_TITLE := Planex MZK-750DHP + DEVICE_PACKAGES := kmod-mt76 +endef +TARGET_DEVICES += mzk-750dhp + +define Device/mzk-ex300np + DTS := MZK-EX300NP + DEVICE_TITLE := Planex MZK-EX300NP +endef +TARGET_DEVICES += mzk-ex300np + +define Device/mzk-ex750np + DTS := MZK-EX750NP + DEVICE_TITLE := Planex MZK-EX750NP + DEVICE_PACKAGES := kmod-mt76 +endef +TARGET_DEVICES += mzk-ex750np + +define Device/hc5661 + DTS := HC5661 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := HiWiFi HC5661 + DEVICE_PACKAGES := kmod-usb2 kmod-sdhci kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += hc5661 + +define Device/hc5761 + DTS := HC5761 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := HiWiFi HC5761 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += hc5761 + +define Device/hc5861 + DTS := HC5861 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := HiWiFi HC5861 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += hc5861 + +define Device/oy-0001 + DTS := OY-0001 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := Oh Yeah OY-0001 +endef +TARGET_DEVICES += oy-0001 + +define Device/psg1208 + DTS := PSG1208 + DEVICE_TITLE := Phicomm PSG1208 + DEVICE_PACKAGES := kmod-mt76 +endef +TARGET_DEVICES += psg1208 + +define Device/psg1218 + DTS := PSG1218 + DEVICE_TITLE := Phicomm PSG1218 + DEVICE_PACKAGES := kmod-mt76 +endef +TARGET_DEVICES += psg1218 + +define Device/y1 + DTS := Y1 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := Lenovo Y1 +endef +TARGET_DEVICES += y1 + +define Device/y1s + DTS := Y1S + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := Lenovo Y1S +endef +TARGET_DEVICES += y1s + +define Device/mlw221 + DTS := MLW221 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := Kingston MLW221 +endef +TARGET_DEVICES += mlw221 + +define Device/mlwg2 + DTS := MLWG2 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := Kingston MLWG2 +endef +TARGET_DEVICES += mlwg2 + +define Device/wmr-300 + DTS := WMR-300 + DEVICE_TITLE := Buffalo WMR-300 +endef +TARGET_DEVICES += wmr-300 + +define Device/rt-n14u + DTS := RT-N14U + DEVICE_TITLE := Asus RT-N14u +endef +TARGET_DEVICES += rt-n14u + +define Device/wrtnode + DTS := WRTNODE + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := WRTNode +endef +TARGET_DEVICES += wrtnode + +define Device/miwifi-mini + DTS := MIWIFI-MINI + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := Xiaomi MiWiFi Mini + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci +endef +TARGET_DEVICES += miwifi-mini + +define Device/gl-mt300a + DTS := GL-MT300A + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := GL-Inet GL-MT300A + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76 +endef +TARGET_DEVICES += gl-mt300a + +define Device/gl-mt300n + DTS := GL-MT300N + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := GL-Inet GL-MT300N + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76 +endef +TARGET_DEVICES += gl-mt300n + +define Device/gl-mt750 + DTS := GL-MT750 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := GL-Inet GL-MT750 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76 +endef +TARGET_DEVICES += gl-mt750 + +define Device/zte-q7 + DTS := ZTE-Q7 + DEVICE_TITLE := ZTE Q7 +endef +TARGET_DEVICES += zte-q7 + +define Device/youku-yk1 + DTS := YOUKU-YK1 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := YOUKU YK1 +endef +TARGET_DEVICES += youku-yk1 + +define Device/zbt-ape522ii + DTS := ZBT-APE522II + DEVICE_TITLE := Zbtlink ZBT-APE522II + DEVICE_PACKAGES := kmod-mt76 +endef +TARGET_DEVICES += zbt-ape522ii + +define Device/zbt-cpe102 + DTS := ZBT-CPE102 + DEVICE_TITLE := Zbtlink ZBT-CPE102 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci +endef +TARGET_DEVICES += zbt-cpe102 + +define Device/zbt-wa05 + DTS := ZBT-WA05 + DEVICE_TITLE := Zbtlink ZBT-WA05 +endef +TARGET_DEVICES += zbt-wa05 + +define Device/zbt-we826 + DTS := ZBT-WE826 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := Zbtlink ZBT-WE826 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76 kmod-sdhci-mt7620 +endef +TARGET_DEVICES += zbt-we826 + +define Device/zbt-wr8305rt + DTS := ZBT-WR8305RT + DEVICE_TITLE := Zbtlink ZBT-WR8305RT +endef +TARGET_DEVICES += zbt-wr8305rt + +define Device/tiny-ac + DTS := TINY-AC + DEVICE_TITLE := Dovado Tiny AC + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci +endef +TARGET_DEVICES += tiny-ac + +define Device/dch-m225 + DTS := DCH-M225 + BLOCKSIZE := 4k + IMAGES += factory.bin + IMAGE_SIZE := 6848k + IMAGE/sysupgrade.bin := \ + append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \ + seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \ + pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) + IMAGE/factory.bin := \ + append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \ + append-rootfs | pad-rootfs -x 64 | \ + seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \ + seama-seal -m "signature=wapn22_dlink.2013gui_dap1320b" | \ + check-size $$$$(IMAGE_SIZE) + DEVICE_TITLE := D-Link DCH-M225 + DEVICE_PACKAGES := kmod-mt76 +endef +TARGET_DEVICES += dch-m225 + +define Device/kn_rc + DTS := kn_rc + DEVICE_TITLE := ZyXEL Keenetic Omni + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport + IMAGES += factory.bin + IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | check-size $$$$(IMAGE_SIZE) | \ + zyimage -d 4882 -v "ZyXEL Keenetic Omni" +endef +TARGET_DEVICES += kn_rc + +define Device/kn_rf + DTS := kn_rf + DEVICE_TITLE := ZyXEL Keenetic Omni II + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport + IMAGES += factory.bin + IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | check-size $$$$(IMAGE_SIZE) | \ + zyimage -d 2102034 -v "ZyXEL Keenetic Omni II" +endef +TARGET_DEVICES += kn_rf + +define Device/kng_rc + DTS := kng_rc + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := ZyXEL Keenetic Viva + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport kmod-switch-rtl8366-smi kmod-switch-rtl8367b + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + zyimage -d 8997 -v "ZyXEL Keenetic Viva" +endef +TARGET_DEVICES += kng_rc diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index b26cde9b5d..fd28e1918a 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -2,14 +2,74 @@ # MT7621 Profiles # -define Device/gb-pc1 - DTS := GB-PC1 - DEVICE_TITLE := GnuBee Personal Cloud One - DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci +define Build/ubnt-erx-factory-image + if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \ + echo '21001:6' > $(1).compat; \ + $(TAR) -cf $(1) --transform='s/^.*/compat/' $(1).compat; \ + \ + $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp/' $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE); \ + mkhash md5 $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) > $(1).md5; \ + $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp.md5/' $(1).md5; \ + \ + echo "dummy" > $(1).rootfs; \ + $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp/' $(1).rootfs; \ + \ + mkhash md5 $(1).rootfs > $(1).md5; \ + $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp.md5/' $(1).md5; \ + \ + echo '$(BOARD) $(VERSION_CODE) $(VERSION_NUMBER)' > $(1).version; \ + $(TAR) -rf $(1) --transform='s/^.*/version.tmp/' $(1).version; \ + \ + $(CP) $(1) $(BIN_DIR)/; \ + else \ + echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \ + fi +endef + +define Device/11acnas + DTS := 11ACNAS + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := WeVO 11AC NAS Router + DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-mt76 +endef +TARGET_DEVICES += 11acnas + +define Device/ac1200pro + DTS := AC1200pro IMAGE_SIZE := $(ralink_default_fw_size_32M) + DEVICE_TITLE := Digineo AC1200 Pro + DEVICE_PACKAGES := kmod-usb3 kmod-ata-core kmod-ata-ahci +endef +TARGET_DEVICES += ac1200pro + +define Device/dir-860l-b1 + DTS := DIR-860L-B1 + BLOCKSIZE := 64k + IMAGES += factory.bin + KERNEL := kernel-bin | patch-dtb | relocate-kernel | lzma | uImage lzma + IMAGE_SIZE := $(ralink_default_fw_size_16M) + IMAGE/sysupgrade.bin := \ + append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \ + seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \ + pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) + IMAGE/factory.bin := \ + append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \ + append-rootfs | pad-rootfs -x 64 | \ + seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \ + seama-seal -m "signature=wrgac13_dlink.2013gui_dir860lb" | \ + check-size $$$$(IMAGE_SIZE) + DEVICE_TITLE := D-Link DIR-860L B1 + DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport endef +TARGET_DEVICES += dir-860l-b1 -TARGET_DEVICES += gb-pc1 +define Device/firewrt + DTS := FIREWRT + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := Firefly FireWRT + DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += firewrt define Device/mt7621 DTS := MT7621 @@ -19,19 +79,148 @@ define Device/mt7621 endef TARGET_DEVICES += mt7621 +define Device/newifi-d1 + DTS := Newifi-D1 + IMAGE_SIZE := $(ralink_default_fw_size_32M) + DEVICE_TITLE := Newifi D1 + DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += newifi-d1 + +define Device/pbr-m1 + DTS := PBR-M1 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := PBR-M1 + DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci +endef +TARGET_DEVICES += pbr-m1 + +define Device/rb750gr3 + DTS := RB750Gr3 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := MikroTik RB750Gr3 + DEVICE_PACKAGES := kmod-usb3 uboot-envtools -kmod-mt76 -kmod-rt2x00-lib -kmod-mac80211 -kmod-cfg80211 -wpad-mini -iwinfo +endef +TARGET_DEVICES += rb750gr3 + +define Device/re6500 + DTS := RE6500 + DEVICE_TITLE := Linksys RE6500 +endef +TARGET_DEVICES += re6500 + +define Device/sap-g3200u3 + DTS := SAP-G3200U3 + DEVICE_TITLE := STORYLiNK SAP-G3200U3 + DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += sap-g3200u3 + +define Device/sk-wb8 + DTS := SK-WB8 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := SamKnows Whitebox 8 + DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport uboot-envtools +endef +TARGET_DEVICES += sk-wb8 + define Device/timecloud DTS := Timecloud DEVICE_TITLE := Thunder Timecloud + DEVICE_PACKAGES := kmod-usb3 endef TARGET_DEVICES += timecloud +define Device/ubnt-erx + DTS := UBNT-ERX + FILESYSTEMS := squashfs + KERNEL_SIZE := 3145728 + KERNEL := $(KERNEL_DTB) | uImage lzma + IMAGES := sysupgrade.tar + KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar + IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata + DEVICE_TITLE := Ubiquiti EdgeRouter X + DEVICE_PACKAGES := -kmod-mt76 -kmod-rt2x00-lib -kmod-mac80211 -kmod-cfg80211 -wpad-mini -iwinfo +endef +TARGET_DEVICES += ubnt-erx + define Device/vr500 DTS := VR500 IMAGE_SIZE := 66453504 DEVICE_TITLE := Planex VR500 + DEVICE_PACKAGES := kmod-usb3 endef TARGET_DEVICES += vr500 +define Device/w2914nsv2 + DTS := W2914NSV2 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := WeVO W2914NS v2 + DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-mt76 +endef +TARGET_DEVICES += w2914nsv2 + +define Device/wf-2881 + DTS := WF-2881 + BLOCKSIZE := 128k + PAGESIZE := 2048 + FILESYSTEMS := squashfs + IMAGE_SIZE := 129280k + KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma + UBINIZE_OPTS := -E 5 + IMAGE/sysupgrade.bin := append-kernel | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE) + DEVICE_TITLE := NETIS WF-2881 + DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += wf-2881 + +define Device/witi + DTS := WITI + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := MQmaker WiTi + DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci +endef +TARGET_DEVICES += witi + +define Device/wndr3700v5 + DTS := WNDR3700V5 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := Netgear WNDR3700v5 + DEVICE_PACKAGES := kmod-usb3 +endef +TARGET_DEVICES += wndr3700v5 + +define Device/wsr-1166 + DTS := WSR-1166 + IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := Buffalo WSR-1166 +endef +TARGET_DEVICES += wsr-1166 + +define Device/wsr-600 + DTS := WSR-600 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := Buffalo WSR-600 +endef +TARGET_DEVICES += wsr-600 + +define Device/zbt-wg2626 + DTS := ZBT-WG2626 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := ZBT WG2626 + DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci +endef +TARGET_DEVICES += zbt-wg2626 + +define Device/zbt-wg3526 + DTS := ZBT-WG3526 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := ZBT WG3526 + DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci +endef +TARGET_DEVICES += zbt-wg3526 + # FIXME: is this still needed? define Image/Prepare #define Build/Compile diff --git a/target/linux/ramips/image/mt7628.mk b/target/linux/ramips/image/mt7628.mk index 7a7ddce3c9..4502588c80 100644 --- a/target/linux/ramips/image/mt7628.mk +++ b/target/linux/ramips/image/mt7628.mk @@ -19,6 +19,15 @@ define Device/miwifi-nano endef TARGET_DEVICES += miwifi-nano +define Device/vocore2 + DTS := VOCORE2 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := VoCore VoCore2 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \ + kmod-sdhci kmod-sdhci-mt7620 +endef +TARGET_DEVICES += vocore2 + define Device/wl-wn575a3 DTS := WL-WN575A3 IMAGE_SIZE := $(ralink_default_fw_size_8M) diff --git a/target/linux/ramips/image/mt7688.mk b/target/linux/ramips/image/mt7688.mk index f117102e71..4a50275a8d 100644 --- a/target/linux/ramips/image/mt7688.mk +++ b/target/linux/ramips/image/mt7688.mk @@ -34,3 +34,19 @@ define Device/widora-neo DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci endef TARGET_DEVICES += widora-neo + +define Device/omega2 + DTS := OMEGA2 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + DEVICE_TITLE := Onion Omega2 + DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci uboot-envtools +endef +TARGET_DEVICES += omega2 + +define Device/omega2p + DTS := OMEGA2P + IMAGE_SIZE := $(ralink_default_fw_size_32M) + DEVICE_TITLE := Onion Omega2+ + DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci uboot-envtools kmod-sdhci-mt7620 +endef +TARGET_DEVICES += omega2p diff --git a/target/linux/ramips/image/rt288x.mk b/target/linux/ramips/image/rt288x.mk index 3312d0ed17..3a69c813b1 100644 --- a/target/linux/ramips/image/rt288x.mk +++ b/target/linux/ramips/image/rt288x.mk @@ -3,7 +3,10 @@ # define Build/gemtek-header - mkheader_gemtek $@ $@.new $(1) && mv $@.new $@ + if [ -f $@ ]; then \ + mkheader_gemtek $@ $@.new $(1) && \ + mv $@.new $@; \ + fi endef define Device/ar670w @@ -11,7 +14,7 @@ define Device/ar670w BLOCKSIZE := 64k DEVICE_TITLE := Airlink AR670W IMAGE_SIZE := $(ralink_default_fw_size_4M) - KERNEL := $(KERNEL_DTB) + KERNEL := $(KERNEL_DTB) | pad-to $$(BLOCKSIZE) IMAGES += factory.bin IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ wrg-header wrgn16a_airlink_ar670w @@ -20,9 +23,9 @@ TARGET_DEVICES += ar670w define Device/ar725w DTS := AR725W - DEVICE_TITLE := Gemtek AR725W + DEVICE_TITLE := Airlink AR725W IMAGES += factory.bin - IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size 3328k | \ gemtek-header ar725w endef TARGET_DEVICES += ar725w diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk index 529094d49b..55c47e3467 100644 --- a/target/linux/ramips/image/rt305x.mk +++ b/target/linux/ramips/image/rt305x.mk @@ -296,6 +296,7 @@ TARGET_DEVICES += dir-620-d1 define Device/dwr-512-b DTS := DWR-512-B + IMAGE_SIZE := 7700k DEVICE_TITLE := D-Link DWR-512 B DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-i2c-core kmod-i2c-ralink kmod-spi-dev \ kmod-usb-serial kmod-usb-serial-option kmod-usb-serial-wwan comgt diff --git a/target/linux/ramips/modules.mk b/target/linux/ramips/modules.mk index 99c5a9d0fc..2bece6fc5c 100644 --- a/target/linux/ramips/modules.mk +++ b/target/linux/ramips/modules.mk @@ -61,18 +61,18 @@ $(eval $(call KernelPackage,i2c-ralink)) I2C_MT7621_MODULES:= \ CONFIG_I2C_MT7621:drivers/i2c/busses/i2c-mt7621 -define KernelPackage/i2c-mt7621 +define KernelPackage/i2c-mt7628 $(call i2c_defaults,$(I2C_MT7621_MODULES),59) - TITLE:=MT7621 I2C Controller + TITLE:=MT7628/88 I2C Controller DEPENDS:=kmod-i2c-core \ - @(TARGET_ramips_mt7621||TARGET_ramips_mt7628||TARGET_ramips_mt7688) + @(TARGET_ramips_mt7628||TARGET_ramips_mt7688) endef -define KernelPackage/i2c-mt7621/description +define KernelPackage/i2c-mt7628/description Kernel modules for enable mt7621 i2c controller. endef -$(eval $(call KernelPackage,i2c-mt7621)) +$(eval $(call KernelPackage,i2c-mt7628)) define KernelPackage/dma-ralink SUBMENU:=Other modules diff --git a/target/linux/ramips/mt7620/config-4.4 b/target/linux/ramips/mt7620/config-4.4 new file mode 100644 index 0000000000..a2a77177f4 --- /dev/null +++ b/target/linux/ramips/mt7620/config-4.4 @@ -0,0 +1,211 @@ +CONFIG_ARCH_BINFMT_ELF_STATE=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_DISCARD_MEMBLOCK=y +CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set +CONFIG_ARCH_HAS_RESET_CONTROLLER=y +# CONFIG_ARCH_HAS_SG_CHAIN is not set +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y +CONFIG_ARCH_REQUIRE_GPIOLIB=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_AT803X_PHY=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_CEVT_R4K=y +CONFIG_CEVT_SYSTICK_QUIRK=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKEVT_RT3352=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLKSRC_OF=y +CONFIG_CLKSRC_PROBE=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE="rootfstype=squashfs,jffs2" +CONFIG_CMDLINE_BOOL=y +# CONFIG_CMDLINE_OVERRIDE is not set +CONFIG_CPU_GENERIC_DUMP_TLB=y +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_CPU_MIPS32=y +# CONFIG_CPU_MIPS32_R1 is not set +CONFIG_CPU_MIPS32_R2=y +CONFIG_CPU_MIPSR2=y +CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y +CONFIG_CPU_R4K_CACHE_TLB=y +CONFIG_CPU_R4K_FPU=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_CPU_SUPPORTS_MSA=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_CSRC_R4K=y +CONFIG_DEBUG_PINCTRL=y +CONFIG_DMA_NONCOHERENT=y +# CONFIG_DTB_MT7620A_EVAL is not set +CONFIG_DTB_RT_NONE=y +CONFIG_DTC=y +CONFIG_EARLY_PRINTK=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_DEVRES=y +# CONFIG_GPIO_MT7621 is not set +CONFIG_GPIO_RALINK=y +CONFIG_GPIO_SYSFS=y +CONFIG_HARDWARE_WATCHPOINTS=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_BPF_JIT=y +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DEBUG_STACKOVERFLOW=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_KVM=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_HAVE_MACH_CLKDEV=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MEMBLOCK_NODE_MAP=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HW_HAS_PCI=y +CONFIG_HZ_PERIODIC=y +CONFIG_ICPLUS_PHY=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_INTC=y +CONFIG_IRQ_MIPS_CPU=y +CONFIG_IRQ_WORK=y +CONFIG_LIBFDT=y +CONFIG_MDIO_BOARDINFO=y +CONFIG_MIPS=y +CONFIG_MIPS_CLOCK_VSYSCALL=y +# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set +# CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set +CONFIG_MIPS_CMDLINE_FROM_DTB=y +# CONFIG_MIPS_ELF_APPENDED_DTB is not set +# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set +CONFIG_MIPS_L1_CACHE_SHIFT=5 +# CONFIG_MIPS_MACHINE is not set +CONFIG_MIPS_NO_APPENDED_DTB=y +# CONFIG_MIPS_RAW_APPENDED_DTB is not set +CONFIG_MIPS_SPRAM=y +CONFIG_MODULES_USE_ELF_REL=y +# CONFIG_MT7621_WDT is not set +# CONFIG_MTD_CFI_INTELEXT is not set +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_M25P80=y +CONFIG_MTD_NAND_MT7620=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SPLIT_FIRMWARE=y +CONFIG_MTD_SPLIT_SEAMA_FW=y +CONFIG_MTD_SPLIT_TPLINK_FW=y +CONFIG_MTD_SPLIT_UIMAGE_FW=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NET_MEDIATEK_GSW_MT7620=y +CONFIG_NET_MEDIATEK_MDIO=y +CONFIG_NET_MEDIATEK_MDIO_MT7620=y +CONFIG_NET_MEDIATEK_MT7620=y +# CONFIG_NET_MEDIATEK_RT3050 is not set +CONFIG_NET_MEDIATEK_SOC=y +CONFIG_NET_VENDOR_MEDIATEK=y +CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +# CONFIG_NO_IOPORT_MAP is not set +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_MDIO=y +CONFIG_OF_MTD=y +CONFIG_OF_NET=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PHY_RALINK_USB=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_RT2880=y +# CONFIG_PINCTRL_SINGLE is not set +CONFIG_RALINK=y +CONFIG_RALINK_WDT=y +# CONFIG_RCU_STALL_COMMON is not set +CONFIG_RESET_CONTROLLER=y +CONFIG_SCHED_HRTICK=y +# CONFIG_SCHED_INFO is not set +# CONFIG_SCSI_DMA is not set +# CONFIG_SERIAL_8250_FSL is not set +CONFIG_SERIAL_8250_RT288X=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SOC_MT7620=y +# CONFIG_SOC_MT7621 is not set +# CONFIG_SOC_RT288X is not set +# CONFIG_SOC_RT305X is not set +# CONFIG_SOC_RT3883 is not set +CONFIG_SPI=y +CONFIG_SPI_MASTER=y +# CONFIG_SPI_MT7621 is not set +CONFIG_SPI_RT2880=y +CONFIG_SRCU=y +CONFIG_SWCONFIG=y +CONFIG_SWCONFIG_LEDS=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R2=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_MIPS16=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y +CONFIG_WATCHDOG_CORE=y +CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/ramips/mt7620/profiles/00-default.mk b/target/linux/ramips/mt7620/profiles/00-default.mk new file mode 100644 index 0000000000..912d28880e --- /dev/null +++ b/target/linux/ramips/mt7620/profiles/00-default.mk @@ -0,0 +1,17 @@ +# +# Copyright (C) 2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/Default + NAME:=Default Profile + PACKAGES:= kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport + PRIORITY:=1 +endef + +define Profile/Default/Description + Default package set compatible with most boards. +endef +$(eval $(call Profile,Default)) diff --git a/target/linux/ramips/mt7620/target.mk b/target/linux/ramips/mt7620/target.mk new file mode 100644 index 0000000000..e898005bd0 --- /dev/null +++ b/target/linux/ramips/mt7620/target.mk @@ -0,0 +1,15 @@ +# +# Copyright (C) 2009 OpenWrt.org +# + +SUBTARGET:=mt7620 +BOARDNAME:=MT7620 based boards +FEATURES+=usb +CPU_TYPE:=24kc + +DEFAULT_PACKAGES += kmod-rt2800-pci kmod-rt2800-soc kmod-mt76 + +define Target/Description + Build firmware images for Ralink MT7620 based boards. +endef + diff --git a/target/linux/ramips/mt7621/target.mk b/target/linux/ramips/mt7621/target.mk index 8648502f66..121761f45f 100644 --- a/target/linux/ramips/mt7621/target.mk +++ b/target/linux/ramips/mt7621/target.mk @@ -7,7 +7,7 @@ BOARDNAME:=MT7621 based boards FEATURES+=usb rtc nand CPU_TYPE:=24kc -DEFAULT_PACKAGES += kmod-usb3 +DEFAULT_PACKAGES += kmod-mt76 KERNEL_PATCHVER:=4.4 diff --git a/target/linux/ramips/mt7628/config-4.4 b/target/linux/ramips/mt7628/config-4.4 new file mode 100644 index 0000000000..6b04457f17 --- /dev/null +++ b/target/linux/ramips/mt7628/config-4.4 @@ -0,0 +1,206 @@ +CONFIG_ARCH_BINFMT_ELF_STATE=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_DISCARD_MEMBLOCK=y +CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set +CONFIG_ARCH_HAS_RESET_CONTROLLER=y +# CONFIG_ARCH_HAS_SG_CHAIN is not set +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y +CONFIG_ARCH_REQUIRE_GPIOLIB=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_AT803X_PHY=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_CEVT_R4K=y +CONFIG_CEVT_SYSTICK_QUIRK=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKEVT_RT3352=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLKSRC_OF=y +CONFIG_CLKSRC_PROBE=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE="rootfstype=squashfs,jffs2" +CONFIG_CMDLINE_BOOL=y +# CONFIG_CMDLINE_OVERRIDE is not set +CONFIG_CPU_GENERIC_DUMP_TLB=y +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_CPU_MIPS32=y +# CONFIG_CPU_MIPS32_R1 is not set +CONFIG_CPU_MIPS32_R2=y +CONFIG_CPU_MIPSR2=y +CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y +CONFIG_CPU_R4K_CACHE_TLB=y +CONFIG_CPU_R4K_FPU=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_CPU_SUPPORTS_MSA=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_CSRC_R4K=y +CONFIG_DEBUG_PINCTRL=y +CONFIG_DMA_NONCOHERENT=y +# CONFIG_DTB_MT7620A_EVAL is not set +CONFIG_DTB_RT_NONE=y +CONFIG_DTC=y +CONFIG_EARLY_PRINTK=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_DEVRES=y +CONFIG_GPIO_MT7621=y +# CONFIG_GPIO_RALINK is not set +CONFIG_GPIO_SYSFS=y +CONFIG_HARDWARE_WATCHPOINTS=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_BPF_JIT=y +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DEBUG_STACKOVERFLOW=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_KVM=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_HAVE_MACH_CLKDEV=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MEMBLOCK_NODE_MAP=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HW_HAS_PCI=y +CONFIG_HZ_PERIODIC=y +CONFIG_ICPLUS_PHY=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_INTC=y +CONFIG_IRQ_MIPS_CPU=y +CONFIG_IRQ_WORK=y +CONFIG_LIBFDT=y +CONFIG_MDIO_BOARDINFO=y +CONFIG_MIPS=y +CONFIG_MIPS_CLOCK_VSYSCALL=y +# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set +# CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set +CONFIG_MIPS_CMDLINE_FROM_DTB=y +# CONFIG_MIPS_ELF_APPENDED_DTB is not set +# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set +CONFIG_MIPS_L1_CACHE_SHIFT=5 +# CONFIG_MIPS_MACHINE is not set +CONFIG_MIPS_NO_APPENDED_DTB=y +# CONFIG_MIPS_RAW_APPENDED_DTB is not set +CONFIG_MIPS_SPRAM=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MT7621_WDT=y +# CONFIG_MTD_CFI_INTELEXT is not set +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_M25P80=y +CONFIG_MTD_NAND_MT7620=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPLIT_FIRMWARE=y +CONFIG_MTD_SPLIT_UIMAGE_FW=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NET_MEDIATEK_ESW_RT3050=y +# CONFIG_NET_MEDIATEK_MT7620 is not set +CONFIG_NET_MEDIATEK_RT3050=y +CONFIG_NET_MEDIATEK_SOC=y +CONFIG_NET_VENDOR_MEDIATEK=y +CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +# CONFIG_NO_IOPORT_MAP is not set +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_MDIO=y +CONFIG_OF_MTD=y +CONFIG_OF_NET=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PHY_RALINK_USB=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_RT2880=y +# CONFIG_PINCTRL_SINGLE is not set +CONFIG_RALINK=y +# CONFIG_RALINK_WDT is not set +# CONFIG_RCU_STALL_COMMON is not set +CONFIG_RESET_CONTROLLER=y +CONFIG_SCHED_HRTICK=y +# CONFIG_SCHED_INFO is not set +# CONFIG_SCSI_DMA is not set +# CONFIG_SERIAL_8250_FSL is not set +CONFIG_SERIAL_8250_NR_UARTS=3 +CONFIG_SERIAL_8250_RUNTIME_UARTS=3 +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SOC_MT7620=y +# CONFIG_SOC_MT7621 is not set +# CONFIG_SOC_RT288X is not set +# CONFIG_SOC_RT305X is not set +# CONFIG_SOC_RT3883 is not set +CONFIG_SPI=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_MT7621=y +# CONFIG_SPI_RT2880 is not set +CONFIG_SRCU=y +CONFIG_SWCONFIG=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R2=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_MIPS16=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y +CONFIG_WATCHDOG_CORE=y +CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/ramips/mt7628/profiles/00-default.mk b/target/linux/ramips/mt7628/profiles/00-default.mk new file mode 100644 index 0000000000..162ac14315 --- /dev/null +++ b/target/linux/ramips/mt7628/profiles/00-default.mk @@ -0,0 +1,17 @@ +# +# Copyright (C) 2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/Default + NAME:=Default Profile + PRIORITY:=1 + PACKAGES:= kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport +endef + +define Profile/Default/Description + Default package set compatible with most boards. +endef +$(eval $(call Profile,Default)) diff --git a/target/linux/ramips/mt7628/target.mk b/target/linux/ramips/mt7628/target.mk new file mode 100644 index 0000000000..76e855c59c --- /dev/null +++ b/target/linux/ramips/mt7628/target.mk @@ -0,0 +1,15 @@ +# +# Copyright (C) 2009 OpenWrt.org +# + +SUBTARGET:=mt7628 +BOARDNAME:=MT7628 based boards +FEATURES+=usb +CPU_TYPE:=24kc + +DEFAULT_PACKAGES += kmod-mt76 + +define Target/Description + Build firmware images for Ralink MT7628 based boards. +endef + diff --git a/target/linux/ramips/mt7688/config-4.4 b/target/linux/ramips/mt7688/config-4.4 new file mode 100644 index 0000000000..aad333bfdb --- /dev/null +++ b/target/linux/ramips/mt7688/config-4.4 @@ -0,0 +1,211 @@ +CONFIG_ARCH_BINFMT_ELF_STATE=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_DISCARD_MEMBLOCK=y +CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set +CONFIG_ARCH_HAS_RESET_CONTROLLER=y +# CONFIG_ARCH_HAS_SG_CHAIN is not set +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y +CONFIG_ARCH_REQUIRE_GPIOLIB=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_AT803X_PHY=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_CEVT_R4K=y +CONFIG_CEVT_SYSTICK_QUIRK=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKEVT_RT3352=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLKSRC_OF=y +CONFIG_CLKSRC_PROBE=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE="rootfstype=squashfs,jffs2" +CONFIG_CMDLINE_BOOL=y +# CONFIG_CMDLINE_OVERRIDE is not set +CONFIG_CPU_GENERIC_DUMP_TLB=y +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_CPU_MIPS32=y +# CONFIG_CPU_MIPS32_R1 is not set +CONFIG_CPU_MIPS32_R2=y +CONFIG_CPU_MIPSR2=y +CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y +CONFIG_CPU_R4K_CACHE_TLB=y +CONFIG_CPU_R4K_FPU=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_CPU_SUPPORTS_MSA=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_CSRC_R4K=y +CONFIG_DEBUG_PINCTRL=y +CONFIG_DMA_NONCOHERENT=y +# CONFIG_DTB_MT7620A_EVAL is not set +CONFIG_DTB_RT_NONE=y +CONFIG_DTC=y +CONFIG_EARLY_PRINTK=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_DEVRES=y +CONFIG_GPIO_MT7621=y +# CONFIG_GPIO_RALINK is not set +CONFIG_GPIO_SYSFS=y +CONFIG_HARDWARE_WATCHPOINTS=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_BPF_JIT=y +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DEBUG_STACKOVERFLOW=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_KVM=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_HAVE_MACH_CLKDEV=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MEMBLOCK_NODE_MAP=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HW_HAS_PCI=y +CONFIG_HZ_PERIODIC=y +CONFIG_ICPLUS_PHY=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_INTC=y +CONFIG_IRQ_MIPS_CPU=y +CONFIG_IRQ_WORK=y +CONFIG_LIBFDT=y +CONFIG_MDIO_BOARDINFO=y +CONFIG_MIPS=y +CONFIG_MIPS_CLOCK_VSYSCALL=y +# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set +# CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set +CONFIG_MIPS_CMDLINE_FROM_DTB=y +# CONFIG_MIPS_ELF_APPENDED_DTB is not set +CONFIG_MIPS_FPU_EMULATOR=y +# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set +CONFIG_MIPS_L1_CACHE_SHIFT=5 +# CONFIG_MIPS_MACHINE is not set +CONFIG_MIPS_NO_APPENDED_DTB=y +# CONFIG_MIPS_RAW_APPENDED_DTB is not set +CONFIG_MIPS_SPRAM=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MT7621_WDT=y +# CONFIG_MTD_CFI_INTELEXT is not set +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_M25P80=y +CONFIG_MTD_NAND_MT7620=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPLIT_FIRMWARE=y +CONFIG_MTD_SPLIT_UIMAGE_FW=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NET_MEDIATEK_ESW_RT3050=y +# CONFIG_NET_MEDIATEK_MT7620 is not set +CONFIG_NET_MEDIATEK_RT3050=y +CONFIG_NET_MEDIATEK_SOC=y +CONFIG_NET_VENDOR_MEDIATEK=y +CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +# CONFIG_NO_IOPORT_MAP is not set +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_MDIO=y +CONFIG_OF_MTD=y +CONFIG_OF_NET=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PHY_RALINK_USB=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_RT2880=y +# CONFIG_PINCTRL_SINGLE is not set +CONFIG_PWM=y +CONFIG_PWM_MEDIATEK=y +CONFIG_PWM_SYSFS=y +CONFIG_RALINK=y +# CONFIG_RALINK_WDT is not set +# CONFIG_RCU_STALL_COMMON is not set +CONFIG_RESET_CONTROLLER=y +CONFIG_SCHED_HRTICK=y +# CONFIG_SCHED_INFO is not set +# CONFIG_SCSI_DMA is not set +# CONFIG_SERIAL_8250_FSL is not set +CONFIG_SERIAL_8250_NR_UARTS=3 +CONFIG_SERIAL_8250_RUNTIME_UARTS=3 +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SOC_MT7620=y +# CONFIG_SOC_MT7621 is not set +# CONFIG_SOC_RT288X is not set +# CONFIG_SOC_RT305X is not set +# CONFIG_SOC_RT3883 is not set +CONFIG_SPI=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_MT7621=y +# CONFIG_SPI_RT2880 is not set +# CONFIG_SPI_SPIDEV is not set +CONFIG_SRCU=y +CONFIG_SWCONFIG=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R2=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_MIPS16=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y +CONFIG_WATCHDOG_CORE=y +CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/ramips/mt7688/profiles/00-default.mk b/target/linux/ramips/mt7688/profiles/00-default.mk new file mode 100644 index 0000000000..162ac14315 --- /dev/null +++ b/target/linux/ramips/mt7688/profiles/00-default.mk @@ -0,0 +1,17 @@ +# +# Copyright (C) 2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/Default + NAME:=Default Profile + PRIORITY:=1 + PACKAGES:= kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport +endef + +define Profile/Default/Description + Default package set compatible with most boards. +endef +$(eval $(call Profile,Default)) diff --git a/target/linux/ramips/mt7688/target.mk b/target/linux/ramips/mt7688/target.mk new file mode 100644 index 0000000000..f20a556de7 --- /dev/null +++ b/target/linux/ramips/mt7688/target.mk @@ -0,0 +1,15 @@ +# +# Copyright (C) 2015 OpenWrt.org +# + +SUBTARGET:=mt7688 +BOARDNAME:=MT7688 based boards +FEATURES+=usb +CPU_TYPE:=24kc + +DEFAULT_PACKAGES += kmod-mt76 + +define Target/Description + Build firmware images for Ralink MT7688 based boards. +endef + diff --git a/target/linux/ramips/patches-4.4/0025-pinctrl-ralink-add-pinctrl-driver.patch b/target/linux/ramips/patches-4.4/0025-pinctrl-ralink-add-pinctrl-driver.patch index 315d9563bc..f7fc93248e 100644 --- a/target/linux/ramips/patches-4.4/0025-pinctrl-ralink-add-pinctrl-driver.patch +++ b/target/linux/ramips/patches-4.4/0025-pinctrl-ralink-add-pinctrl-driver.patch @@ -14,7 +14,7 @@ Signed-off-by: John Crispin --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -585,6 +585,8 @@ config RALINK +@@ -586,6 +586,8 @@ config RALINK select CLKDEV_LOOKUP select ARCH_HAS_RESET_CONTROLLER select RESET_CONTROLLER diff --git a/target/linux/ramips/patches-4.4/0028-GPIO-ralink-add-mt7621-gpio-controller.patch b/target/linux/ramips/patches-4.4/0028-GPIO-ralink-add-mt7621-gpio-controller.patch index 46a1d9ec79..0f7f366ebc 100644 --- a/target/linux/ramips/patches-4.4/0028-GPIO-ralink-add-mt7621-gpio-controller.patch +++ b/target/linux/ramips/patches-4.4/0028-GPIO-ralink-add-mt7621-gpio-controller.patch @@ -14,7 +14,7 @@ Signed-off-by: John Crispin --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -587,6 +587,9 @@ config RALINK +@@ -588,6 +588,9 @@ config RALINK select RESET_CONTROLLER select PINCTRL select PINCTRL_RT2880 diff --git a/target/linux/ramips/patches-4.4/0033-xhci-mediatek-support-MTK-xHCI-host-controller.patch b/target/linux/ramips/patches-4.4/0033-xhci-mediatek-support-MTK-xHCI-host-controller.patch index 1bd29747b8..6dfb53ea3e 100644 --- a/target/linux/ramips/patches-4.4/0033-xhci-mediatek-support-MTK-xHCI-host-controller.patch +++ b/target/linux/ramips/patches-4.4/0033-xhci-mediatek-support-MTK-xHCI-host-controller.patch @@ -1420,7 +1420,7 @@ Signed-off-by: Greg Kroah-Hartman /* * Returns zero if the TRB isn't in this segment, otherwise it returns the DMA -@@ -3088,17 +3089,22 @@ static u32 xhci_td_remainder(struct xhci +@@ -3110,17 +3111,22 @@ static u32 xhci_td_remainder(struct xhci { u32 maxp, total_packet_count; @@ -1447,7 +1447,7 @@ Signed-off-by: Greg Kroah-Hartman /* Queueing functions don't count the current TRB into transferred */ return (total_packet_count - ((transferred + trb_buff_len) / maxp)); } -@@ -3486,7 +3492,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd * +@@ -3508,7 +3514,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd * field |= 0x1; /* xHCI 1.0/1.1 6.4.1.2.1: Transfer Type field */ @@ -1479,7 +1479,7 @@ Signed-off-by: Greg Kroah-Hartman writel(temp, &xhci->ir_set->irq_control); /* Set the HCD state before we enable the irqs */ -@@ -1704,6 +1709,9 @@ int xhci_drop_endpoint(struct usb_hcd *h +@@ -1691,6 +1696,9 @@ int xhci_drop_endpoint(struct usb_hcd *h xhci_endpoint_zero(xhci, xhci->devs[udev->slot_id], ep); @@ -1489,7 +1489,7 @@ Signed-off-by: Greg Kroah-Hartman xhci_dbg(xhci, "drop ep 0x%x, slot id %d, new drop flags = %#x, new add flags = %#x\n", (unsigned int) ep->desc.bEndpointAddress, udev->slot_id, -@@ -1799,6 +1807,15 @@ int xhci_add_endpoint(struct usb_hcd *hc +@@ -1786,6 +1794,15 @@ int xhci_add_endpoint(struct usb_hcd *hc return -ENOMEM; } @@ -1507,11 +1507,11 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1631,6 +1631,7 @@ struct xhci_hcd { +@@ -1634,6 +1634,7 @@ struct xhci_hcd { /* For controllers with a broken beyond repair streams implementation */ #define XHCI_BROKEN_STREAMS (1 << 19) #define XHCI_PME_STUCK_QUIRK (1 << 20) +#define XHCI_MTK_HOST (1 << 21) + #define XHCI_MISSING_CAS (1 << 24) unsigned int num_active_eps; unsigned int limit_active_eps; - /* There are two roothubs to keep track of bus suspend info for */ diff --git a/target/linux/ramips/patches-4.4/0046-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch b/target/linux/ramips/patches-4.4/0046-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch index 67c0b29898..3ec5fbc417 100644 --- a/target/linux/ramips/patches-4.4/0046-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch +++ b/target/linux/ramips/patches-4.4/0046-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch @@ -25,7 +25,7 @@ Signed-off-by: John Crispin --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig -@@ -811,3 +811,5 @@ config MMC_MTK +@@ -786,3 +786,5 @@ config MMC_MTK If you have a machine with a integrated SD/MMC card reader, say Y or M here. This is needed if support for any SD/SDIO/MMC devices is required. If unsure, say N. diff --git a/target/linux/ramips/patches-4.4/0519-gsw_mt7621.patch b/target/linux/ramips/patches-4.4/0519-gsw_mt7621.patch index c8fbc6404c..e146de235c 100644 --- a/target/linux/ramips/patches-4.4/0519-gsw_mt7621.patch +++ b/target/linux/ramips/patches-4.4/0519-gsw_mt7621.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/mediatek/mt7530.c +++ b/drivers/net/ethernet/mediatek/mt7530.c -@@ -543,6 +543,7 @@ mt7530_apply_config(struct switch_dev *d +@@ -547,6 +547,7 @@ mt7530_apply_config(struct switch_dev *d u8 etags = priv->vlan_entries[i].etags; u32 val; @@ -8,7 +8,7 @@ /* vid of vlan */ val = mt7530_r32(priv, REG_ESW_VLAN_VTIM(i)); if (i % 2 == 0) { -@@ -553,7 +554,7 @@ mt7530_apply_config(struct switch_dev *d +@@ -557,7 +558,7 @@ mt7530_apply_config(struct switch_dev *d val |= (vid << 12); } mt7530_w32(priv, REG_ESW_VLAN_VTIM(i), val); @@ -17,7 +17,7 @@ /* vlan port membership */ if (member) mt7530_w32(priv, REG_ESW_VLAN_VAWD1, REG_ESW_VLAN_VAWD1_IVL_MAC | -@@ -573,7 +574,11 @@ mt7530_apply_config(struct switch_dev *d +@@ -577,7 +578,11 @@ mt7530_apply_config(struct switch_dev *d mt7530_w32(priv, REG_ESW_VLAN_VAWD2, val); /* write to vlan table */ diff --git a/target/linux/ramips/patches-4.4/0902-mediatek-4-byte-spi-reset.patch b/target/linux/ramips/patches-4.4/0902-mediatek-4-byte-spi-reset.patch deleted file mode 100644 index 2ef5cf0a3d..0000000000 --- a/target/linux/ramips/patches-4.4/0902-mediatek-4-byte-spi-reset.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c -index fe9ceb7..2151975 100644 ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -27,6 +27,9 @@ - #include - #include - -+#define OPCODE_RESET_ENABLE 0x66 -+#define OPCODE_RESET 0x99 -+ - #define MAX_CMD_SIZE 6 - struct m25p { - struct spi_device *spi; -@@ -168,6 +171,17 @@ static int m25p80_erase(struct spi_nor *nor, loff_t offset) - return 0; - } - -+void m25p80_reboot(struct mtd_info *mtd) -+{ -+ struct spi_nor *nor = container_of(mtd, struct spi_nor, mtd); -+ struct m25p *flash = nor->priv; -+ -+ flash->command[0] = OPCODE_RESET_ENABLE; -+ spi_write(flash->spi, flash->command, 1); -+ flash->command[0] = OPCODE_RESET; -+ spi_write(flash->spi, flash->command, 1); -+} -+ - /* - * board specific setup should have ensured the SPI clock used here - * matches what the READ command supports, at least until this driver -@@ -197,6 +211,7 @@ static int m25p_probe(struct spi_device *spi) - nor->erase = m25p80_erase; - nor->write_reg = m25p80_write_reg; - nor->read_reg = m25p80_read_reg; -+ nor->mtd._reboot = m25p80_reboot; - - nor->dev = &spi->dev; - nor->flash_node = spi->dev.of_node; --- -2.9.3 - diff --git a/target/linux/ramips/patches-4.4/200-rt3883-fix-pinctrl-typo.patch b/target/linux/ramips/patches-4.4/200-rt3883-fix-pinctrl-typo.patch new file mode 100644 index 0000000000..aa55fd96ba --- /dev/null +++ b/target/linux/ramips/patches-4.4/200-rt3883-fix-pinctrl-typo.patch @@ -0,0 +1,21 @@ +From 2583143af8111d430bdca0268b6cdb7ccc7c3f9d Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Fri, 13 Jan 2017 05:40:04 +0100 +Subject: [PATCH] mips: ralink/rt3883: fix typo in pinctrl lna_g_func + +Signed-off-by: Daniel Golle +--- + arch/mips/ralink/rt3883.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/ralink/rt3883.c ++++ b/arch/mips/ralink/rt3883.c +@@ -36,7 +36,7 @@ static struct rt2880_pmx_func uartlite_f + static struct rt2880_pmx_func jtag_func[] = { FUNC("jtag", 0, 17, 5) }; + static struct rt2880_pmx_func mdio_func[] = { FUNC("mdio", 0, 22, 2) }; + static struct rt2880_pmx_func lna_a_func[] = { FUNC("lna a", 0, 32, 3) }; +-static struct rt2880_pmx_func lna_g_func[] = { FUNC("lna a", 0, 35, 3) }; ++static struct rt2880_pmx_func lna_g_func[] = { FUNC("lna g", 0, 35, 3) }; + static struct rt2880_pmx_func pci_func[] = { + FUNC("pci-dev", 0, 40, 32), + FUNC("pci-host2", 1, 40, 32), diff --git a/target/linux/ramips/rt288x/target.mk b/target/linux/ramips/rt288x/target.mk index 1e20e51ed2..65ad68fd81 100644 --- a/target/linux/ramips/rt288x/target.mk +++ b/target/linux/ramips/rt288x/target.mk @@ -4,7 +4,7 @@ SUBTARGET:=rt288x BOARDNAME:=RT288x based boards -CPU_TYPE:=mips32r2 +CPU_TYPE:=24kc DEFAULT_PACKAGES += kmod-rt2800-soc diff --git a/target/linux/uml/Makefile b/target/linux/uml/Makefile index 91631391a7..7cf1614218 100644 --- a/target/linux/uml/Makefile +++ b/target/linux/uml/Makefile @@ -20,7 +20,7 @@ ARCH:=$(shell uname -m | sed \ ) BOARD:=uml BOARDNAME:=User Mode Linux -FEATURES:=squashfs ext4 audio +FEATURES:=squashfs ext4 audio source-only MAINTAINER:=Florian Fainelli KERNEL_PATCHVER:=4.4 diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default index 791c1f2191..848f041aeb 100644 --- a/target/linux/x86/64/config-default +++ b/target/linux/x86/64/config-default @@ -109,6 +109,14 @@ CONFIG_GART_IOMMU=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y CONFIG_GENERIC_CPU=y CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_GPIOLIB=y +# CONFIG_GPIO_104_IDIO_16 is not set +# CONFIG_GPIO_AMDPT is not set +# CONFIG_GPIO_F7188X is not set +# CONFIG_GPIO_INTEL_MID is not set +# CONFIG_GPIO_IT87 is not set +# CONFIG_GPIO_LYNXPOINT is not set +CONFIG_GPIO_SYSFS=y CONFIG_HAVE_ACPI_APEI=y CONFIG_HAVE_ACPI_APEI_NMI=y # CONFIG_HAVE_AOUT is not set @@ -161,6 +169,7 @@ CONFIG_ITCO_WDT=y # CONFIG_KVM_DEBUG_FS is not set CONFIG_KVM_GUEST=y # CONFIG_LCD_CLASS_DEVICE is not set +CONFIG_LEDS_GPIO=y # CONFIG_LEGACY_VSYSCALL_EMULATE is not set # CONFIG_LEGACY_VSYSCALL_NATIVE is not set CONFIG_LEGACY_VSYSCALL_NONE=y diff --git a/target/linux/x86/64/target.mk b/target/linux/x86/64/target.mk index b4172de6cc..a3420b89b2 100644 --- a/target/linux/x86/64/target.mk +++ b/target/linux/x86/64/target.mk @@ -1,6 +1,6 @@ ARCH:=x86_64 BOARDNAME:=x86_64 -DEFAULT_PACKAGES += kmod-button-hotplug kmod-e1000e kmod-e1000 kmod-igb +DEFAULT_PACKAGES += kmod-button-hotplug kmod-e1000e kmod-e1000 kmod-r8169 kmod-igb define Target/Description Build images for 64 bit systems including virtualized guests. diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile index d702e4e8a0..f371b2ba3a 100644 --- a/target/linux/x86/Makefile +++ b/target/linux/x86/Makefile @@ -10,7 +10,7 @@ ARCH:=i386 BOARD:=x86 BOARDNAME:=x86 FEATURES:=squashfs ext4 vdi vmdk pcmcia targz fpu -SUBTARGETS:=generic legacy xen_domu geode 64 +SUBTARGETS:=generic legacy geode 64 MAINTAINER:=Felix Fietkau KERNEL_PATCHVER:=4.4 diff --git a/target/linux/x86/base-files/etc/board.d/01_leds b/target/linux/x86/base-files/etc/board.d/01_leds new file mode 100755 index 0000000000..03df810972 --- /dev/null +++ b/target/linux/x86/base-files/etc/board.d/01_leds @@ -0,0 +1,26 @@ +#!/bin/sh +# +# Copyright © 2017 OpenWrt.org +# + +. /lib/functions/uci-defaults.sh + +board_config_update + +board=$(cat /tmp/sysinfo/board_name) 2>/dev/null + +case "$board" in +pc-engines-apu2) + ucidef_set_led_netdev "wan" "WAN" "apu2:green:led3" "eth0" + ucidef_set_led_netdev "lan" "LAN" "apu2:green:led2" "br-lan" + ucidef_set_led_default "diag" "DIAG" "apu2:green:power" "1" + ;; +traverse-technologies-geos) + ucidef_set_led_netdev "lan" "LAN" "geos:1" "br-lan" "tx rx" + ucidef_set_led_netdev "wlan" "WiFi" "geos:2" "phy0tpt" + ucidef_set_led_default "diag" "DIAG" "geos:3" "1" + ;; +esac +board_config_flush + +exit 0 diff --git a/target/linux/x86/base-files/etc/board.d/02_network b/target/linux/x86/base-files/etc/board.d/02_network new file mode 100755 index 0000000000..c2af64336b --- /dev/null +++ b/target/linux/x86/base-files/etc/board.d/02_network @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Copyright © 2017 OpenWrt.org +# + +. /lib/functions/system.sh +. /lib/functions/uci-defaults.sh + +board_config_update + +board="$(cat /tmp/sysinfo/board_name)" 2>/dev/null + +case "$board" in +pc-engines-apu2) + ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0" + ;; +traverse-technologies-geos) + ucidef_set_interface_lan "eth0 eth1" + ucidef_add_atm_bridge "0" "35" "llc" "bridged" + ucidef_set_interface_wan "nas0" "dhcp" + macaddr="$(cat /sys/class/net/eth0/address)" 2>/dev/null + [ -n "$macaddr" ] && ucidef_set_interface_macaddr "wan" "$macaddr" + ;; +esac +board_config_flush + +exit 0 diff --git a/target/linux/x86/base-files/etc/diag.sh b/target/linux/x86/base-files/etc/diag.sh new file mode 100644 index 0000000000..3af4b23583 --- /dev/null +++ b/target/linux/x86/base-files/etc/diag.sh @@ -0,0 +1,78 @@ +#!/bin/sh +# +# Copyright © 2017 OpenWrt.org +# + +. /lib/functions.sh +. /lib/functions/leds.sh +. /usr/share/libubox/jshn.sh + +preinit_match_diag_led() { + local CFG keys key cfg name sysfs default + + CFG=/etc/board.json + if [ ! -s $CFG ]; then + CFG=/tmp/board.json + [ -s /tmp/sysinfo/model ] || return + /bin/board_detect $CFG || return + fi + + json_init + json_load "$(cat $CFG)" + json_get_keys keys led + json_select led + for key in $keys; do + json_select "$key" + json_get_vars name sysfs default + + if [ "$name" = "DIAG" -a "$default" = "1" ]; then + status_led="$sysfs" + return + fi + json_select .. + done +} + +match_diag_led() { + local name + local default + local sysfs + config_get name "$1" name + config_get default "$1" default + config_get sysfs "$1" sysfs + + if [ "$name" = "DIAG" -a "$default" = "1" ]; then + status_led="$sysfs" + fi +} + +get_status_led() { + if [ -s /etc/config/system ]; then + config_load system + config_foreach match_diag_led led + else + preinit_match_diag_led + fi +} + +set_state() { + get_status_led + + case "$1" in + preinit) + status_led_blink_preinit + ;; + + failsafe) + status_led_blink_failsafe + ;; + + preinit_regular) + status_led_blink_preinit_regular + ;; + + done) + status_led_on + ;; + esac +} diff --git a/target/linux/x86/base-files/etc/inittab b/target/linux/x86/base-files/etc/inittab index d1b5a0fa22..f4747f200d 100644 --- a/target/linux/x86/base-files/etc/inittab +++ b/target/linux/x86/base-files/etc/inittab @@ -1,4 +1,5 @@ ::sysinit:/etc/init.d/rcS S boot ::shutdown:/etc/init.d/rcS K shutdown ttyS0::askfirst:/usr/libexec/login.sh +hvc0::askfirst:/usr/libexec/login.sh tty1::askfirst:/usr/libexec/login.sh diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh index 8850917062..d3e9f360aa 100644 --- a/target/linux/x86/base-files/lib/upgrade/platform.sh +++ b/target/linux/x86/base-files/lib/upgrade/platform.sh @@ -21,20 +21,13 @@ platform_copy_config() { } platform_do_upgrade() { - local diskdev partdev ibs diff + local diskdev partdev diff if export_bootdevice && export_partdevice diskdev 0; then sync if [ "$SAVE_PARTITIONS" = "1" ]; then get_partitions "/dev/$diskdev" bootdisk - #get block size - if [ -f "/sys/block/$diskdev/queue/physical_block_size" ]; then - ibs="$(cat "/sys/block/$diskdev/queue/physical_block_size")" - else - ibs=512 - fi - #extract the boot sector from the image get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b @@ -54,7 +47,7 @@ platform_do_upgrade() { while read part start size; do if export_partdevice partdev $part; then echo "Writing image to /dev/$partdev..." - get_image "$@" | dd of="/dev/$partdev" ibs="$ibs" obs=1M skip="$start" count="$size" conv=fsync + get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync else echo "Unable to find partition $part device, skipped." fi diff --git a/target/linux/x86/config-4.4 b/target/linux/x86/config-4.4 index 894fed09d2..29d19daeb0 100644 --- a/target/linux/x86/config-4.4 +++ b/target/linux/x86/config-4.4 @@ -57,7 +57,7 @@ CONFIG_CLKSRC_I8253=y CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_CLONE_BACKWARDS=y -CONFIG_COMPAT_VDSO=y +# CONFIG_COMPAT_VDSO is not set CONFIG_CONSOLE_TRANSLATIONS=y # CONFIG_CPU5_WDT is not set CONFIG_CPU_FREQ=y @@ -79,6 +79,7 @@ CONFIG_CPU_SUP_CYRIX_32=y CONFIG_CPU_SUP_INTEL=y CONFIG_CPU_SUP_TRANSMETA_32=y CONFIG_CPU_SUP_UMC_32=y +# CONFIG_CRASHLOG is not set CONFIG_CRC16=y CONFIG_CRYPTO_AES_586=y CONFIG_CRYPTO_CRC32C=y @@ -124,6 +125,11 @@ CONFIG_FIRMWARE_IN_KERNEL=y CONFIG_FIRMWARE_MEMMAP=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_FS_MBCACHE=y +CONFIG_FUSION=y +# CONFIG_FUSION_CTL is not set +# CONFIG_FUSION_LOGGING is not set +CONFIG_FUSION_MAX_SGE=128 +CONFIG_FUSION_SPI=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_CLOCKEVENTS=y @@ -351,6 +357,7 @@ CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_SCHED_HRTICK=y # CONFIG_SCHED_INFO is not set CONFIG_SCSI=y +CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCx200=y CONFIG_SCx200HR_TIMER=y # CONFIG_SCx200_GPIO is not set diff --git a/target/linux/x86/generic/base-files/lib/preinit/45_mount_xenfs b/target/linux/x86/generic/base-files/lib/preinit/45_mount_xenfs new file mode 100644 index 0000000000..ac484f6210 --- /dev/null +++ b/target/linux/x86/generic/base-files/lib/preinit/45_mount_xenfs @@ -0,0 +1,9 @@ +#!/bin/sh +# Copyright (C) 2010 OpenWrt.org + +do_mount_xenfs() { + grep -q xenfs /proc/filesystems && \ + mount -o noatime -t xenfs none /proc/xen +} + +boot_hook_add preinit_mount_root do_mount_xenfs diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default index bef606935b..1a14c270bc 100644 --- a/target/linux/x86/generic/config-default +++ b/target/linux/x86/generic/config-default @@ -5,7 +5,7 @@ CONFIG_ACPI_BATTERY=y # CONFIG_ACPI_BGRT is not set CONFIG_ACPI_BUTTON=y # CONFIG_ACPI_CMPC is not set -# CONFIG_ACPI_CONTAINER is not set +CONFIG_ACPI_CONTAINER=y CONFIG_ACPI_CPU_FREQ_PSS=y # CONFIG_ACPI_CUSTOM_DSDT is not set # CONFIG_ACPI_DEBUG is not set @@ -13,6 +13,7 @@ CONFIG_ACPI_CPU_FREQ_PSS=y # CONFIG_ACPI_DOCK is not set # CONFIG_ACPI_EC_DEBUGFS is not set # CONFIG_ACPI_FAN is not set +CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_HOTPLUG_IOAPIC=y # CONFIG_ACPI_I2C_OPREGION is not set # CONFIG_ACPI_INITRD_TABLE_OVERRIDE is not set @@ -40,6 +41,7 @@ CONFIG_AGP_INTEL=y # CONFIG_AGP_SIS is not set # CONFIG_AGP_SWORKS is not set # CONFIG_AGP_VIA is not set +# CONFIG_APM is not set CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y CONFIG_ARCH_PHYS_ADDR_T_64BIT=y @@ -51,10 +53,17 @@ CONFIG_BACKLIGHT_GENERIC=y CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BLK_DEV_SR=y # CONFIG_BLK_DEV_SR_VENDOR is not set +# CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set CONFIG_CLKDEV_LOOKUP=y CONFIG_COMMON_CLK=y CONFIG_CPU_IDLE_GOV_MENU=y CONFIG_CPU_RMAP=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL2=y +# CONFIG_DEBUG_HOTPLUG_CPU0 is not set CONFIG_DMA_SHARED_BUFFER=y CONFIG_DRM=y CONFIG_DRM_AMDGPU=y @@ -112,6 +121,7 @@ CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_CMDLINE=y +CONFIG_FB_DEFERRED_IO=y CONFIG_FB_EFI=y # CONFIG_FB_I810 is not set CONFIG_FB_SYS_COPYAREA=y @@ -126,6 +136,7 @@ CONFIG_FONT_SUPPORT=y CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +CONFIG_FREEZER=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_GENERIC_PINCONF=y CONFIG_GPIOLIB=y @@ -151,13 +162,18 @@ CONFIG_HAVE_KVM_IRQ_BYPASS=y CONFIG_HAVE_KVM_IRQ_ROUTING=y CONFIG_HAVE_KVM_MSI=y CONFIG_HDMI=y +CONFIG_HIBERNATE_CALLBACKS=y CONFIG_HID=y CONFIG_HID_BATTERY_STRENGTH=y # CONFIG_HIGHMEM64G is not set +CONFIG_HOTPLUG_CPU=y CONFIG_HPET=y CONFIG_HPET_MMAP=y # CONFIG_HP_ACCEL is not set CONFIG_HVC_DRIVER=y +CONFIG_HVC_IRQ=y +CONFIG_HVC_XEN=y +CONFIG_HVC_XEN_FRONTEND=y CONFIG_HWMON=y CONFIG_HW_RANDOM_VIRTIO=y CONFIG_HYPERVISOR_GUEST=y @@ -169,6 +185,7 @@ CONFIG_INPUT_MOUSEDEV=y CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y CONFIG_INTEL_GTT=y CONFIG_INTEL_IDLE=y # CONFIG_INTEL_IPS is not set @@ -194,7 +211,6 @@ CONFIG_KVM_MMIO=y CONFIG_KVM_VFIO=y # CONFIG_LANCE is not set # CONFIG_LCD_CLASS_DEVICE is not set -# CONFIG_LGUEST is not set # CONFIG_LGUEST_GUEST is not set CONFIG_LOCK_SPIN_ON_OWNER=y # CONFIG_M486 is not set @@ -234,6 +250,7 @@ CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NET_FLOW_LIMIT=y CONFIG_NO_HZ=y CONFIG_NR_CPUS=4 +CONFIG_PADATA=y CONFIG_PARAVIRT=y CONFIG_PARAVIRT_CLOCK=y # CONFIG_PARAVIRT_DEBUG is not set @@ -249,7 +266,9 @@ CONFIG_PATA_SC1200=y CONFIG_PATA_VIA=y CONFIG_PCIEAER=y CONFIG_PCIEPORTBUS=y +CONFIG_PCIE_PME=y CONFIG_PCI_MMCONFIG=y +CONFIG_PCI_XEN=y # CONFIG_PCWATCHDOG is not set CONFIG_PGTABLE_LEVELS=3 CONFIG_PHYS_ADDR_T_64BIT=y @@ -259,7 +278,12 @@ CONFIG_PINCTRL_BROXTON=y CONFIG_PINCTRL_CHERRYVIEW=y CONFIG_PINCTRL_INTEL=y CONFIG_PINCTRL_SUNRISEPOINT=y +CONFIG_PM=y # CONFIG_PMIC_OPREGION is not set +CONFIG_PM_CLK=y +# CONFIG_PM_DEBUG is not set +CONFIG_PM_SLEEP=y +CONFIG_PM_SLEEP_SMP=y CONFIG_PNP=y CONFIG_PNPACPI=y # CONFIG_PNPBIOS is not set @@ -284,9 +308,10 @@ CONFIG_SERIAL_8250_PNP=y CONFIG_SMP=y # CONFIG_SURFACE_PRO3_BUTTON is not set CONFIG_SWIOTLB=y +CONFIG_SWIOTLB_XEN=y +CONFIG_SYS_HYPERVISOR=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y -# CONFIG_TASK_XACCT is not set # CONFIG_TOSHIBA_BT_RFKILL is not set CONFIG_TREE_RCU=y CONFIG_UCS2_STRING=y @@ -303,7 +328,6 @@ CONFIG_USER_RETURN_NOTIFIER=y CONFIG_VGACON_SOFT_SCROLLBACK=y CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 CONFIG_VHOST=y -# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set CONFIG_VHOST_NET=y CONFIG_VHOST_RING=y CONFIG_VIRTIO=y @@ -317,6 +341,7 @@ CONFIG_VIRTIO_NET=y CONFIG_VIRTIO_PCI=y CONFIG_VIRTIO_PCI_LEGACY=y CONFIG_VIRTUALIZATION=y +CONFIG_VT_CONSOLE_SLEEP=y # CONFIG_WDT is not set CONFIG_X86_32_SMP=y CONFIG_X86_ACPI_CPUFREQ=y @@ -342,4 +367,32 @@ CONFIG_X86_PM_TIMER=y # CONFIG_X86_POWERNOW_K8 is not set CONFIG_X86_TSC=y CONFIG_X86_USE_PPRO_CHECKSUM=y +CONFIG_XEN=y +CONFIG_XENFS=y +CONFIG_XEN_ACPI=y +CONFIG_XEN_ACPI_PROCESSOR=y +CONFIG_XEN_AUTO_XLATE=y +# CONFIG_XEN_BACKEND is not set +CONFIG_XEN_BALLOON=y +CONFIG_XEN_BLKDEV_FRONTEND=y +CONFIG_XEN_COMPAT_XENFS=y +CONFIG_XEN_DEBUG_FS=y +CONFIG_XEN_DEV_EVTCHN=y +CONFIG_XEN_DOM0=y +CONFIG_XEN_FBDEV_FRONTEND=y +CONFIG_XEN_GNTDEV=y +CONFIG_XEN_GRANT_DEV_ALLOC=y +CONFIG_XEN_HAVE_PVMMU=y +CONFIG_XEN_HAVE_VPMU=y +CONFIG_XEN_NETDEV_FRONTEND=y +CONFIG_XEN_PCIDEV_FRONTEND=y +CONFIG_XEN_PRIVCMD=y +CONFIG_XEN_PVHVM=y +CONFIG_XEN_SAVE_RESTORE=y +CONFIG_XEN_SCRUB_PAGES=y +CONFIG_XEN_SCSI_FRONTEND=y +CONFIG_XEN_SYMS=y +CONFIG_XEN_SYS_HYPERVISOR=y +CONFIG_XEN_WDT=y +CONFIG_XEN_XENBUS_FRONTEND=y CONFIG_XPS=y diff --git a/target/linux/x86/generic/profiles/000-Generic.mk b/target/linux/x86/generic/profiles/000-Generic.mk index 0d0e8ede86..90f989a91d 100644 --- a/target/linux/x86/generic/profiles/000-Generic.mk +++ b/target/linux/x86/generic/profiles/000-Generic.mk @@ -8,7 +8,7 @@ define Profile/Generic NAME:=Generic PACKAGES:=kmod-3c59x kmod-e100 kmod-e1000 kmod-natsemi kmod-ne2k-pci \ - kmod-pcnet32 kmod-sis900 kmod-tg3 \ + kmod-pcnet32 kmod-8139too kmod-r8169 kmod-sis900 kmod-tg3 \ kmod-via-rhine kmod-via-velocity endef diff --git a/target/linux/x86/geode/profiles/000-Generic.mk b/target/linux/x86/geode/profiles/000-Generic.mk new file mode 100644 index 0000000000..58dc3c641c --- /dev/null +++ b/target/linux/x86/geode/profiles/000-Generic.mk @@ -0,0 +1,20 @@ +# +# Copyright (C) 2006-2009 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/Generic + NAME:=Generic + PACKAGES:= \ + soloscli linux-atm br2684ctl ppp-mod-pppoa pppdump pppstats \ + hwclock flashrom tc kmod-pppoa kmod-8139cp kmod-mppe \ + kmod-usb-ohci-pci kmod-hwmon-lm90 \ + kmod-via-rhine +endef + +define Profile/Generic/Description + Generic Profile for all Geode boards. +endef +$(eval $(call Profile,Generic)) diff --git a/target/linux/x86/geode/profiles/100-Geos.mk b/target/linux/x86/geode/profiles/100-Geos.mk new file mode 100644 index 0000000000..94e501edf4 --- /dev/null +++ b/target/linux/x86/geode/profiles/100-Geos.mk @@ -0,0 +1,19 @@ +# +# Copyright (C) 2006-2009 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/Geos + NAME:=Geos + PACKAGES:= \ + soloscli linux-atm br2684ctl ppp-mod-pppoa pppdump pppstats \ + hwclock flashrom tc kmod-pppoa kmod-8139cp kmod-mppe \ + kmod-usb-ohci-pci kmod-hwmon-lm90 +endef + +define Profile/Geos/Description + Traverse Technologies Geos ADSL router +endef +$(eval $(call Profile,Geos)) diff --git a/target/linux/x86/geode/target.mk b/target/linux/x86/geode/target.mk index d98adac5b5..9c608e6f9d 100644 --- a/target/linux/x86/geode/target.mk +++ b/target/linux/x86/geode/target.mk @@ -6,8 +6,11 @@ DEFAULT_PACKAGES += \ kmod-button-hotplug \ kmod-ledtrig-heartbeat kmod-ledtrig-gpio \ kmod-ledtrig-netdev hwclock wpad-mini - -CPU_TYPE := geode +# Geos +DEFAULT_PACKAGES += \ + soloscli linux-atm br2684ctl ppp-mod-pppoa pppdump pppstats \ + hwclock flashrom tc kmod-pppoa kmod-8139cp kmod-mppe \ + kmod-usb-ohci-pci kmod-hwmon-lm90 define Target/Description Build firmware images for AMD Geode GX/LX based systems (net5501, alix, geos) diff --git a/target/linux/x86/image/grub-iso.cfg b/target/linux/x86/image/grub-iso.cfg index 32ee687c68..6a494377f4 100644 --- a/target/linux/x86/image/grub-iso.cfg +++ b/target/linux/x86/image/grub-iso.cfg @@ -5,6 +5,6 @@ set default="0" set timeout="@TIMEOUT@" set root='(cd)' -menuentry "LEDE" { +menuentry "libreCMC" { linux /boot/vmlinuz @CMDLINE@ noinitrd } diff --git a/target/linux/x86/image/grub.cfg b/target/linux/x86/image/grub.cfg index acca036a2e..bbf8d452ed 100644 --- a/target/linux/x86/image/grub.cfg +++ b/target/linux/x86/image/grub.cfg @@ -5,9 +5,9 @@ set default="0" set timeout="@TIMEOUT@" set root='(@ROOT@)' -menuentry "LEDE" { +menuentry "libreCMC" { linux /boot/vmlinuz @CMDLINE@ noinitrd } -menuentry "LEDE (failsafe)" { +menuentry "libreCMC (failsafe)" { linux /boot/vmlinuz failsafe=true @CMDLINE@ noinitrd } diff --git a/target/linux/x86/legacy/profiles/000-Generic.mk b/target/linux/x86/legacy/profiles/000-Generic.mk index 0d0e8ede86..90f989a91d 100644 --- a/target/linux/x86/legacy/profiles/000-Generic.mk +++ b/target/linux/x86/legacy/profiles/000-Generic.mk @@ -8,7 +8,7 @@ define Profile/Generic NAME:=Generic PACKAGES:=kmod-3c59x kmod-e100 kmod-e1000 kmod-natsemi kmod-ne2k-pci \ - kmod-pcnet32 kmod-sis900 kmod-tg3 \ + kmod-pcnet32 kmod-8139too kmod-r8169 kmod-sis900 kmod-tg3 \ kmod-via-rhine kmod-via-velocity endef diff --git a/target/linux/x86/modules.mk b/target/linux/x86/modules.mk index 656500b290..87733c2850 100644 --- a/target/linux/x86/modules.mk +++ b/target/linux/x86/modules.mk @@ -19,3 +19,18 @@ define KernelPackage/sound-cs5535audio/description endef $(eval $(call KernelPackage,sound-cs5535audio)) + +define KernelPackage/sp5100_tco + SUBMENU:=$(OTHER_MENU) + TITLE:=SP5100 Watchdog Support + DEPENDS:=@TARGET_x86 + KCONFIG:=CONFIG_SP5100_TCO + FILES:=$(LINUX_DIR)/drivers/watchdog/sp5100_tco.ko + AUTOLOAD:=$(call AutoLoad,50,sp5100_tco,1) +endef + +define KernelPackage/sp5100_tco/description + Kernel module for the SP5100_TCO hardware watchdog. +endef + +$(eval $(call KernelPackage,sp5100_tco)) diff --git a/target/linux/x86/patches-4.4/097-0001-sp5100_tco-Add-AMD-Mullins-platform-support.patch b/target/linux/x86/patches-4.4/097-0001-sp5100_tco-Add-AMD-Mullins-platform-support.patch new file mode 100644 index 0000000000..70169abbe4 --- /dev/null +++ b/target/linux/x86/patches-4.4/097-0001-sp5100_tco-Add-AMD-Mullins-platform-support.patch @@ -0,0 +1,26 @@ +From 190aa4304de6fe2185d96392ddf56580fa133e99 Mon Sep 17 00:00:00 2001 +From: Denis Turischev +Date: Tue, 24 Nov 2015 10:46:12 +0200 +Subject: [PATCH] sp5100_tco: Add AMD Mullins platform support + +AMD Mullins watchdog is fully compatible to the previous Hudson chipset, +reuse the existent sp5100_tco driver. + +Signed-off-by: Denis Turischev +Signed-off-by: Guenter Roeck +Signed-off-by: Wim Van Sebroeck +--- + drivers/watchdog/sp5100_tco.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/watchdog/sp5100_tco.c ++++ b/drivers/watchdog/sp5100_tco.c +@@ -306,6 +306,8 @@ static struct miscdevice sp5100_tco_misc + static const struct pci_device_id sp5100_tco_pci_tbl[] = { + { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, PCI_ANY_ID, + PCI_ANY_ID, }, ++ { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, PCI_ANY_ID, ++ PCI_ANY_ID, }, + { 0, }, /* End of list */ + }; + MODULE_DEVICE_TABLE(pci, sp5100_tco_pci_tbl); diff --git a/target/linux/x86/patches-4.4/097-0002-sp5100_tco-Add-AMD-Carrizo-platform-support.patch b/target/linux/x86/patches-4.4/097-0002-sp5100_tco-Add-AMD-Carrizo-platform-support.patch new file mode 100644 index 0000000000..33862a25d0 --- /dev/null +++ b/target/linux/x86/patches-4.4/097-0002-sp5100_tco-Add-AMD-Carrizo-platform-support.patch @@ -0,0 +1,27 @@ +From cca118fa2a0a94e0f0b3c8dd1dda922cdee45089 Mon Sep 17 00:00:00 2001 +From: Huang Rui +Date: Mon, 23 Nov 2015 18:07:36 +0800 +Subject: [PATCH] sp5100_tco: Add AMD Carrizo platform support + +sp5100_tco watchdog is also supported on AMD KernCZ chipset of Carrizo +platform. + +Signed-off-by: Huang Rui +Cc: Denis Turischev +Signed-off-by: Guenter Roeck +Signed-off-by: Wim Van Sebroeck +--- + drivers/watchdog/sp5100_tco.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/watchdog/sp5100_tco.c ++++ b/drivers/watchdog/sp5100_tco.c +@@ -308,6 +308,8 @@ static const struct pci_device_id sp5100 + PCI_ANY_ID, }, + { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, PCI_ANY_ID, + PCI_ANY_ID, }, ++ { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_KERNCZ_SMBUS, PCI_ANY_ID, ++ PCI_ANY_ID, }, + { 0, }, /* End of list */ + }; + MODULE_DEVICE_TABLE(pci, sp5100_tco_pci_tbl); diff --git a/target/linux/x86/patches-4.4/097-0003-sp5100_tco-fix-the-device-check-for-SB800-and-later-chipsets.patch b/target/linux/x86/patches-4.4/097-0003-sp5100_tco-fix-the-device-check-for-SB800-and-later-chipsets.patch new file mode 100644 index 0000000000..8f16fa9906 --- /dev/null +++ b/target/linux/x86/patches-4.4/097-0003-sp5100_tco-fix-the-device-check-for-SB800-and-later-chipsets.patch @@ -0,0 +1,76 @@ +From bdecfcdb5461834aab24002bb18d3cbdd907b7fb Mon Sep 17 00:00:00 2001 +From: Huang Rui +Date: Mon, 23 Nov 2015 18:07:35 +0800 +Subject: [PATCH] sp5100_tco: fix the device check for SB800 and later chipsets + +For SB800 and later chipsets, the register definitions are the same +with SB800. And for SB700 and older chipsets, the definitions should +be same with SP5100/SB7x0. + +Signed-off-by: Huang Rui +Cc: Denis Turischev +Signed-off-by: Guenter Roeck +Signed-off-by: Wim Van Sebroeck +--- + drivers/watchdog/sp5100_tco.c | 28 ++++++++++++++++------------ + 1 file changed, 16 insertions(+), 12 deletions(-) + +--- a/drivers/watchdog/sp5100_tco.c ++++ b/drivers/watchdog/sp5100_tco.c +@@ -335,21 +335,24 @@ static unsigned char sp5100_tco_setupdev + if (!sp5100_tco_pci) + return 0; + +- pr_info("PCI Revision ID: 0x%x\n", sp5100_tco_pci->revision); ++ pr_info("PCI Vendor ID: 0x%x, Device ID: 0x%x, Revision ID: 0x%x\n", ++ sp5100_tco_pci->vendor, sp5100_tco_pci->device, ++ sp5100_tco_pci->revision); + + /* + * Determine type of southbridge chipset. + */ +- if (sp5100_tco_pci->revision >= 0x40) { +- dev_name = SB800_DEVNAME; +- index_reg = SB800_IO_PM_INDEX_REG; +- data_reg = SB800_IO_PM_DATA_REG; +- base_addr = SB800_PM_WATCHDOG_BASE; +- } else { ++ if (sp5100_tco_pci->device == PCI_DEVICE_ID_ATI_SBX00_SMBUS && ++ sp5100_tco_pci->revision < 0x40) { + dev_name = SP5100_DEVNAME; + index_reg = SP5100_IO_PM_INDEX_REG; + data_reg = SP5100_IO_PM_DATA_REG; + base_addr = SP5100_PM_WATCHDOG_BASE; ++ } else { ++ dev_name = SB800_DEVNAME; ++ index_reg = SB800_IO_PM_INDEX_REG; ++ data_reg = SB800_IO_PM_DATA_REG; ++ base_addr = SB800_PM_WATCHDOG_BASE; + } + + /* Request the IO ports used by this driver */ +@@ -385,7 +388,12 @@ static unsigned char sp5100_tco_setupdev + * Secondly, Find the watchdog timer MMIO address + * from SBResource_MMIO register. + */ +- if (sp5100_tco_pci->revision >= 0x40) { ++ if (sp5100_tco_pci->device == PCI_DEVICE_ID_ATI_SBX00_SMBUS && ++ sp5100_tco_pci->revision < 0x40) { ++ /* Read SBResource_MMIO from PCI config(PCI_Reg: 9Ch) */ ++ pci_read_config_dword(sp5100_tco_pci, ++ SP5100_SB_RESOURCE_MMIO_BASE, &val); ++ } else { + /* Read SBResource_MMIO from AcpiMmioEn(PM_Reg: 24h) */ + outb(SB800_PM_ACPI_MMIO_EN+3, SB800_IO_PM_INDEX_REG); + val = inb(SB800_IO_PM_DATA_REG); +@@ -395,10 +403,6 @@ static unsigned char sp5100_tco_setupdev + val = val << 8 | inb(SB800_IO_PM_DATA_REG); + outb(SB800_PM_ACPI_MMIO_EN+0, SB800_IO_PM_INDEX_REG); + val = val << 8 | inb(SB800_IO_PM_DATA_REG); +- } else { +- /* Read SBResource_MMIO from PCI config(PCI_Reg: 9Ch) */ +- pci_read_config_dword(sp5100_tco_pci, +- SP5100_SB_RESOURCE_MMIO_BASE, &val); + } + + /* The SBResource_MMIO is enabled and mapped memory space? */ diff --git a/target/linux/x86/patches-4.4/097-0004-watchdog-sp5100_tco-properly-check-for-new-register-.patch b/target/linux/x86/patches-4.4/097-0004-watchdog-sp5100_tco-properly-check-for-new-register-.patch new file mode 100644 index 0000000000..103aa4853d --- /dev/null +++ b/target/linux/x86/patches-4.4/097-0004-watchdog-sp5100_tco-properly-check-for-new-register-.patch @@ -0,0 +1,72 @@ +From 46856fabe40cc80f92134683cdec7dc0fc8f4000 Mon Sep 17 00:00:00 2001 +From: Lucas Stach +Date: Tue, 3 May 2016 19:15:58 +0200 +Subject: [PATCH] watchdog: sp5100_tco: properly check for new register layouts + +Commits 190aa4304de6 (Add AMD Mullins platform support) and +cca118fa2a0a94 (Add AMD Carrizo platform support) enabled the +driver on a lot more devices, but the following commit missed +a single location in the code when checking if the SB800 register +offsets should be used. This leads to the wrong register being +written which in turn causes ACPI to go haywire. + +Fix this by introducing a helper function to check for the new +register layout and use this consistently. + +https://bugzilla.kernel.org/show_bug.cgi?id=114201 +https://bugzilla.redhat.com/show_bug.cgi?id=1329910 +Fixes: bdecfcdb5461 (sp5100_tco: fix the device check for SB800 +and later chipsets) +Cc: stable@vger.kernel.org (4.5+) +Signed-off-by: Lucas Stach +Signed-off-by: Guenter Roeck +Signed-off-by: Wim Van Sebroeck +--- + drivers/watchdog/sp5100_tco.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +--- a/drivers/watchdog/sp5100_tco.c ++++ b/drivers/watchdog/sp5100_tco.c +@@ -73,6 +73,13 @@ MODULE_PARM_DESC(nowayout, "Watchdog can + /* + * Some TCO specific functions + */ ++ ++static bool tco_has_sp5100_reg_layout(struct pci_dev *dev) ++{ ++ return dev->device == PCI_DEVICE_ID_ATI_SBX00_SMBUS && ++ dev->revision < 0x40; ++} ++ + static void tco_timer_start(void) + { + u32 val; +@@ -129,7 +136,7 @@ static void tco_timer_enable(void) + { + int val; + +- if (sp5100_tco_pci->revision >= 0x40) { ++ if (!tco_has_sp5100_reg_layout(sp5100_tco_pci)) { + /* For SB800 or later */ + /* Set the Watchdog timer resolution to 1 sec */ + outb(SB800_PM_WATCHDOG_CONFIG, SB800_IO_PM_INDEX_REG); +@@ -342,8 +349,7 @@ static unsigned char sp5100_tco_setupdev + /* + * Determine type of southbridge chipset. + */ +- if (sp5100_tco_pci->device == PCI_DEVICE_ID_ATI_SBX00_SMBUS && +- sp5100_tco_pci->revision < 0x40) { ++ if (tco_has_sp5100_reg_layout(sp5100_tco_pci)) { + dev_name = SP5100_DEVNAME; + index_reg = SP5100_IO_PM_INDEX_REG; + data_reg = SP5100_IO_PM_DATA_REG; +@@ -388,8 +394,7 @@ static unsigned char sp5100_tco_setupdev + * Secondly, Find the watchdog timer MMIO address + * from SBResource_MMIO register. + */ +- if (sp5100_tco_pci->device == PCI_DEVICE_ID_ATI_SBX00_SMBUS && +- sp5100_tco_pci->revision < 0x40) { ++ if (tco_has_sp5100_reg_layout(sp5100_tco_pci)) { + /* Read SBResource_MMIO from PCI config(PCI_Reg: 9Ch) */ + pci_read_config_dword(sp5100_tco_pci, + SP5100_SB_RESOURCE_MMIO_BASE, &val); diff --git a/target/linux/x86/xen_domu/base-files/lib/preinit/45_mount_xenfs b/target/linux/x86/xen_domu/base-files/lib/preinit/45_mount_xenfs deleted file mode 100644 index 7b0760516e..0000000000 --- a/target/linux/x86/xen_domu/base-files/lib/preinit/45_mount_xenfs +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Copyright (C) 2010 OpenWrt.org - -do_mount_xenfs() { - [ -f /etc/modules.d/??-xenfs ] && { - insmod $(cat /etc/modules.d/??-xenfs) - mount -o noatime none /proc/xen -t xenfs - } -} - -boot_hook_add preinit_mount_root do_mount_xenfs diff --git a/target/linux/x86/xen_domu/config-default b/target/linux/x86/xen_domu/config-default deleted file mode 100644 index aeb1e2a635..0000000000 --- a/target/linux/x86/xen_domu/config-default +++ /dev/null @@ -1,100 +0,0 @@ -# CONFIG_APM is not set -CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y -CONFIG_ARCH_PHYS_ADDR_T_64BIT=y -CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y -# CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set -CONFIG_CPU_RMAP=y -# CONFIG_DEBUG_HOTPLUG_CPU0 is not set -CONFIG_FB=y -CONFIG_FB_CMDLINE=y -CONFIG_FB_DEFERRED_IO=y -CONFIG_FB_SYS_COPYAREA=y -CONFIG_FB_SYS_FILLRECT=y -CONFIG_FB_SYS_FOPS=y -CONFIG_FB_SYS_IMAGEBLIT=y -# CONFIG_FB_VESA is not set -CONFIG_FREEZER=y -CONFIG_GENERIC_PENDING_IRQ=y -CONFIG_HAVE_ARCH_HUGE_VMAP=y -CONFIG_HIBERNATE_CALLBACKS=y -# CONFIG_HIGHMEM64G is not set -CONFIG_HOTPLUG_CPU=y -CONFIG_HVC_DRIVER=y -CONFIG_HVC_IRQ=y -CONFIG_HVC_XEN=y -CONFIG_HVC_XEN_FRONTEND=y -CONFIG_HYPERVISOR_GUEST=y -CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y -CONFIG_IOMMU_HELPER=y -CONFIG_KERNEL_GZIP=y -# CONFIG_KERNEL_XZ is not set -# CONFIG_LGUEST_GUEST is not set -CONFIG_LOCK_SPIN_ON_OWNER=y -# CONFIG_M486 is not set -CONFIG_MMU_NOTIFIER=y -CONFIG_MPENTIUM4=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NET_FLOW_LIMIT=y -CONFIG_NR_CPUS=4 -CONFIG_PARAVIRT=y -CONFIG_PARAVIRT_CLOCK=y -# CONFIG_PARAVIRT_DEBUG is not set -CONFIG_PARAVIRT_SPINLOCKS=y -# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set -CONFIG_PCI_XEN=y -CONFIG_PGTABLE_LEVELS=3 -CONFIG_PHYS_ADDR_T_64BIT=y -CONFIG_PM=y -# CONFIG_PM_DEBUG is not set -CONFIG_PM_SLEEP=y -CONFIG_PM_SLEEP_SMP=y -CONFIG_QUEUED_RWLOCKS=y -CONFIG_QUEUED_SPINLOCKS=y -CONFIG_RCU_STALL_COMMON=y -CONFIG_RFS_ACCEL=y -CONFIG_RPS=y -CONFIG_RWSEM_SPIN_ON_OWNER=y -CONFIG_SCHED_MC=y -CONFIG_SMP=y -CONFIG_SWIOTLB=y -CONFIG_SWIOTLB_XEN=y -CONFIG_SYS_HYPERVISOR=y -CONFIG_TREE_RCU=y -CONFIG_VT_CONSOLE_SLEEP=y -CONFIG_X86_32_SMP=y -# CONFIG_X86_BIGSMP is not set -CONFIG_X86_CMOV=y -CONFIG_X86_CMPXCHG64=y -CONFIG_X86_DEBUGCTLMSR=y -CONFIG_X86_INTERNODE_CACHE_SHIFT=7 -CONFIG_X86_L1_CACHE_SHIFT=7 -CONFIG_X86_MINIMUM_CPU_FAMILY=5 -CONFIG_X86_PAE=y -# CONFIG_X86_PMEM_LEGACY is not set -CONFIG_X86_TSC=y -CONFIG_X86_USE_PPRO_CHECKSUM=y -CONFIG_XEN=y -CONFIG_XENFS=y -CONFIG_XEN_AUTO_XLATE=y -CONFIG_XEN_BALLOON=y -CONFIG_XEN_BLKDEV_FRONTEND=y -CONFIG_XEN_COMPAT_XENFS=y -CONFIG_XEN_DEBUG_FS=y -CONFIG_XEN_DEV_EVTCHN=y -CONFIG_XEN_FBDEV_FRONTEND=y -CONFIG_XEN_GNTDEV=y -CONFIG_XEN_GRANT_DEV_ALLOC=y -CONFIG_XEN_HAVE_PVMMU=y -CONFIG_XEN_HAVE_VPMU=y -CONFIG_XEN_NETDEV_FRONTEND=y -CONFIG_XEN_PCIDEV_FRONTEND=y -CONFIG_XEN_PRIVCMD=y -CONFIG_XEN_PVHVM=y -CONFIG_XEN_SAVE_RESTORE=y -CONFIG_XEN_SCRUB_PAGES=y -CONFIG_XEN_SCSI_FRONTEND=y -CONFIG_XEN_SYS_HYPERVISOR=y -# CONFIG_XEN_WDT is not set -CONFIG_XEN_XENBUS_FRONTEND=y -CONFIG_XPS=y diff --git a/target/linux/x86/xen_domu/profiles/000-Generic.mk b/target/linux/x86/xen_domu/profiles/000-Generic.mk deleted file mode 100644 index ccd125afa2..0000000000 --- a/target/linux/x86/xen_domu/profiles/000-Generic.mk +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright (C) 2006-2015 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define Profile/Generic - NAME:=Generic -endef - -define Profile/Generic/Description - Generic Profile -endef -$(eval $(call Profile,Generic)) diff --git a/target/linux/x86/xen_domu/target.mk b/target/linux/x86/xen_domu/target.mk deleted file mode 100644 index 991fe59e8b..0000000000 --- a/target/linux/x86/xen_domu/target.mk +++ /dev/null @@ -1,3 +0,0 @@ -BOARDNAME:=Xen Paravirt Guest -FEATURES:=display ext4 targz -CPU_TYPE := pentium4 diff --git a/target/linux/xburst/Makefile b/target/linux/xburst/Makefile index 2a64b7c46f..16d0b8b1b4 100644 --- a/target/linux/xburst/Makefile +++ b/target/linux/xburst/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk ARCH:=mipsel BOARD:=xburst BOARDNAME:=Ingenic XBurst -FEATURES:=targz nand ubifs audio +FEATURES:=targz nand ubifs audio source-only SUBTARGETS:=qi_lb60 KERNEL_PATCHVER:=3.18 diff --git a/target/linux/xburst/image/Makefile b/target/linux/xburst/image/Makefile index 0853607506..ff25fbebcc 100644 --- a/target/linux/xburst/image/Makefile +++ b/target/linux/xburst/image/Makefile @@ -20,15 +20,10 @@ endif UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage.bin -define kernel_entry -0x$(shell $(TARGET_CROSS)nm $(1) 2>/dev/null | grep " kernel_entry" | cut -f1 -d ' ') -endef - - define MkImageGzip gzip -9n -c $(1) > $(1).gz mkimage -A mips -O linux -T kernel -a 0x80010000 -C gzip \ - -e $(call kernel_entry,$(KDIR)/vmlinux.debug) -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \ + -e 0x80010000 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \ -d $(1).gz $(2) endef diff --git a/target/sdk/Config.in b/target/sdk/Config.in index 37d2ca0ede..2a5fddd2e5 100644 --- a/target/sdk/Config.in +++ b/target/sdk/Config.in @@ -1,6 +1,7 @@ config SDK bool "Build the libreCMC SDK" depends on !EXTERNAL_TOOLCHAIN + default BUILDBOT help This is essentially a stripped-down version of the buildroot with a precompiled toolchain. It can be used to develop and diff --git a/target/sdk/Makefile b/target/sdk/Makefile index c1eca736b0..54a14d352b 100644 --- a/target/sdk/Makefile +++ b/target/sdk/Makefile @@ -17,6 +17,7 @@ SDK_NAME:=$(VERSION_DIST_SANITIZED)-sdk-$(if $(CONFIG_VERSION_FILENAMES),$(VERSI SDK_BUILD_DIR:=$(BUILD_DIR)/$(SDK_NAME) STAGING_SUBDIR_HOST := staging_dir/host +STAGING_SUBDIR_TARGET := staging_dir/$(TARGET_DIR_NAME) STAGING_SUBDIR_TOOLCHAIN := staging_dir/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)_$(LIBC)-$(LIBCV)$(if $(CONFIG_arm),_eabi) EXCLUDE_DIRS:=*/ccache/* \ @@ -29,16 +30,22 @@ EXCLUDE_DIRS:=*/ccache/* \ *.install.clean \ *.install.flags \ *.install \ - */doc + */doc \ + */share/locale SDK_DIRS = \ $(STAGING_SUBDIR_HOST) \ $(STAGING_SUBDIR_TOOLCHAIN) -BASE_FEED:=$(shell git config --get remote.origin.url 2>/dev/null | sed -ne 's/^/src-git base /p') +GIT_URL:=$(filter git://% http://% https://%,$(shell git config --get remote.origin.url 2>/dev/null)) +GIT_COMMIT:=$(shell git rev-parse HEAD 2>/dev/null) +GIT_BRANCH:=$(filter-out master HEAD,$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)) +GIT_TAGNAME:=$(shell git show-ref --tags --dereference 2>/dev/null | sed -ne '/^$(GIT_COMMIT) / { s|^.*/||; s|\^.*||; p }') + +BASE_FEED:=$(if $(GIT_URL),src-git base $(GIT_URL)$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME)))) BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C git svn info 2>/dev/null | sed -ne 's/^URL: /src-gitsvn base /p')) BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C svn info 2>/dev/null | sed -ne 's/^URL: /src-svn base /p')) -BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git base https://git.lede-project.org/source.git$(filter-out ;master,;$(shell git rev-parse --abbrev-ref HEAD))) +BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git base https://git.lede-project.org/source.git$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME)))) KDIR_BASE = $(patsubst $(TOPDIR)/%,%,$(LINUX_DIR)) @@ -91,7 +98,7 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean find \ $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/lib \ $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/usr/lib \ - -type f -name \*.so\* -or -name \*.a; \ + -type f -name \*.so\*; \ ) | xargs strip 2>/dev/null >/dev/null mkdir -p $(SDK_BUILD_DIR)/target/linux @@ -114,6 +121,11 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean $(TOPDIR)/package/kernel/linux \ $(SDK_BUILD_DIR)/package/ + -rm -rf \ + $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/ccache \ + $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_TARGET)/ccache \ + $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_TOOLCHAIN)/ccache + -rm -f $(SDK_BUILD_DIR)/feeds.conf.default $(if $(BASE_FEED),echo "$(BASE_FEED)" > $(SDK_BUILD_DIR)/feeds.conf.default) if [ -f $(TOPDIR)/feeds.conf ]; then \ @@ -127,6 +139,7 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean find $(SDK_BUILD_DIR) -name .git | $(XARGS) rm -rf find $(SDK_BUILD_DIR) -name .svn | $(XARGS) rm -rf find $(SDK_BUILD_DIR) -name CVS | $(XARGS) rm -rf + -make -C $(SDK_BUILD_DIR)/scripts/config clean (cd $(BUILD_DIR); \ tar -I 'xz -7e' -cf $@ $(SDK_NAME); \ ) diff --git a/target/sdk/files/README.SDK b/target/sdk/files/README.SDK index 13e222fc5c..6f04f94d2c 100644 --- a/target/sdk/files/README.SDK +++ b/target/sdk/files/README.SDK @@ -1,7 +1,7 @@ -This is the libreCMC SDK. It contains a stripped-down version of +This is the LEDE SDK. It contains a stripped-down version of the buildroot. You can use it to test/develop packages without having to compile your own toolchain or any of the libraries -included with libreCMC. +included with LEDE. To use it, just put your buildroot-compatible package directory (including its dependencies) in the subdir 'package/' and run diff --git a/toolchain/musl/Config.version b/toolchain/musl/Config.version index 537f3d834b..2b4b367d97 100644 --- a/toolchain/musl/Config.version +++ b/toolchain/musl/Config.version @@ -3,6 +3,6 @@ if USE_MUSL config MUSL_VERSION string depends on USE_MUSL - default "1.1.15" + default "1.1.16" endif diff --git a/toolchain/musl/common.mk b/toolchain/musl/common.mk index 9f3f7add4d..bfe8eebc7b 100644 --- a/toolchain/musl/common.mk +++ b/toolchain/musl/common.mk @@ -11,10 +11,13 @@ PKG_NAME:=musl PKG_VERSION:=$(call qstrip,$(CONFIG_MUSL_VERSION)) PKG_RELEASE=1 -PKG_HASH:=97e447c7ee2a7f613186ec54a93054fe15469fe34d7d323080f7ef38f5ecb0fa +PKG_SOURCE_PROTO:=git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=769f53598e781ffc89191520f3f8a93cb58db91f +PKG_MIRROR_HASH:=c148c570cc46471ab30a1b36e96531519837e41c4347f3164bf610ab98741d80 +PKG_SOURCE_URL:=git://git.musl-libc.org/musl +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz -PKG_SOURCE_URL:=http://www.musl-libc.org/releases -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz LIBC_SO_VERSION:=$(PKG_VERSION) PATCH_DIR:=$(PATH_PREFIX)/patches diff --git a/toolchain/musl/patches/005-fix-asctime-day-month-names-not-to-vary-by-locale.patch b/toolchain/musl/patches/005-fix-asctime-day-month-names-not-to-vary-by-locale.patch deleted file mode 100644 index c0e0238171..0000000000 --- a/toolchain/musl/patches/005-fix-asctime-day-month-names-not-to-vary-by-locale.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 6399fa9d29ea83de4735680b77d457bd59606532 Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Thu, 7 Jul 2016 16:51:37 -0400 -Subject: fix asctime day/month names not to vary by locale - -the FIXME comment here was overlooked at the time locale support was -added. ---- - src/time/__asctime.c | 9 ++++----- - 1 file changed, 4 insertions(+), 5 deletions(-) - -diff --git a/src/time/__asctime.c b/src/time/__asctime.c -index e7e7f07..f114dfe 100644 ---- a/src/time/__asctime.c -+++ b/src/time/__asctime.c -@@ -1,17 +1,16 @@ - #include - #include - #include -+#include "locale_impl.h" - #include "atomic.h" - --const char *__nl_langinfo(nl_item); -+const char *__nl_langinfo_l(nl_item, locale_t); - - char *__asctime(const struct tm *restrict tm, char *restrict buf) - { -- /* FIXME: change __nl_langinfo to __nl_langinfo_l with explicit C -- * locale once we have locales */ - if (snprintf(buf, 26, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n", -- __nl_langinfo(ABDAY_1+tm->tm_wday), -- __nl_langinfo(ABMON_1+tm->tm_mon), -+ __nl_langinfo_l(ABDAY_1+tm->tm_wday, C_LOCALE), -+ __nl_langinfo_l(ABMON_1+tm->tm_mon, C_LOCALE), - tm->tm_mday, tm->tm_hour, - tm->tm_min, tm->tm_sec, - 1900 + tm->tm_year) >= 26) --- -cgit v0.11.2 - - diff --git a/toolchain/musl/patches/010-fix-regression-in-tcsetattr-on-all-mips-archs.patch b/toolchain/musl/patches/010-fix-regression-in-tcsetattr-on-all-mips-archs.patch deleted file mode 100644 index f3def26b2a..0000000000 --- a/toolchain/musl/patches/010-fix-regression-in-tcsetattr-on-all-mips-archs.patch +++ /dev/null @@ -1,67 +0,0 @@ -From cff5747c74c41b22f1ce1340978b1c226a8cdf32 Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Wed, 13 Jul 2016 15:04:30 -0400 -Subject: [PATCH] fix regression in tcsetattr on all mips archs - -revert commit 8c316e9e49d37ad92c2e7493e16166a2afca419f. it was wrong -and does not match how the kernel API works. ---- - arch/mips/bits/termios.h | 6 +++--- - arch/mips64/bits/termios.h | 6 +++--- - arch/mipsn32/bits/termios.h | 6 +++--- - 4 files changed, 10 insertions(+), 10 deletions(-) - -diff --git a/arch/mips/bits/termios.h b/arch/mips/bits/termios.h -index f559f76..6a1205d 100644 ---- a/arch/mips/bits/termios.h -+++ b/arch/mips/bits/termios.h -@@ -141,9 +141,9 @@ struct termios { - #define TCOFLUSH 1 - #define TCIOFLUSH 2 - --#define TCSANOW 0x540e --#define TCSADRAIN 0x540f --#define TCSAFLUSH 0x5410 -+#define TCSANOW 0 -+#define TCSADRAIN 1 -+#define TCSAFLUSH 2 - - #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) - #define EXTA 0000016 -diff --git a/arch/mips64/bits/termios.h b/arch/mips64/bits/termios.h -index f559f76..6a1205d 100644 ---- a/arch/mips64/bits/termios.h -+++ b/arch/mips64/bits/termios.h -@@ -141,9 +141,9 @@ struct termios { - #define TCOFLUSH 1 - #define TCIOFLUSH 2 - --#define TCSANOW 0x540e --#define TCSADRAIN 0x540f --#define TCSAFLUSH 0x5410 -+#define TCSANOW 0 -+#define TCSADRAIN 1 -+#define TCSAFLUSH 2 - - #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) - #define EXTA 0000016 -diff --git a/arch/mipsn32/bits/termios.h b/arch/mipsn32/bits/termios.h -index f559f76..6a1205d 100644 ---- a/arch/mipsn32/bits/termios.h -+++ b/arch/mipsn32/bits/termios.h -@@ -141,9 +141,9 @@ struct termios { - #define TCOFLUSH 1 - #define TCIOFLUSH 2 - --#define TCSANOW 0x540e --#define TCSADRAIN 0x540f --#define TCSAFLUSH 0x5410 -+#define TCSANOW 0 -+#define TCSADRAIN 1 -+#define TCSAFLUSH 2 - - #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) - #define EXTA 0000016 --- -2.8.1 - diff --git a/toolchain/musl/patches/015-fix-pread-pwrite-syscall-calling-convention-on-sh.patch b/toolchain/musl/patches/015-fix-pread-pwrite-syscall-calling-convention-on-sh.patch deleted file mode 100644 index b4b20d8ae2..0000000000 --- a/toolchain/musl/patches/015-fix-pread-pwrite-syscall-calling-convention-on-sh.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 7cc3a28eed7e3b72a1ce4568fb55154bb0540726 Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Thu, 11 Aug 2016 18:36:46 -0400 -Subject: fix pread/pwrite syscall calling convention on sh - -despite sh not generally using register-pair alignment for 64-bit -syscall arguments, there are arch-specific versions of the syscall -entry points for pread and pwrite which include a dummy argument for -alignment before the 64-bit offset argument. ---- - arch/sh/syscall_arch.h | 1 + - src/internal/syscall.h | 4 ++++ - src/unistd/pread.c | 2 +- - src/unistd/pwrite.c | 2 +- - 4 files changed, 7 insertions(+), 2 deletions(-) - -diff --git a/arch/sh/syscall_arch.h b/arch/sh/syscall_arch.h -index f63675a..84758fe 100644 ---- a/arch/sh/syscall_arch.h -+++ b/arch/sh/syscall_arch.h -@@ -2,6 +2,7 @@ - ((union { long long ll; long l[2]; }){ .ll = x }).l[0], \ - ((union { long long ll; long l[2]; }){ .ll = x }).l[1] - #define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x)) -+#define __SYSCALL_LL_PRW(x) 0, __SYSCALL_LL_E((x)) - - /* The extra OR instructions are to work around a hardware bug: - * http://documentation.renesas.com/doc/products/mpumcu/tu/tnsh7456ae.pdf -diff --git a/src/internal/syscall.h b/src/internal/syscall.h -index ff3cf53..6d378a8 100644 ---- a/src/internal/syscall.h -+++ b/src/internal/syscall.h -@@ -12,6 +12,10 @@ - #define SYSCALL_MMAP2_UNIT 4096ULL - #endif - -+#ifndef __SYSCALL_LL_PRW -+#define __SYSCALL_LL_PRW(x) __SYSCALL_LL_O(x) -+#endif -+ - #ifndef __scc - #define __scc(X) ((long) (X)) - typedef long syscall_arg_t; -diff --git a/src/unistd/pread.c b/src/unistd/pread.c -index 3d2799f..5483eb9 100644 ---- a/src/unistd/pread.c -+++ b/src/unistd/pread.c -@@ -4,7 +4,7 @@ - - ssize_t pread(int fd, void *buf, size_t size, off_t ofs) - { -- return syscall_cp(SYS_pread, fd, buf, size, __SYSCALL_LL_O(ofs)); -+ return syscall_cp(SYS_pread, fd, buf, size, __SYSCALL_LL_PRW(ofs)); - } - - LFS64(pread); -diff --git a/src/unistd/pwrite.c b/src/unistd/pwrite.c -index bbe4c34..4bf3d7d 100644 ---- a/src/unistd/pwrite.c -+++ b/src/unistd/pwrite.c -@@ -4,7 +4,7 @@ - - ssize_t pwrite(int fd, const void *buf, size_t size, off_t ofs) - { -- return syscall_cp(SYS_pwrite, fd, buf, size, __SYSCALL_LL_O(ofs)); -+ return syscall_cp(SYS_pwrite, fd, buf, size, __SYSCALL_LL_PRW(ofs)); - } - - LFS64(pwrite); --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/020-verify-that-ttyname-refers-to-the-same-file-as-the-fd.patch b/toolchain/musl/patches/020-verify-that-ttyname-refers-to-the-same-file-as-the-fd.patch deleted file mode 100644 index d9cd0b397b..0000000000 --- a/toolchain/musl/patches/020-verify-that-ttyname-refers-to-the-same-file-as-the-fd.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 0a950dcf15bb9f7274c804dca490e9e20e475f3e Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy -Date: Sat, 20 Aug 2016 21:04:31 +0200 -Subject: verify that ttyname refers to the same file as the fd - -linux containers use separate mount namespace so the /proc -symlink might not point to the right device if the fd was -opened in the parent namespace, in this case return ENOENT. ---- - src/unistd/ttyname_r.c | 15 +++++++++++---- - 1 file changed, 11 insertions(+), 4 deletions(-) - -diff --git a/src/unistd/ttyname_r.c b/src/unistd/ttyname_r.c -index 8bac7b2..a38ba4f 100644 ---- a/src/unistd/ttyname_r.c -+++ b/src/unistd/ttyname_r.c -@@ -1,10 +1,12 @@ - #include - #include -+#include - - void __procfdname(char *, unsigned); - - int ttyname_r(int fd, char *name, size_t size) - { -+ struct stat st1, st2; - char procname[sizeof "/proc/self/fd/" + 3*sizeof(int) + 2]; - ssize_t l; - -@@ -15,8 +17,13 @@ int ttyname_r(int fd, char *name, size_t size) - - if (l < 0) return errno; - else if (l == size) return ERANGE; -- else { -- name[l] = 0; -- return 0; -- } -+ -+ name[l] = 0; -+ -+ if (stat(name, &st1) || fstat(fd, &st2)) -+ return errno; -+ if (st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) -+ return ENOENT; -+ -+ return 0; - } --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/025-fix-ffsync-by-changing-it-to-osync.patch b/toolchain/musl/patches/025-fix-ffsync-by-changing-it-to-osync.patch deleted file mode 100644 index fc7334d512..0000000000 --- a/toolchain/musl/patches/025-fix-ffsync-by-changing-it-to-osync.patch +++ /dev/null @@ -1,25 +0,0 @@ -From c1f4ed150137d793c9d07356305a89e8785e7e02 Mon Sep 17 00:00:00 2001 -From: Duncan Overbruck -Date: Thu, 18 Aug 2016 17:06:16 +0200 -Subject: fix FFSYNC by changing it to O_SYNC - -O_FSYNC was never defined and is legacy/wrong, nothing seems to use it. ---- - include/fcntl.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/include/fcntl.h b/include/fcntl.h -index e683e4d..0e165ca 100644 ---- a/include/fcntl.h -+++ b/include/fcntl.h -@@ -99,7 +99,7 @@ int posix_fallocate(int, off_t, off_t); - #define AT_EMPTY_PATH 0x1000 - - #define FAPPEND O_APPEND --#define FFSYNC O_FSYNC -+#define FFSYNC O_SYNC - #define FASYNC O_ASYNC - #define FNONBLOCK O_NONBLOCK - #define FNDELAY O_NDELAY --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/028-fix-printf-regression-with-alt-form-octal-zero-flag-and-field-width.patch b/toolchain/musl/patches/028-fix-printf-regression-with-alt-form-octal-zero-flag-and-field-width.patch deleted file mode 100644 index aa0c2cfdd6..0000000000 --- a/toolchain/musl/patches/028-fix-printf-regression-with-alt-form-octal-zero-flag-and-field-width.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 78897b0dc00b7cd5c29af5e0b7eebf2396d8dce0 Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Fri, 16 Sep 2016 17:40:08 -0400 -Subject: fix printf regression with alt-form octal, zero flag, and field width - -commit b91cdbe2bc8b626aa04dc6e3e84345accf34e4b1, in fixing another -issue, changed the logic for how alt-form octal adds the leading zero -to adjust the precision rather than using a prefix character. this -wrongly suppressed the zero flag by mimicing an explicit precision -given by the format string. switch back to using a prefix character. - -based on bug report and patch by Dmitry V. Levin, but simplified. ---- - src/stdio/vfprintf.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c -index 2ecf769..e439a07 100644 ---- a/src/stdio/vfprintf.c -+++ b/src/stdio/vfprintf.c -@@ -570,7 +570,7 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, - if (0) { - case 'o': - a = fmt_o(arg.i, z); -- if ((fl&ALT_FORM) && p -Date: Fri, 16 Sep 2016 13:34:24 -0400 -Subject: fix ifru_data and ifcu_buf types in net/if.h - -glibc, freebsd, and openbsd use character pointers (caddr_t) for -these fields. only linux uses void pointer for the ifru_data type. ---- - include/net/if.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/include/net/if.h b/include/net/if.h -index 1a4059d..2f2fcc1 100644 ---- a/include/net/if.h -+++ b/include/net/if.h -@@ -89,7 +89,7 @@ struct ifreq { - struct ifmap ifru_map; - char ifru_slave[IFNAMSIZ]; - char ifru_newname[IFNAMSIZ]; -- void *ifru_data; -+ char *ifru_data; - } ifr_ifru; - }; - -@@ -116,7 +116,7 @@ struct ifreq { - struct ifconf { - int ifc_len; - union { -- void *ifcu_buf; -+ char *ifcu_buf; - struct ifreq *ifcu_req; - } ifc_ifcu; - }; --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/030-fix-if_indextoname-error-case.patch b/toolchain/musl/patches/030-fix-if_indextoname-error-case.patch deleted file mode 100644 index d680d4eb3f..0000000000 --- a/toolchain/musl/patches/030-fix-if_indextoname-error-case.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 32055d52ca43d867d6dbb763dc5213a8d3536a23 Mon Sep 17 00:00:00 2001 -From: Daniel Sabogal -Date: Thu, 15 Sep 2016 11:27:30 -0400 -Subject: fix if_indextoname error case - -posix requires errno to be set to ENXIO if the interface does not exist. -linux returns ENODEV instead so we handle this. ---- - src/network/if_indextoname.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/src/network/if_indextoname.c b/src/network/if_indextoname.c -index 6ee7f13..3b368bf 100644 ---- a/src/network/if_indextoname.c -+++ b/src/network/if_indextoname.c -@@ -3,6 +3,7 @@ - #include - #include - #include -+#include - #include "syscall.h" - - char *if_indextoname(unsigned index, char *name) -@@ -14,5 +15,9 @@ char *if_indextoname(unsigned index, char *name) - ifr.ifr_ifindex = index; - r = ioctl(fd, SIOCGIFNAME, &ifr); - __syscall(SYS_close, fd); -- return r < 0 ? 0 : strncpy(name, ifr.ifr_name, IF_NAMESIZE); -+ if (r < 0) { -+ if (errno == ENODEV) errno = ENXIO; -+ return 0; -+ } -+ return strncpy(name, ifr.ifr_name, IF_NAMESIZE); - } --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/031-add-missing-unlocked-and-wcsftime_l-prototypes-to-wchar-header.patch b/toolchain/musl/patches/031-add-missing-unlocked-and-wcsftime_l-prototypes-to-wchar-header.patch deleted file mode 100644 index 077afe8a68..0000000000 --- a/toolchain/musl/patches/031-add-missing-unlocked-and-wcsftime_l-prototypes-to-wchar-header.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 5505f6afae9acf37ef565c68a07ca3df7b1ae2cb Mon Sep 17 00:00:00 2001 -From: Daniel Sabogal -Date: Fri, 9 Sep 2016 21:23:17 -0400 -Subject: add missing *_unlocked and wcsftime_l prototypes to wchar.h - -these functions had been implemented, but prototypes were not made available ---- - include/wchar.h | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - -diff --git a/include/wchar.h b/include/wchar.h -index 0167dce..3e6db5f 100644 ---- a/include/wchar.h -+++ b/include/wchar.h -@@ -136,6 +136,21 @@ size_t wcsftime (wchar_t *__restrict, size_t, const wchar_t *__restrict, const s - - #undef iswdigit - -+#if defined(_GNU_SOURCE) -+wint_t fgetwc_unlocked (FILE *); -+wint_t getwc_unlocked (FILE *); -+wint_t getwchar_unlocked (void); -+wint_t fputwc_unlocked (wchar_t, FILE *); -+wint_t putwc_unlocked (wchar_t, FILE *); -+wint_t putwchar_unlocked (wchar_t); -+wchar_t *fgetws_unlocked (wchar_t *__restrict, int, FILE *__restrict); -+int fputws_unlocked (const wchar_t *__restrict, FILE *__restrict); -+#endif -+ -+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -+size_t wcsftime_l (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict, locale_t); -+#endif -+ - #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) - FILE *open_wmemstream(wchar_t **, size_t *); --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/033-fix-undefined-behavior-in-sched.h-cpu_set_t-usage.patch b/toolchain/musl/patches/033-fix-undefined-behavior-in-sched.h-cpu_set_t-usage.patch deleted file mode 100644 index c634d59e4b..0000000000 --- a/toolchain/musl/patches/033-fix-undefined-behavior-in-sched.h-cpu_set_t-usage.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 66570ec9c465e3c6c5d6dbd7dd42e45041a39288 Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Mon, 19 Sep 2016 11:15:51 -0400 -Subject: fix undefined behavior in sched.h cpu_set_t usage - -since cpu sets can be dynamically allocated and have variable size, -accessing their contents via ->__bits is not valid; performing pointer -arithmetic outside the range of the size of the declared __bits array -results in undefined beahavior. instead, only use cpu_set_t for -fixed-size cpu set objects (instantiated by the caller) and as an -abstract pointer type for dynamically allocated ones. perform all -accesses simply by casting the abstract pointer type cpuset_t * back -to unsigned long *. ---- - include/sched.h | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/include/sched.h b/include/sched.h -index af82d6c..d1cccb7 100644 ---- a/include/sched.h -+++ b/include/sched.h -@@ -82,7 +82,7 @@ int sched_getaffinity(pid_t, size_t, cpu_set_t *); - int sched_setaffinity(pid_t, size_t, const cpu_set_t *); - - #define __CPU_op_S(i, size, set, op) ( (i)/8U >= (size) ? 0 : \ -- ((set)->__bits[(i)/8/sizeof(long)] op (1UL<<((i)%(8*sizeof(long))))) ) -+ (((unsigned long *)(set))[(i)/8/sizeof(long)] op (1UL<<((i)%(8*sizeof(long))))) ) - - #define CPU_SET_S(i, size, set) __CPU_op_S(i, size, set, |=) - #define CPU_CLR_S(i, size, set) __CPU_op_S(i, size, set, &=~) -@@ -94,8 +94,8 @@ static __inline void __CPU_##func##_S(size_t __size, cpu_set_t *__dest, \ - { \ - size_t __i; \ - for (__i=0; __i<__size/sizeof(long); __i++) \ -- __dest->__bits[__i] = __src1->__bits[__i] \ -- op __src2->__bits[__i] ; \ -+ ((unsigned long *)__dest)[__i] = ((unsigned long *)__src1)[__i] \ -+ op ((unsigned long *)__src2)[__i] ; \ - } - - __CPU_op_func_S(AND, &) --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/035-fix-getservby_r-result-pointer-value-on-error.patch b/toolchain/musl/patches/035-fix-getservby_r-result-pointer-value-on-error.patch deleted file mode 100644 index 67d9c7a4d4..0000000000 --- a/toolchain/musl/patches/035-fix-getservby_r-result-pointer-value-on-error.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 8d7a3f40c8de414122eb8eb2131291782ee8ed15 Mon Sep 17 00:00:00 2001 -From: Daniel Sabogal -Date: Fri, 23 Sep 2016 21:10:07 -0400 -Subject: fix getservby*_r result pointer value on error - -this is a clone of the fix to the gethostby*_r functions in -commit fe82bb9b921be34370e6b71a1c6f062c20999ae0. the man pages -document that the getservby*_r functions set this pointer to -NULL if there was an error or if no record was found. ---- - src/network/getservbyname_r.c | 2 ++ - src/network/getservbyport_r.c | 1 + - 2 files changed, 3 insertions(+) - -diff --git a/src/network/getservbyname_r.c b/src/network/getservbyname_r.c -index 056c2f3..ad3d616 100644 ---- a/src/network/getservbyname_r.c -+++ b/src/network/getservbyname_r.c -@@ -15,6 +15,8 @@ int getservbyname_r(const char *name, const char *prots, - struct service servs[MAXSERVS]; - int cnt, proto, align; - -+ *res = 0; -+ - /* Align buffer */ - align = -(uintptr_t)buf & ALIGN-1; - if (buflen < 2*sizeof(char *)+align) -diff --git a/src/network/getservbyport_r.c b/src/network/getservbyport_r.c -index a0a7cae..0ae0e41 100644 ---- a/src/network/getservbyport_r.c -+++ b/src/network/getservbyport_r.c -@@ -20,6 +20,7 @@ int getservbyport_r(int port, const char *prots, - if (r) r = getservbyport_r(port, "udp", se, buf, buflen, res); - return r; - } -+ *res = 0; - - /* Align buffer */ - i = (uintptr_t)buf & sizeof(char *)-1; --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/036-fix-strftime-y-for-negative-tm_year.patch b/toolchain/musl/patches/036-fix-strftime-y-for-negative-tm_year.patch deleted file mode 100644 index 1f7ad5b8e1..0000000000 --- a/toolchain/musl/patches/036-fix-strftime-y-for-negative-tm_year.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 583ea83541dcc6481c7a1bd1a9b485526bad84a1 Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy -Date: Tue, 4 Oct 2016 17:14:57 +0000 -Subject: fix strftime %y for negative tm_year - ---- - src/time/strftime.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/time/strftime.c b/src/time/strftime.c -index f1ccc4d..e103e02 100644 ---- a/src/time/strftime.c -+++ b/src/time/strftime.c -@@ -167,6 +167,7 @@ const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm * - goto nl_strftime; - case 'y': - val = tm->tm_year % 100; -+ if (val<0) val += 100; - goto number; - case 'Y': - val = tm->tm_year + 1900LL; --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/037-fix-missing-integer-overflow-checks-in-regexec-buffer-size-computations.patch b/toolchain/musl/patches/037-fix-missing-integer-overflow-checks-in-regexec-buffer-size-computations.patch deleted file mode 100644 index 9d6e47572a..0000000000 --- a/toolchain/musl/patches/037-fix-missing-integer-overflow-checks-in-regexec-buffer-size-computations.patch +++ /dev/null @@ -1,72 +0,0 @@ -From c3edc06d1e1360f3570db9155d6b318ae0d0f0f7 Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Thu, 6 Oct 2016 18:34:58 -0400 -Subject: fix missing integer overflow checks in regexec buffer size - computations - -most of the possible overflows were already ruled out in practice by -regcomp having already succeeded performing larger allocations. -however at least the num_states*num_tags multiplication can clearly -overflow in practice. for safety, check them all, and use the proper -type, size_t, rather than int. - -also improve comments, use calloc in place of malloc+memset, and -remove bogus casts. ---- - src/regex/regexec.c | 23 ++++++++++++++++++----- - 1 file changed, 18 insertions(+), 5 deletions(-) - -diff --git a/src/regex/regexec.c b/src/regex/regexec.c -index 16c5d0a..dd52319 100644 ---- a/src/regex/regexec.c -+++ b/src/regex/regexec.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - - #include - -@@ -206,11 +207,24 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, - - /* Allocate memory for temporary data required for matching. This needs to - be done for every matching operation to be thread safe. This allocates -- everything in a single large block from the stack frame using alloca() -- or with malloc() if alloca is unavailable. */ -+ everything in a single large block with calloc(). */ - { -- int tbytes, rbytes, pbytes, xbytes, total_bytes; -+ size_t tbytes, rbytes, pbytes, xbytes, total_bytes; - char *tmp_buf; -+ -+ /* Ensure that tbytes and xbytes*num_states cannot overflow, and that -+ * they don't contribute more than 1/8 of SIZE_MAX to total_bytes. */ -+ if (num_tags > SIZE_MAX/(8 * sizeof(int) * tnfa->num_states)) -+ goto error_exit; -+ -+ /* Likewise check rbytes. */ -+ if (tnfa->num_states+1 > SIZE_MAX/(8 * sizeof(*reach_next))) -+ goto error_exit; -+ -+ /* Likewise check pbytes. */ -+ if (tnfa->num_states > SIZE_MAX/(8 * sizeof(*reach_pos))) -+ goto error_exit; -+ - /* Compute the length of the block we need. */ - tbytes = sizeof(*tmp_tags) * num_tags; - rbytes = sizeof(*reach_next) * (tnfa->num_states + 1); -@@ -221,10 +235,9 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, - + (rbytes + xbytes * tnfa->num_states) * 2 + tbytes + pbytes; - - /* Allocate the memory. */ -- buf = xmalloc((unsigned)total_bytes); -+ buf = calloc(total_bytes, 1); - if (buf == NULL) - return REG_ESPACE; -- memset(buf, 0, (size_t)total_bytes); - - /* Get the various pointers within tmp_buf (properly aligned). */ - tmp_tags = (void *)buf; --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/038-fix-regexec-with-haystack-strings-longer-than-int_max.patch b/toolchain/musl/patches/038-fix-regexec-with-haystack-strings-longer-than-int_max.patch deleted file mode 100644 index a936892174..0000000000 --- a/toolchain/musl/patches/038-fix-regexec-with-haystack-strings-longer-than-int_max.patch +++ /dev/null @@ -1,189 +0,0 @@ -From aee6abb2400b9a955c2b41166db1c22f63ad42ef Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Thu, 6 Oct 2016 12:15:47 -0400 -Subject: fix regexec with haystack strings longer than INT_MAX - -we inherited from TRE regexec code that's utterly wrong with respect -to the integer types it's using. while it doesn't appear that -compilers are producing unsafe output, signed integer overflows seem -to happen, and regexec fails to find matches past offset INT_MAX. - -this patch fixes the type of all variables/fields used to store -offsets in the string from int to regoff_t. after the changes, basic -testing showed that regexec can now find matches past 2GB (INT_MAX) -and past 4GB on x86_64, and code generation is unchanged on i386. ---- - src/regex/regexec.c | 54 +++++++++++++++++++++++++++-------------------------- - 1 file changed, 28 insertions(+), 26 deletions(-) - -diff --git a/src/regex/regexec.c b/src/regex/regexec.c -index dd52319..5c4cb92 100644 ---- a/src/regex/regexec.c -+++ b/src/regex/regexec.c -@@ -44,7 +44,7 @@ - - static void - tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[], int cflags, -- const tre_tnfa_t *tnfa, int *tags, int match_eo); -+ const tre_tnfa_t *tnfa, regoff_t *tags, regoff_t match_eo); - - /*********************************************************************** - from tre-match-utils.h -@@ -97,7 +97,7 @@ tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[], int cflags, - /* Returns 1 if `t1' wins `t2', 0 otherwise. */ - static int - tre_tag_order(int num_tags, tre_tag_direction_t *tag_directions, -- int *t1, int *t2) -+ regoff_t *t1, regoff_t *t2) - { - int i; - for (i = 0; i < num_tags; i++) -@@ -157,25 +157,25 @@ tre_neg_char_classes_match(tre_ctype_t *classes, tre_cint_t wc, int icase) - - typedef struct { - tre_tnfa_transition_t *state; -- int *tags; -+ regoff_t *tags; - } tre_tnfa_reach_t; - - typedef struct { -- int pos; -- int **tags; -+ regoff_t pos; -+ regoff_t **tags; - } tre_reach_pos_t; - - - static reg_errcode_t - tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, -- int *match_tags, int eflags, -- int *match_end_ofs) -+ regoff_t *match_tags, int eflags, -+ regoff_t *match_end_ofs) - { - /* State variables required by GET_NEXT_WCHAR. */ - tre_char_t prev_c = 0, next_c = 0; - const char *str_byte = string; -- int pos = -1; -- int pos_add_next = 1; -+ regoff_t pos = -1; -+ regoff_t pos_add_next = 1; - #ifdef TRE_MBSTATE - mbstate_t mbstate; - #endif /* TRE_MBSTATE */ -@@ -191,10 +191,10 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, - int *tag_i; - int num_tags, i; - -- int match_eo = -1; /* end offset of match (-1 if no match found yet) */ -+ regoff_t match_eo = -1; /* end offset of match (-1 if no match found yet) */ - int new_match = 0; -- int *tmp_tags = NULL; -- int *tmp_iptr; -+ regoff_t *tmp_tags = NULL; -+ regoff_t *tmp_iptr; - - #ifdef TRE_MBSTATE - memset(&mbstate, '\0', sizeof(mbstate)); -@@ -214,7 +214,7 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, - - /* Ensure that tbytes and xbytes*num_states cannot overflow, and that - * they don't contribute more than 1/8 of SIZE_MAX to total_bytes. */ -- if (num_tags > SIZE_MAX/(8 * sizeof(int) * tnfa->num_states)) -+ if (num_tags > SIZE_MAX/(8 * sizeof(regoff_t) * tnfa->num_states)) - goto error_exit; - - /* Likewise check rbytes. */ -@@ -229,7 +229,7 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, - tbytes = sizeof(*tmp_tags) * num_tags; - rbytes = sizeof(*reach_next) * (tnfa->num_states + 1); - pbytes = sizeof(*reach_pos) * tnfa->num_states; -- xbytes = sizeof(int) * num_tags; -+ xbytes = sizeof(regoff_t) * num_tags; - total_bytes = - (sizeof(long) - 1) * 4 /* for alignment paddings */ - + (rbytes + xbytes * tnfa->num_states) * 2 + tbytes + pbytes; -@@ -490,12 +490,12 @@ error_exit: - */ - - typedef struct { -- int pos; -+ regoff_t pos; - const char *str_byte; - tre_tnfa_transition_t *state; - int state_id; - int next_c; -- int *tags; -+ regoff_t *tags; - #ifdef TRE_MBSTATE - mbstate_t mbstate; - #endif /* TRE_MBSTATE */ -@@ -591,13 +591,13 @@ typedef struct tre_backtrack_struct { - - static reg_errcode_t - tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string, -- int *match_tags, int eflags, int *match_end_ofs) -+ regoff_t *match_tags, int eflags, regoff_t *match_end_ofs) - { - /* State variables required by GET_NEXT_WCHAR. */ - tre_char_t prev_c = 0, next_c = 0; - const char *str_byte = string; -- int pos = 0; -- int pos_add_next = 1; -+ regoff_t pos = 0; -+ regoff_t pos_add_next = 1; - #ifdef TRE_MBSTATE - mbstate_t mbstate; - #endif /* TRE_MBSTATE */ -@@ -610,15 +610,16 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string, - started from. */ - int next_c_start; - const char *str_byte_start; -- int pos_start = -1; -+ regoff_t pos_start = -1; - #ifdef TRE_MBSTATE - mbstate_t mbstate_start; - #endif /* TRE_MBSTATE */ - - /* End offset of best match so far, or -1 if no match found yet. */ -- int match_eo = -1; -+ regoff_t match_eo = -1; - /* Tag arrays. */ -- int *next_tags, *tags = NULL; -+ int *next_tags; -+ regoff_t *tags = NULL; - /* Current TNFA state. */ - tre_tnfa_transition_t *state; - int *states_seen = NULL; -@@ -768,8 +769,9 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string, - /* This is a back reference state. All transitions leaving from - this state have the same back reference "assertion". Instead - of reading the next character, we match the back reference. */ -- int so, eo, bt = trans_i->u.backref; -- int bt_len; -+ regoff_t so, eo; -+ int bt = trans_i->u.backref; -+ regoff_t bt_len; - int result; - - /* Get the substring we need to match against. Remember to -@@ -926,7 +928,7 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string, - endpoint values. */ - static void - tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[], int cflags, -- const tre_tnfa_t *tnfa, int *tags, int match_eo) -+ const tre_tnfa_t *tnfa, regoff_t *tags, regoff_t match_eo) - { - tre_submatch_data_t *submatch_data; - unsigned int i, j; -@@ -996,7 +998,7 @@ regexec(const regex_t *restrict preg, const char *restrict string, - { - tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD; - reg_errcode_t status; -- int *tags = NULL, eo; -+ regoff_t *tags = NULL, eo; - if (tnfa->cflags & REG_NOSUB) nmatch = 0; - if (tnfa->num_tags > 0 && nmatch > 0) - { --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/039-fix-integer-overflow-in-float-printf-needed-precision-computation.patch b/toolchain/musl/patches/039-fix-integer-overflow-in-float-printf-needed-precision-computation.patch deleted file mode 100644 index cfbd94f9a4..0000000000 --- a/toolchain/musl/patches/039-fix-integer-overflow-in-float-printf-needed-precision-computation.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 70d2687d85c314963cf280759b23fd4573ff0d82 Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Wed, 19 Oct 2016 20:17:16 -0400 -Subject: fix integer overflow in float printf needed-precision computation - -if the requested precision is close to INT_MAX, adding -LDBL_MANT_DIG/3+8 overflows. in practice the resulting undefined -behavior manifests as a large negative result, which is then used to -compute the new end pointer (z) with a wildly out-of-bounds value -(more overflow, more undefined behavior). the end result is at least -incorrect output and character count (return value); worse things do -not seem to happen, but detailed analysis has not been done. - -this patch fixes the overflow by performing the intermediate -computation as unsigned; after division by 9, the final result -necessarily fits in int. ---- - src/stdio/vfprintf.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c -index e439a07..cd17ad7 100644 ---- a/src/stdio/vfprintf.c -+++ b/src/stdio/vfprintf.c -@@ -312,7 +312,7 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t) - } - while (e2<0) { - uint32_t carry=0, *b; -- int sh=MIN(9,-e2), need=1+(p+LDBL_MANT_DIG/3+8)/9; -+ int sh=MIN(9,-e2), need=1+(p+LDBL_MANT_DIG/3U+8)/9; - for (d=a; d>sh) + carry; --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/040-fix-integer-overflows-and-uncaught-eoverflow-in-printf-core.patch b/toolchain/musl/patches/040-fix-integer-overflows-and-uncaught-eoverflow-in-printf-core.patch deleted file mode 100644 index 837fee9181..0000000000 --- a/toolchain/musl/patches/040-fix-integer-overflows-and-uncaught-eoverflow-in-printf-core.patch +++ /dev/null @@ -1,390 +0,0 @@ -From 167dfe9672c116b315e72e57a55c7769f180dffa Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Thu, 20 Oct 2016 00:22:09 -0400 -Subject: fix integer overflows and uncaught EOVERFLOW in printf core - -this patch fixes a large number of missed internal signed-overflow -checks and errors in determining when the return value (output length) -would exceed INT_MAX, which should result in EOVERFLOW. some of the -issues fixed were reported by Alexander Cherepanov; others were found -in subsequent review of the code. - -aside from the signed overflows being undefined behavior, the -following specific bugs were found to exist in practice: - -- overflows computing length of floating point formats with huge - explicit precisions, integer formats with prefix characters and huge - explicit precisions, or string arguments or format strings longer - than INT_MAX, resulted in wrong return value and wrong %n results. - -- literal width and precision values outside the range of int were - misinterpreted, yielding wrong behavior in at least one well-defined - case: string formats with precision greater than INT_MAX were - sometimes truncated. - -- in cases where EOVERFLOW is produced, incorrect values could be - written for %n specifiers past the point of exceeding INT_MAX. - -in addition to fixing these bugs, we now stop producing output -immediately when output length would exceed INT_MAX, rather than -continuing and returning an error only at the end. ---- - src/stdio/vfprintf.c | 72 +++++++++++++++++++++++++++++++++++---------------- - src/stdio/vfwprintf.c | 63 +++++++++++++++++++++++++++----------------- - 2 files changed, 89 insertions(+), 46 deletions(-) - -diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c -index cd17ad7..e2ab2dc 100644 ---- a/src/stdio/vfprintf.c -+++ b/src/stdio/vfprintf.c -@@ -272,6 +272,8 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t) - if (s-buf==1 && (y||p>0||(fl&ALT_FORM))) *s++='.'; - } while (y); - -+ if (p > INT_MAX-2-(ebuf-estr)-pl) -+ return -1; - if (p && s-buf-2 < p) - l = (p+2) + (ebuf-estr); - else -@@ -383,17 +385,22 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t) - p = MIN(p,MAX(0,9*(z-r-1)+e-j)); - } - } -+ if (p > INT_MAX-1-(p || (fl&ALT_FORM))) -+ return -1; - l = 1 + p + (p || (fl&ALT_FORM)); - if ((t|32)=='f') { -+ if (e > INT_MAX-l) return -1; - if (e>0) l+=e; - } else { - estr=fmt_u(e<0 ? -e : e, ebuf); - while(ebuf-estr<2) *--estr='0'; - *--estr = (e<0 ? '-' : '+'); - *--estr = t; -+ if (ebuf-estr > INT_MAX-l) return -1; - l += ebuf-estr; - } - -+ if (l > INT_MAX-pl) return -1; - pad(f, ' ', w, pl+l, fl); - out(f, prefix, pl); - pad(f, '0', w, pl+l, fl^ZERO_PAD); -@@ -437,8 +444,10 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t) - - static int getint(char **s) { - int i; -- for (i=0; isdigit(**s); (*s)++) -- i = 10*i + (**s-'0'); -+ for (i=0; isdigit(**s); (*s)++) { -+ if (i > INT_MAX/10U || **s-'0' > INT_MAX-10*i) i = -1; -+ else i = 10*i + (**s-'0'); -+ } - return i; - } - -@@ -446,12 +455,12 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, - { - char *a, *z, *s=(char *)fmt; - unsigned l10n=0, fl; -- int w, p; -+ int w, p, xp; - union arg arg; - int argpos; - unsigned st, ps; - int cnt=0, l=0; -- int i; -+ size_t i; - char buf[sizeof(uintmax_t)*3+3+LDBL_MANT_DIG/4]; - const char *prefix; - int t, pl; -@@ -459,18 +468,19 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, - char mb[4]; - - for (;;) { -+ /* This error is only specified for snprintf, but since it's -+ * unspecified for other forms, do the same. Stop immediately -+ * on overflow; otherwise %n could produce wrong results. */ -+ if (l > INT_MAX - cnt) goto overflow; -+ - /* Update output count, end loop when fmt is exhausted */ -- if (cnt >= 0) { -- if (l > INT_MAX - cnt) { -- errno = EOVERFLOW; -- cnt = -1; -- } else cnt += l; -- } -+ cnt += l; - if (!*s) break; - - /* Handle literal text and %% format specifiers */ - for (a=s; *s && *s!='%'; s++); - for (z=s; s[0]=='%' && s[1]=='%'; z++, s+=2); -+ if (z-a > INT_MAX-cnt) goto overflow; - l = z-a; - if (f) out(f, a, l); - if (l) continue; -@@ -498,9 +508,9 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, - } else if (!l10n) { - w = f ? va_arg(*ap, int) : 0; - s++; -- } else return -1; -+ } else goto inval; - if (w<0) fl|=LEFT_ADJ, w=-w; -- } else if ((w=getint(&s))<0) return -1; -+ } else if ((w=getint(&s))<0) goto overflow; - - /* Read precision */ - if (*s=='.' && s[1]=='*') { -@@ -511,24 +521,29 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, - } else if (!l10n) { - p = f ? va_arg(*ap, int) : 0; - s+=2; -- } else return -1; -+ } else goto inval; -+ xp = (p>=0); - } else if (*s=='.') { - s++; - p = getint(&s); -- } else p = -1; -+ xp = 1; -+ } else { -+ p = -1; -+ xp = 0; -+ } - - /* Format specifier state machine */ - st=0; - do { -- if (OOB(*s)) return -1; -+ if (OOB(*s)) goto inval; - ps=st; - st=states[st]S(*s++); - } while (st-1=0) return -1; -+ if (argpos>=0) goto inval; - } else { - if (argpos>=0) nl_type[argpos]=st, arg=nl_arg[argpos]; - else if (f) pop_arg(&arg, st, ap); -@@ -584,6 +599,7 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, - case 'u': - a = fmt_u(arg.i, z); - } -+ if (xp && p<0) goto overflow; - if (p>=0) fl &= ~ZERO_PAD; - if (!arg.i && !p) { - a=z; -@@ -599,9 +615,9 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, - if (1) a = strerror(errno); else - case 's': - a = arg.p ? arg.p : "(null)"; -- z = memchr(a, 0, p); -- if (!z) z=a+p; -- else p=z-a; -+ z = a + strnlen(a, p<0 ? INT_MAX : p); -+ if (p<0 && *z) goto overflow; -+ p = z-a; - fl &= ~ZERO_PAD; - break; - case 'C': -@@ -611,8 +627,9 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, - p = -1; - case 'S': - ws = arg.p; -- for (i=l=0; i<0U+p && *ws && (l=wctomb(mb, *ws++))>=0 && l<=0U+p-i; i+=l); -+ for (i=l=0; i

=0 && l<=p-i; i+=l); - if (l<0) return -1; -+ if (i > INT_MAX) goto overflow; - p = i; - pad(f, ' ', w, p, fl); - ws = arg.p; -@@ -623,12 +640,16 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, - continue; - case 'e': case 'f': case 'g': case 'a': - case 'E': case 'F': case 'G': case 'A': -+ if (xp && p<0) goto overflow; - l = fmt_fp(f, arg.f, w, p, fl, t); -+ if (l<0) goto overflow; - continue; - } - - if (p < z-a) p = z-a; -+ if (p > INT_MAX-pl) goto overflow; - if (w < pl+p) w = pl+p; -+ if (w > INT_MAX-cnt) goto overflow; - - pad(f, ' ', w, pl+p, fl); - out(f, prefix, pl); -@@ -646,8 +667,15 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, - for (i=1; i<=NL_ARGMAX && nl_type[i]; i++) - pop_arg(nl_arg+i, nl_type[i], ap); - for (; i<=NL_ARGMAX && !nl_type[i]; i++); -- if (i<=NL_ARGMAX) return -1; -+ if (i<=NL_ARGMAX) goto inval; - return 1; -+ -+inval: -+ errno = EINVAL; -+ return -1; -+overflow: -+ errno = EOVERFLOW; -+ return -1; - } - - int vfprintf(FILE *restrict f, const char *restrict fmt, va_list ap) -diff --git a/src/stdio/vfwprintf.c b/src/stdio/vfwprintf.c -index f9f1ecf..b8fff20 100644 ---- a/src/stdio/vfwprintf.c -+++ b/src/stdio/vfwprintf.c -@@ -154,8 +154,10 @@ static void out(FILE *f, const wchar_t *s, size_t l) - - static int getint(wchar_t **s) { - int i; -- for (i=0; iswdigit(**s); (*s)++) -- i = 10*i + (**s-'0'); -+ for (i=0; iswdigit(**s); (*s)++) { -+ if (i > INT_MAX/10U || **s-'0' > INT_MAX-10*i) i = -1; -+ else i = 10*i + (**s-'0'); -+ } - return i; - } - -@@ -168,8 +170,8 @@ static const char sizeprefix['y'-'a'] = { - static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_arg, int *nl_type) - { - wchar_t *a, *z, *s=(wchar_t *)fmt; -- unsigned l10n=0, litpct, fl; -- int w, p; -+ unsigned l10n=0, fl; -+ int w, p, xp; - union arg arg; - int argpos; - unsigned st, ps; -@@ -181,20 +183,19 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ - wchar_t wc; - - for (;;) { -+ /* This error is only specified for snprintf, but since it's -+ * unspecified for other forms, do the same. Stop immediately -+ * on overflow; otherwise %n could produce wrong results. */ -+ if (l > INT_MAX - cnt) goto overflow; -+ - /* Update output count, end loop when fmt is exhausted */ -- if (cnt >= 0) { -- if (l > INT_MAX - cnt) { -- if (!ferror(f)) errno = EOVERFLOW; -- cnt = -1; -- } else cnt += l; -- } -+ cnt += l; - if (!*s) break; - - /* Handle literal text and %% format specifiers */ - for (a=s; *s && *s!='%'; s++); -- litpct = wcsspn(s, L"%")/2; /* Optimize %%%% runs */ -- z = s+litpct; -- s += 2*litpct; -+ for (z=s; s[0]=='%' && s[1]=='%'; z++, s+=2); -+ if (z-a > INT_MAX-cnt) goto overflow; - l = z-a; - if (f) out(f, a, l); - if (l) continue; -@@ -222,9 +223,9 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ - } else if (!l10n) { - w = f ? va_arg(*ap, int) : 0; - s++; -- } else return -1; -+ } else goto inval; - if (w<0) fl|=LEFT_ADJ, w=-w; -- } else if ((w=getint(&s))<0) return -1; -+ } else if ((w=getint(&s))<0) goto overflow; - - /* Read precision */ - if (*s=='.' && s[1]=='*') { -@@ -235,24 +236,29 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ - } else if (!l10n) { - p = f ? va_arg(*ap, int) : 0; - s+=2; -- } else return -1; -+ } else goto inval; -+ xp = (p>=0); - } else if (*s=='.') { - s++; - p = getint(&s); -- } else p = -1; -+ xp = 1; -+ } else { -+ p = -1; -+ xp = 0; -+ } - - /* Format specifier state machine */ - st=0; - do { -- if (OOB(*s)) return -1; -+ if (OOB(*s)) goto inval; - ps=st; - st=states[st]S(*s++); - } while (st-1=0) return -1; -+ if (argpos>=0) goto inval; - } else { - if (argpos>=0) nl_type[argpos]=st, arg=nl_arg[argpos]; - else if (f) pop_arg(&arg, st, ap); -@@ -285,8 +291,9 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ - continue; - case 'S': - a = arg.p; -- z = wmemchr(a, 0, p); -- if (z) p=z-a; -+ z = a + wcsnlen(a, p<0 ? INT_MAX : p); -+ if (p<0 && *z) goto overflow; -+ p = z-a; - if (w0; bs+=i, l++); -+ for (i=l=0; l<(p<0?INT_MAX:p) && (i=mbtowc(&wc, bs, MB_LEN_MAX))>0; bs+=i, l++); - if (i<0) return -1; -+ if (p<0 && *bs) goto overflow; - p=l; - if (w -Date: Tue, 4 Oct 2016 03:58:56 +0200 -Subject: math: fix pow signed shift ub - -j is int32_t and thus j<<31 is undefined if j==1, so j is changed to -uint32_t locally as a quick fix, the generated code is not affected. - -(this is a strict conformance fix, future c standard may allow 1<<31, -see DR 463. the bug was inherited from freebsd fdlibm, the proper fix -is to use uint32_t for all bit hacks, but that requires more intrusive -changes.) - -reported by Daniel Sabogal ---- - src/math/pow.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/math/pow.c b/src/math/pow.c -index b66f632..3ddc1b6 100644 ---- a/src/math/pow.c -+++ b/src/math/pow.c -@@ -125,11 +125,11 @@ double pow(double x, double y) - else if (iy >= 0x3ff00000) { - k = (iy>>20) - 0x3ff; /* exponent */ - if (k > 20) { -- j = ly>>(52-k); -+ uint32_t j = ly>>(52-k); - if ((j<<(52-k)) == ly) - yisint = 2 - (j&1); - } else if (ly == 0) { -- j = iy>>(20-k); -+ uint32_t j = iy>>(20-k); - if ((j<<(20-k)) == iy) - yisint = 2 - (j&1); - } --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/049-fix-clock_nanosleep-error-case.patch b/toolchain/musl/patches/049-fix-clock_nanosleep-error-case.patch deleted file mode 100644 index f57f7a65fb..0000000000 --- a/toolchain/musl/patches/049-fix-clock_nanosleep-error-case.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 3ca2d2d4aef910663785fe232d7d2127a22d8a84 Mon Sep 17 00:00:00 2001 -From: Daniel Sabogal -Date: Sat, 17 Sep 2016 12:05:45 -0400 -Subject: fix clock_nanosleep error case - -posix requires that EINVAL be returned if the first parameter specifies -the cpu-time clock of the calling thread (CLOCK_THREAD_CPUTIME_ID). -linux returns ENOTSUP instead so we handle this. ---- - src/time/clock_nanosleep.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/time/clock_nanosleep.c b/src/time/clock_nanosleep.c -index ec87b9e..9e4d9f1 100644 ---- a/src/time/clock_nanosleep.c -+++ b/src/time/clock_nanosleep.c -@@ -1,8 +1,10 @@ - #include -+#include - #include "syscall.h" - #include "libc.h" - - int clock_nanosleep(clockid_t clk, int flags, const struct timespec *req, struct timespec *rem) - { -- return -__syscall_cp(SYS_clock_nanosleep, clk, flags, req, rem); -+ int r = -__syscall_cp(SYS_clock_nanosleep, clk, flags, req, rem); -+ return clk == CLOCK_THREAD_CPUTIME_ID ? EINVAL : r; - } --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/050-add-pthread_setname_np.patch b/toolchain/musl/patches/050-add-pthread_setname_np.patch deleted file mode 100644 index 9d641a296b..0000000000 --- a/toolchain/musl/patches/050-add-pthread_setname_np.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 8fb28b0b3e7a5e958fb844722a4b2ef9bc244af1 Mon Sep 17 00:00:00 2001 -From: Felix Janda -Date: Fri, 16 Sep 2016 20:54:00 -0400 -Subject: add pthread_setname_np - -the thread name is displayed by gdb's "info threads". ---- - include/pthread.h | 1 + - src/thread/pthread_setname_np.c | 26 ++++++++++++++++++++++++++ - 2 files changed, 27 insertions(+) - create mode 100644 src/thread/pthread_setname_np.c - -diff --git a/include/pthread.h b/include/pthread.h -index 3d2e0c4..94ef919 100644 ---- a/include/pthread.h -+++ b/include/pthread.h -@@ -214,6 +214,7 @@ struct cpu_set_t; - int pthread_getaffinity_np(pthread_t, size_t, struct cpu_set_t *); - int pthread_setaffinity_np(pthread_t, size_t, const struct cpu_set_t *); - int pthread_getattr_np(pthread_t, pthread_attr_t *); -+int pthread_setname_np(pthread_t, const char *); - int pthread_tryjoin_np(pthread_t, void **); - int pthread_timedjoin_np(pthread_t, void **, const struct timespec *); - #endif -diff --git a/src/thread/pthread_setname_np.c b/src/thread/pthread_setname_np.c -new file mode 100644 -index 0000000..82d35e1 ---- /dev/null -+++ b/src/thread/pthread_setname_np.c -@@ -0,0 +1,26 @@ -+#define _GNU_SOURCE -+#include -+#include -+#include -+#include -+ -+#include "pthread_impl.h" -+ -+int pthread_setname_np(pthread_t thread, const char *name) -+{ -+ int fd, cs, status = 0; -+ char f[sizeof "/proc/self/task//comm" + 3*sizeof(int)]; -+ size_t len; -+ -+ if ((len = strnlen(name, 16)) > 15) return ERANGE; -+ -+ if (thread == pthread_self()) -+ return prctl(PR_SET_NAME, (unsigned long)name, 0UL, 0UL, 0UL) ? errno : 0; -+ -+ snprintf(f, sizeof f, "/proc/self/task/%d/comm", thread->tid); -+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); -+ if ((fd = open(f, O_WRONLY)) < 0 || write(fd, name, len) < 0) status = errno; -+ if (fd >= 0) close(fd); -+ pthread_setcancelstate(cs, 0); -+ return status; -+} --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/051-fix-float-formatting-of-some-exact-halfway-cases.patch b/toolchain/musl/patches/051-fix-float-formatting-of-some-exact-halfway-cases.patch deleted file mode 100644 index d01a163ce2..0000000000 --- a/toolchain/musl/patches/051-fix-float-formatting-of-some-exact-halfway-cases.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 51ab6db4ed115d079d7131975e4adb074ba9ef9d Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy -Date: Wed, 12 Oct 2016 00:49:59 +0200 -Subject: fix float formatting of some exact halfway cases - -in nearest rounding mode exact halfway cases were not following the -round to even rule if the rounding happened at a base 1000000000 digit -boundary of the internal representation and the previous digit was odd. - -e.g. printf("%.0f", 1.5) printed 1 instead of 2. ---- - src/stdio/vfprintf.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c -index e2ab2dc..60da14d 100644 ---- a/src/stdio/vfprintf.c -+++ b/src/stdio/vfprintf.c -@@ -345,7 +345,8 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t) - if (x || d+1!=z) { - long double round = 2/LDBL_EPSILON; - long double small; -- if (*d/i & 1) round += 2; -+ if ((*d/i & 1) || (i==1000000000 && d>a && (d[-1]&1))) -+ round += 2; - if (x -Date: Thu, 20 Oct 2016 12:13:33 -0400 -Subject: fix getopt_long_only misinterpreting "--" as an option - ---- - src/misc/getopt_long.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/misc/getopt_long.c b/src/misc/getopt_long.c -index 480c001..c6e1462 100644 ---- a/src/misc/getopt_long.c -+++ b/src/misc/getopt_long.c -@@ -53,7 +53,7 @@ static int __getopt_long_core(int argc, char *const *argv, const char *optstring - { - optarg = 0; - if (longopts && argv[optind][0] == '-' && -- ((longonly && argv[optind][1]) || -+ ((longonly && argv[optind][1] && argv[optind][1] != '-') || - (argv[optind][1] == '-' && argv[optind][2]))) - { - int colon = optstring[optstring[0]=='+'||optstring[0]=='-']==':'; --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/053-fix-gratuitous-undefined-behavior-in-strptime.patch b/toolchain/musl/patches/053-fix-gratuitous-undefined-behavior-in-strptime.patch deleted file mode 100644 index 46920bccfb..0000000000 --- a/toolchain/musl/patches/053-fix-gratuitous-undefined-behavior-in-strptime.patch +++ /dev/null @@ -1,33 +0,0 @@ -From f33b17585058381491e6fda08f491b8e48c7980c Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Thu, 20 Oct 2016 13:22:20 -0400 -Subject: fix gratuitous undefined behavior in strptime - -accessing an object of type const char *restrict as if it had type -char * is not defined. ---- - src/time/strptime.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/src/time/strptime.c b/src/time/strptime.c -index f41f55f..55c7ed1 100644 ---- a/src/time/strptime.c -+++ b/src/time/strptime.c -@@ -22,8 +22,13 @@ char *strptime(const char *restrict s, const char *restrict f, struct tm *restri - } - f++; - if (*f == '+') f++; -- if (isdigit(*f)) w=strtoul(f, (void *)&f, 10); -- else w=-1; -+ if (isdigit(*f)) { -+ char *new_f; -+ w=strtoul(f, &new_f, 10); -+ f = new_f; -+ } else { -+ w=-1; -+ } - adj=0; - switch (*f++) { - case 'a': case 'A': --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/054-fix-strtod-and-strtof-rounding-with-many-trailing-zeros.patch b/toolchain/musl/patches/054-fix-strtod-and-strtof-rounding-with-many-trailing-zeros.patch deleted file mode 100644 index 3d9211c022..0000000000 --- a/toolchain/musl/patches/054-fix-strtod-and-strtof-rounding-with-many-trailing-zeros.patch +++ /dev/null @@ -1,36 +0,0 @@ -From d184a09e0529f33d8ddddb8825039133483a2c41 Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy -Date: Sun, 4 Sep 2016 04:46:00 +0200 -Subject: fix strtod and strtof rounding with many trailing zeros - -in certain cases excessive trailing zeros could cause incorrect -rounding from long double to double or float in decfloat. - -e.g. in strtof("9444733528689243848704.000000", 0) the argument -is 0x1.000001p+73, exactly halfway between two representible floats, -this incorrectly got rounded to 0x1.000002p+73 instead of 0x1p+73, -but with less trailing 0 the rounding was fine. - -the fix makes sure that the z index always points one past the last -non-zero digit in the base 10^9 representation, this way trailing -zeros don't affect the rounding logic. ---- - src/internal/floatscan.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/internal/floatscan.c b/src/internal/floatscan.c -index eef70df..80305ee 100644 ---- a/src/internal/floatscan.c -+++ b/src/internal/floatscan.c -@@ -172,6 +172,9 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po - return sign * (long double)x[0] * p10s[rp-10]; - } - -+ /* Drop trailing zeros */ -+ for (; !x[z-1]; z--); -+ - /* Align radix point to B1B digit boundary */ - if (rp % 9) { - int rpm9 = rp>=0 ? rp%9 : rp%9+9; --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/055-fix-strtod-int-optimization-in-non-nearest-rounding-mode.patch b/toolchain/musl/patches/055-fix-strtod-int-optimization-in-non-nearest-rounding-mode.patch deleted file mode 100644 index 1588b14658..0000000000 --- a/toolchain/musl/patches/055-fix-strtod-int-optimization-in-non-nearest-rounding-mode.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 6ffdc4579ffb34f4aab69ab4c081badabc7c0a9a Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy -Date: Sun, 4 Sep 2016 04:51:03 +0200 -Subject: fix strtod int optimization in non-nearest rounding mode - -the mid-sized integer optimization relies on lnz set up properly -to mark the last non-zero decimal digit, but this was not done -if the non-zero digit lied outside the KMAX digits of the base -10^9 number representation. - -so if the fractional part was a very long list of zeros (>2048*9 on -x86) followed by non-zero digits then the integer optimization could -kick in discarding the tiny non-zero fraction which can mean wrong -result on non-nearest rounding mode. - -strtof, strtod and strtold were all affected. ---- - src/internal/floatscan.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/internal/floatscan.c b/src/internal/floatscan.c -index 80305ee..ae09852 100644 ---- a/src/internal/floatscan.c -+++ b/src/internal/floatscan.c -@@ -110,7 +110,10 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po - gotdig=1; - } else { - dc++; -- if (c!='0') x[KMAX-4] |= 1; -+ if (c!='0') { -+ lnz = (KMAX-4)*9; -+ x[KMAX-4] |= 1; -+ } - } - } - if (!gotrad) lrp=dc; --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/065-fix-integer-overflow-of-tm_year-in-__secs_to_tm.patch b/toolchain/musl/patches/065-fix-integer-overflow-of-tm_year-in-__secs_to_tm.patch deleted file mode 100644 index 6db6fd8365..0000000000 --- a/toolchain/musl/patches/065-fix-integer-overflow-of-tm_year-in-__secs_to_tm.patch +++ /dev/null @@ -1,39 +0,0 @@ -From bc1e7731cee963e422575f81048792f4d5db9641 Mon Sep 17 00:00:00 2001 -From: Daniel Sabogal -Date: Wed, 2 Nov 2016 22:29:36 -0400 -Subject: fix integer overflow of tm_year in __secs_to_tm - -the overflow check for years+100 did not account for the extra -year computed from the remaining months. instead, perform this -check after obtaining the final number of years. ---- - src/time/__secs_to_tm.c | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/src/time/__secs_to_tm.c b/src/time/__secs_to_tm.c -index 3a3123a..093d902 100644 ---- a/src/time/__secs_to_tm.c -+++ b/src/time/__secs_to_tm.c -@@ -60,15 +60,16 @@ int __secs_to_tm(long long t, struct tm *tm) - for (months=0; days_in_month[months] <= remdays; months++) - remdays -= days_in_month[months]; - -+ if (months >= 10) { -+ months -= 12; -+ years++; -+ } -+ - if (years+100 > INT_MAX || years+100 < INT_MIN) - return -1; - - tm->tm_year = years + 100; - tm->tm_mon = months + 2; -- if (tm->tm_mon >= 12) { -- tm->tm_mon -=12; -- tm->tm_year++; -- } - tm->tm_mday = remdays + 1; - tm->tm_wday = wday; - tm->tm_yday = yday; --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/066-fix-swprintf-internal-buffer-state-and-error-handling.patch b/toolchain/musl/patches/066-fix-swprintf-internal-buffer-state-and-error-handling.patch deleted file mode 100644 index a6e7c7f5b0..0000000000 --- a/toolchain/musl/patches/066-fix-swprintf-internal-buffer-state-and-error-handling.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 7442442ccc665641a8827177e8e7ed45bbbd6584 Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Mon, 7 Nov 2016 20:39:59 -0500 -Subject: fix swprintf internal buffer state and error handling - -the swprintf write callback never reset its buffer pointers, so after -its 256-byte buffer filled up, it would keep repeating those bytes -over and over in the output until the destination buffer filled up. it -also failed to set the error indicator for the stream on EILSEQ, -potentially allowing output to continue after the error. ---- - src/stdio/vswprintf.c | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/src/stdio/vswprintf.c b/src/stdio/vswprintf.c -index 7d237ba..6eb2f6a 100644 ---- a/src/stdio/vswprintf.c -+++ b/src/stdio/vswprintf.c -@@ -24,7 +24,14 @@ static size_t sw_write(FILE *f, const unsigned char *s, size_t l) - c->ws++; - } - *c->ws = 0; -- return i<0 ? i : l0; -+ if (i < 0) { -+ f->wpos = f->wbase = f->wend = 0; -+ f->flags |= F_ERR; -+ return i; -+ } -+ f->wend = f->buf + f->buf_size; -+ f->wpos = f->wbase = f->buf; -+ return l0; - } - - int vswprintf(wchar_t *restrict s, size_t n, const wchar_t *restrict fmt, va_list ap) --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/071-fix-build-regression-on-archs-with-variable-page-size.patch b/toolchain/musl/patches/071-fix-build-regression-on-archs-with-variable-page-size.patch deleted file mode 100644 index 50d23e5056..0000000000 --- a/toolchain/musl/patches/071-fix-build-regression-on-archs-with-variable-page-size.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 4078a5c31fa67987051c2180db7a07702534032f Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Tue, 8 Nov 2016 18:03:42 -0500 -Subject: fix build regression on archs with variable page size - -commit 31fb174dd295e50f7c5cf18d31fcfd5fe5a063b7 used -DEFAULT_GUARD_SIZE from pthread_impl.h in a static initializer, -breaking build on archs where its definition, PAGE_SIZE, is not a -constant. instead, just define DEFAULT_GUARD_SIZE as 4096, the minimal -page size on any arch we support. pthread_create rounds up to whole -pages anyway, so defining it to 1 would also work, but a moderately -meaningful value is nicer to programs that use -pthread_attr_getguardsize on default-initialized attribute objects. ---- - src/internal/pthread_impl.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h -index 3890bb5..7a679db 100644 ---- a/src/internal/pthread_impl.h -+++ b/src/internal/pthread_impl.h -@@ -143,7 +143,7 @@ void __block_app_sigs(void *); - void __restore_sigs(void *); - - #define DEFAULT_STACK_SIZE 81920 --#define DEFAULT_GUARD_SIZE PAGE_SIZE -+#define DEFAULT_GUARD_SIZE 4096 - - #define __ATTRP_C11_THREAD ((void*)(uintptr_t)-1) - --- -cgit v0.11.2 diff --git a/toolchain/musl/patches/099-Add-format-attribute-to-some-function-declarations.patch b/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch similarity index 100% rename from toolchain/musl/patches/099-Add-format-attribute-to-some-function-declarations.patch rename to toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch diff --git a/toolchain/musl/patches/400-fix_quoted_timezone.patch b/toolchain/musl/patches/400-fix_quoted_timezone.patch deleted file mode 100644 index 79afa4a63b..0000000000 --- a/toolchain/musl/patches/400-fix_quoted_timezone.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/time/__tz.c -+++ b/src/time/__tz.c -@@ -87,7 +87,7 @@ - int i; - if (**p == '<') { - ++*p; -- for (i=0; **p!='>' && i "test.c" + cmake_original_make_flags="${cmake_make_flags}" + if [ "x${cmake_parallel_make}" != "x" ]; then +- cmake_make_flags="${cmake_make_flags} -j ${cmake_parallel_make}" ++ case "$cmake_paralle_make" in ++ [0-9]*) cmake_parallel_make="-j ${cmake_parallel_make}";; ++ esac ++ cmake_make_flags="${cmake_make_flags} ${cmake_parallel_make}" + fi + for a in ${cmake_make_processors}; do + if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then diff --git a/tools/kernel2minor/Makefile b/tools/kernel2minor/Makefile index 90f21add45..3e7d5147d5 100644 --- a/tools/kernel2minor/Makefile +++ b/tools/kernel2minor/Makefile @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=kernel2minor -PKG_VERSION:=0.22 -PKG_RELEASE:=1 +PKG_VERSION:=0.24 +PKG_RELEASE:=3 -PKG_MIRROR_HASH:=8e509deb78e4eddc5f4d0798d3c5fbc99bf6dd151faaf0332a640607042d7f82 PKG_SOURCE_URL:=https://github.com/adron-s/kernel2minor.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=0587740de3e398dbe89d965334c492609cb9739d +PKG_SOURCE_VERSION:=2cacb4dec6673a60a972a3a7f7629464a26a8492 +PKG_HASH:=33ca413403a3341af0c9a8e6d9bb58f4ad080a5339e8a8729b83637d35bfaf1b include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/kernel2minor/patches/100-portability.patch b/tools/kernel2minor/patches/100-portability.patch deleted file mode 100644 index 43340ae4f2..0000000000 --- a/tools/kernel2minor/patches/100-portability.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/yaffs2/yaffs_guts.h -+++ b/yaffs2/yaffs_guts.h -@@ -17,8 +17,9 @@ - #define __YAFFS_GUTS_H__ - - #include "yportenv.h" -+#include - --typedef __loff_t loff_t; -+typedef int64_t loff_t; - - #define YAFFS_OK 1 - #define YAFFS_FAIL 0 diff --git a/tools/kernel2minor/patches/110-fix_endian_conv.patch b/tools/kernel2minor/patches/110-fix_endian_conv.patch deleted file mode 100644 index 0d30d05b74..0000000000 --- a/tools/kernel2minor/patches/110-fix_endian_conv.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- a/k2m_biops.h -+++ b/k2m_biops.h -@@ -10,7 +10,9 @@ - */ - - //нужна ли конвертация. устанавливавется автоматически в 1 для НЕ big_endian систем --static int endian_need_conv = __BYTE_ORDER__ != __ORDER_BIG_ENDIAN__; -+static int big_endian; -+ -+#define endian_need_conv (!!big_endian ^ (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - - /* конвертор из одного байтового порядка в обратный - x обязательно должна быть переменной но не выражением ! ---- a/kernel2minor.c -+++ b/kernel2minor.c -@@ -76,7 +76,7 @@ void print_help(void){ - char *usage[] = - { "-k", "Path to kernel file", kernel_file, - "-r", "Path to result file", res_file, -- "-e", "Enable endian convert", endian_need_conv ? "Yes" : "No", -+ "-e", "Enable endian convert to big-endian", big_endian ? "Yes" : "No", - "-c", "Use ECC", use_ecc ? "Yes" : "No", - "-s", "FLASH Unit(Chunk) size", chunk_size_str, - "-i", "Add image info block", add_image_info_block ? info_block_size_str : "No", -@@ -595,7 +595,7 @@ int main(int argc, char *argv[]){ - case 'k': snprintf(kernel_file, sizeof(kernel_file) - 1, "%s", optarg); break; - case 'r': snprintf(res_file, sizeof(res_file) - 1, "%s", optarg); break; - case 'c': use_ecc = 1; break; -- case 'e': endian_need_conv = 1; break; -+ case 'e': big_endian = 1; break; - case 's': chunk_size = atoi(optarg); break; - case 'i': add_image_info_block = 1; align_size = atoi(optarg); break; - case 'p': strncpy(platform_name, optarg, sizeof(platform_name)); break; diff --git a/tools/kernel2minor/patches/120-fix_create_mode.patch b/tools/kernel2minor/patches/120-fix_create_mode.patch deleted file mode 100644 index 8fa87078e1..0000000000 --- a/tools/kernel2minor/patches/120-fix_create_mode.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/kernel2minor.c -+++ b/kernel2minor.c -@@ -622,7 +622,7 @@ int main(int argc, char *argv[]){ - perror("Can't open kernel file"); - exit(-1); - } -- r = creat(res_file, 0); -+ r = open(res_file, O_CREAT | O_TRUNC | O_WRONLY, 0644); - if(r <= 0){ - perror("Can't create result file"); - close(k); diff --git a/tools/patch-image/src/patch-dtb.c b/tools/patch-image/src/patch-dtb.c index 8d186236c1..a94da3fa41 100644 --- a/tools/patch-image/src/patch-dtb.c +++ b/tools/patch-image/src/patch-dtb.c @@ -49,10 +49,6 @@ int main(int argc, char **argv) search_space = dtb_max_size = atoi(argv[3]); } - fddtb = open(argv[1], O_RDONLY); - if (!fddtb) - goto err1; - if (stat(argv[2], &s)) { fprintf(stderr, "DTB not found\n"); goto err1; diff --git a/tools/qemu/Makefile b/tools/qemu/Makefile index 2d954e47aa..3eac66f01e 100644 --- a/tools/qemu/Makefile +++ b/tools/qemu/Makefile @@ -16,17 +16,21 @@ PKG_HASH:=33ceae3fbe516f2cbb151dc98d16c8ccfec74b1056674ad715e75a2f7fed45c3 include $(INCLUDE_DIR)/host-build.mk -HOST_CFLAGS += -I$(STAGING_DIR_HOST)/include/e2fsprogs - -define Host/Configure - (cd $(HOST_BUILD_DIR); \ - CFLAGS="$(HOST_CFLAGS)" \ - LDFLAGS="$(HOST_LDFLAGS)" \ - $(HOST_CONFIGURE_CMD) \ - --extra-cflags="$(HOST_CFLAGS)" \ - --enable-uuid \ - ) -endef +HOST_CFLAGS += \ + -I$(STAGING_DIR_HOST)/include/e2fsprogs \ + -DAES_cbc_encrypt=QEMU_AES_cbc_encrypt \ + -DAES_decrypt=QEMU_AES_decrypt \ + -DAES_encrypt=QEMU_AES_encrypt \ + -DAES_set_decrypt_key=QEMU_AES_set_decrypt_key \ + -DAES_set_encrypt_key=QEMU_AES_set_encrypt_key + +HOST_CONFIGURE_VARS := \ + CFLAGS="$(HOST_CFLAGS)" \ + LDFLAGS="$(HOST_LDFLAGS)" + +HOST_CONFIGURE_ARGS := \ + --extra-cflags="$(HOST_CFLAGS)" \ + --enable-uuid define Host/Compile $(MAKE) -C $(HOST_BUILD_DIR) qemu-img -- 2.25.1