void SET_TXQ_handle(int fd, u8 *buf, int len, void *hapd){ struct hostapd_data *h = hapd; char str[5][10]; buf[len]=0; int i,j=0; int cnt = 0; for(i=0; i<len; i++){ if(buf[i]==' '){ str[cnt][j] = 0; j = 0; cnt++; }else{ str[cnt][j] = buf[i]; j++; } } wl.que[atoi(str[0])].queue_id = atoi(str[0]); wl.que[atoi(str[0])].cwmin = atoi(str[1]); wl.que[atoi(str[0])].cwmax = atoi(str[2]); wl.que[atoi(str[0])].aifs = atoi(str[3]); wl.que[atoi(str[0])].burst_time = atoi(str[4]); int ret = hostapd_set_tx_queue_params(h, wl.que[atoi(str[0])].queue_id, wl.que[atoi(str[0])].aifs, wl.que[atoi(str[0])].cwmin, wl.que[atoi(str[0])].cwmax, wl.que[atoi(str[0])].burst_time); u8 ret_str[10]; sprintf(ret_str, "%d", ret); send_response(fd, SET_TXQ_R, ret_str, strlen(ret_str)); }
static void hostapd_reconfig_tx_queue_params(struct hostapd_data *hapd, struct hostapd_config *newconf, struct hostapd_config *oldconf) { int i; struct hostapd_tx_queue_params *o, *n; for (i = 0; i < NUM_TX_QUEUES; i++) { o = &oldconf->tx_queue[i]; n = &newconf->tx_queue[i]; if (!n->configured) continue; if ((n->aifs != o->aifs || n->cwmin != o->cwmin || n->cwmax != o->cwmax || n->burst != o->burst) && hostapd_set_tx_queue_params(hapd, i, n->aifs, n->cwmin, n->cwmax, n->burst)) printf("Failed to set TX queue parameters for queue %d" ".\n", i); } }