libiwinfo: ensure that country names are ascii, return txpower list even when no channel is set, bump version
This commit is contained in:
parent
7c8824f0fa
commit
ed1d776849
3 changed files with 10 additions and 11 deletions
|
@ -7,7 +7,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=libiwinfo
|
PKG_NAME:=libiwinfo
|
||||||
PKG_RELEASE:=4
|
PKG_RELEASE:=5
|
||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
|
@ -58,4 +58,3 @@ define Package/libiwinfo/install
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,libiwinfo))
|
$(eval $(call BuildPackage,libiwinfo))
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ struct iwinfo_iso3166_label ISO3166_Names[] = {
|
||||||
{ 0x4248 /* BH */, "Bahrain" },
|
{ 0x4248 /* BH */, "Bahrain" },
|
||||||
{ 0x4249 /* BI */, "Burundi" },
|
{ 0x4249 /* BI */, "Burundi" },
|
||||||
{ 0x424A /* BJ */, "Benin" },
|
{ 0x424A /* BJ */, "Benin" },
|
||||||
{ 0x424C /* BL */, "Saint Barthélemy" },
|
{ 0x424C /* BL */, "Saint Barthelemy" },
|
||||||
{ 0x424D /* BM */, "Bermuda" },
|
{ 0x424D /* BM */, "Bermuda" },
|
||||||
{ 0x424E /* BN */, "Brunei Darussalam" },
|
{ 0x424E /* BN */, "Brunei Darussalam" },
|
||||||
{ 0x424F /* BO */, "Bolivia" },
|
{ 0x424F /* BO */, "Bolivia" },
|
||||||
|
|
|
@ -131,14 +131,14 @@ static int nl80211_msg_response(struct nl_msg *msg, void *arg)
|
||||||
|
|
||||||
static void nl80211_free(struct nl80211_msg_conveyor *cv)
|
static void nl80211_free(struct nl80211_msg_conveyor *cv)
|
||||||
{
|
{
|
||||||
if( cv && cv->cb )
|
|
||||||
nl_cb_put(cv->cb);
|
|
||||||
|
|
||||||
if( cv && cv->msg )
|
|
||||||
nlmsg_free(cv->msg);
|
|
||||||
|
|
||||||
if( cv )
|
if( cv )
|
||||||
{
|
{
|
||||||
|
if( cv->cb )
|
||||||
|
nl_cb_put(cv->cb);
|
||||||
|
|
||||||
|
if( cv->msg )
|
||||||
|
nlmsg_free(cv->msg);
|
||||||
|
|
||||||
cv->cb = NULL;
|
cv->cb = NULL;
|
||||||
cv->msg = NULL;
|
cv->msg = NULL;
|
||||||
}
|
}
|
||||||
|
@ -924,7 +924,7 @@ int nl80211_get_txpwrlist(const char *ifname, char *buf, int *len)
|
||||||
};
|
};
|
||||||
|
|
||||||
if( nl80211_get_channel(ifname, &ch_cur) )
|
if( nl80211_get_channel(ifname, &ch_cur) )
|
||||||
return -1;
|
ch_cur = 0;
|
||||||
|
|
||||||
req = nl80211_msg(ifname, NL80211_CMD_GET_WIPHY, 0);
|
req = nl80211_msg(ifname, NL80211_CMD_GET_WIPHY, 0);
|
||||||
if( req )
|
if( req )
|
||||||
|
@ -947,7 +947,7 @@ int nl80211_get_txpwrlist(const char *ifname, char *buf, int *len)
|
||||||
ch_cmp = nl80211_freq2channel(
|
ch_cmp = nl80211_freq2channel(
|
||||||
nla_get_u32(freqs[NL80211_FREQUENCY_ATTR_FREQ]));
|
nla_get_u32(freqs[NL80211_FREQUENCY_ATTR_FREQ]));
|
||||||
|
|
||||||
if( (ch_cmp == ch_cur) &&
|
if( (!ch_cur || (ch_cmp == ch_cur)) &&
|
||||||
freqs[NL80211_FREQUENCY_ATTR_MAX_TX_POWER] )
|
freqs[NL80211_FREQUENCY_ATTR_MAX_TX_POWER] )
|
||||||
{
|
{
|
||||||
dbm_max = (int)(0.01 * nla_get_u32(
|
dbm_max = (int)(0.01 * nla_get_u32(
|
||||||
|
|
Loading…
Reference in a new issue