Exemple #1
0
int sip_send_ampdu_action(struct esp_pub *epub, u8 action_num, const u8 * addr, u16 tid, u16 ssn, u8 buf_size)
{
        u8 index = find_empty_index(epub);
        struct sk_buff *skb = NULL;
        struct sip_cmd_ampdu_action * action;
        if(index < 0)
                return -1;
        skb = sip_alloc_ctrl_skbuf(epub->sip, sizeof(struct sip_cmd_ampdu_action) + sizeof(struct sip_hdr), SIP_CMD_AMPDU_ACTION);
        if(!skb)
                return -1;

        action = (struct sip_cmd_ampdu_action *)(skb->data + sizeof(struct sip_hdr));
        action->action = action_num;
	//for TX, it means interface index
	action->index = ssn;

        switch(action_num) {
        case SIP_AMPDU_RX_START:
                action->ssn = ssn;
        case SIP_AMPDU_RX_STOP:
                action->index = tid;
        case SIP_AMPDU_TX_OPERATIONAL:
        case SIP_AMPDU_TX_STOP:
                action->win_size = buf_size;
                action->tid = tid;
                memcpy(action->addr, addr, ETH_ALEN);
                break;
        }

        return sip_cmd_enqueue(epub->sip, skb);
}
void new_btn(char * str, char x, char y, char bg, char fg, void (*func)())
{
	int i;
	i = find_empty_index();
	strcpy(btn_arr[i].str,str);
	btn_arr[i].x = x;
	btn_arr[i].y = y;
	btn_arr[i].bg = bg;
	btn_arr[i].fg = fg;
	btn_arr[i].func = func;
	
	draw_all();
}