CC ?= "gcc"
CFLAGS ?= -O2 -g
-CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
+CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common \
+ -Werror-implicit-function-declaration -Wsign-compare
OBJS = iw.o genl.o event.o info.o phy.o \
interface.o ibss.o station.o survey.o util.o ocb.o \
static int parse_vht_chunk(const char *arg, __u8 *nss, __u16 *mcs)
{
- int count, i;
+ unsigned int count, i;
unsigned int inss, mcs_start, mcs_end, tab[10];
*nss = 0; *mcs = 0;
{
uint8_t *frame;
size_t len;
- int i;
+ unsigned int i;
char macbuf[6*3];
uint16_t tmp;
static int get_cf1(const struct chanmode *chanmode, unsigned long freq)
{
- int cf1 = freq, j;
- int vht80[] = { 5180, 5260, 5500, 5580, 5660, 5745 };
+ unsigned int cf1 = freq, j;
+ unsigned int vht80[] = { 5180, 5260, 5500, 5580, 5660, 5745 };
switch (chanmode->width) {
case NL80211_CHAN_WIDTH_80:
char *value = NULL, *sptr = NULL;
float rate;
int bintval;
- int i;
+ unsigned int i;
unsigned long freq;
const struct chanmode *chanmode_selected = NULL;
static const struct chanmode chanmode[] = {
if (tb_wowlan[NL80211_WOWLAN_TRIG_MAGIC_PKT])
printf("\t\t * wake up on magic packet\n");
if (tb_wowlan[NL80211_WOWLAN_TRIG_PKT_PATTERN]) {
+ unsigned int len = nla_len(tb_wowlan[NL80211_WOWLAN_TRIG_PKT_PATTERN]);
+
pat = nla_data(tb_wowlan[NL80211_WOWLAN_TRIG_PKT_PATTERN]);
printf("\t\t * wake up on pattern match, up to %u patterns of %u-%u bytes,\n"
"\t\t maximum packet offset %u bytes\n",
pat->max_patterns, pat->min_pattern_len, pat->max_pattern_len,
- (nla_len(tb_wowlan[NL80211_WOWLAN_TRIG_PKT_PATTERN]) <
- sizeof(*pat)) ? 0 : pat->max_pkt_offset);
+ len < sizeof(*pat) ? 0 : pat->max_pkt_offset);
}
if (tb_wowlan[NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED])
printf("\t\t * can do GTK rekeying\n");
if (tb_msg[NL80211_ATTR_HT_CAPABILITY_MASK]) {
struct ieee80211_ht_cap *cm;
+ unsigned int len = nla_len(tb_msg[NL80211_ATTR_HT_CAPABILITY_MASK]);
+
printf("\tHT Capability overrides:\n");
- if (nla_len(tb_msg[NL80211_ATTR_HT_CAPABILITY_MASK]) >= sizeof(*cm)) {
+ if (len >= sizeof(*cm)) {
cm = nla_data(tb_msg[NL80211_ATTR_HT_CAPABILITY_MASK]);
printf("\t\t * MCS: %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx"
" %02hhx %02hhx %02hhx %02hhx\n",
static void print_all_mesh_param_descr(void)
{
- int i;
+ unsigned int i;
printf("Possible mesh parameters are:\n");
static const struct mesh_param_descr *find_mesh_param(const char *name)
{
- int i;
+ unsigned int i;
/* Find out what mesh parameter we want to change. */
for (i = 0; i < ARRAY_SIZE(_mesh_param_descrs); i++) {
return -EINVAL;
if (!mdescr) {
- int i;
+ unsigned int i;
for (i = 0; i < ARRAY_SIZE(_mesh_param_descrs); i++) {
mdescr = &_mesh_param_descrs[i];
struct nlattr *container;
float rate;
unsigned char rates[NL80211_MAX_SUPP_RATES];
- int bintval, dtim_period, i, n_rates = 0;
+ int bintval, dtim_period, n_rates = 0;
char *end, *value = NULL, *sptr = NULL;
+ unsigned int i;
unsigned long freq = 0;
static const struct {
const char *name;
{
unsigned long freq;
char *end;
- int i;
+ unsigned int i;
static const struct {
const char *name;
unsigned int width;
{ .name = "160", .val = NL80211_CHAN_WIDTH_160, },
};
uint32_t freq;
- int i, bwval = NL80211_CHAN_WIDTH_20_NOHT;
+ unsigned int i, bwval = NL80211_CHAN_WIDTH_20_NOHT;
char *end;
if (argc < 1)
};
unsigned int htval = NL80211_CHAN_NO_HT;
unsigned int freq;
- int i;
+ unsigned int i;
if (!argc || argc > 4)
return 1;
void iw_hexdump(const char *prefix, const __u8 *buf, size_t size)
{
- int i;
+ size_t i;
printf("%s: ", prefix);
for (i = 0; i < size; i++) {
static int read_file(FILE *file, char *buf, size_t size)
{
- int data, count = 0;
+ size_t count = 0;
+ int data;
while ((data = fgetc(file)) != EOF) {
if (count >= size)
return count;
}
-static int read_hex(int argc, char **argv, char *buf, size_t size)
+static int read_hex(unsigned int argc, char **argv, char *buf, size_t size)
{
- int i, res;
- unsigned int data;
+ unsigned int i, data;
+ int res;
if (argc > size)
return -EINVAL;