X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fllc%2Fllc_station.c;h=6f2ea2090322000f4c28aaf11ae414ed57519c55;hb=3d4d4582e5b3f67a68f2cf32fd5b70d8d80f119d;hp=8275bd33bd9d6b3d0ad2cea55a1c579e14b5f9e5;hpb=5f765b8d68fe99c8a575265d81c62382893e1e8a;p=linux-2.6 diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c index 8275bd33bd..6f2ea20903 100644 --- a/net/llc/llc_station.c +++ b/net/llc/llc_station.c @@ -112,17 +112,17 @@ static struct llc_station llc_main_station; static int llc_stat_ev_enable_with_dup_addr_check(struct sk_buff *skb) { - struct llc_station_state_ev *ev = llc_station_ev(skb); - + struct llc_station_state_ev *ev = llc_station_ev(skb); + return ev->type == LLC_STATION_EV_TYPE_SIMPLE && ev->prim_type == - LLC_STATION_EV_ENABLE_WITH_DUP_ADDR_CHECK ? 0 : 1; + LLC_STATION_EV_ENABLE_WITH_DUP_ADDR_CHECK ? 0 : 1; } static int llc_stat_ev_enable_without_dup_addr_check(struct sk_buff *skb) { - struct llc_station_state_ev *ev = llc_station_ev(skb); - + struct llc_station_state_ev *ev = llc_station_ev(skb); + return ev->type == LLC_STATION_EV_TYPE_SIMPLE && ev->prim_type == LLC_STATION_EV_ENABLE_WITHOUT_DUP_ADDR_CHECK ? 0 : 1; @@ -130,8 +130,8 @@ static int llc_stat_ev_enable_without_dup_addr_check(struct sk_buff *skb) static int llc_stat_ev_ack_tmr_exp_lt_retry_cnt_max_retry(struct sk_buff *skb) { - struct llc_station_state_ev *ev = llc_station_ev(skb); - + struct llc_station_state_ev *ev = llc_station_ev(skb); + return ev->type == LLC_STATION_EV_TYPE_ACK_TMR && llc_main_station.retry_count < llc_main_station.maximum_retry ? 0 : 1; @@ -139,8 +139,8 @@ static int llc_stat_ev_ack_tmr_exp_lt_retry_cnt_max_retry(struct sk_buff *skb) static int llc_stat_ev_ack_tmr_exp_eq_retry_cnt_max_retry(struct sk_buff *skb) { - struct llc_station_state_ev *ev = llc_station_ev(skb); - + struct llc_station_state_ev *ev = llc_station_ev(skb); + return ev->type == LLC_STATION_EV_TYPE_ACK_TMR && llc_main_station.retry_count == llc_main_station.maximum_retry ? 0 : 1; @@ -148,7 +148,7 @@ static int llc_stat_ev_ack_tmr_exp_eq_retry_cnt_max_retry(struct sk_buff *skb) static int llc_stat_ev_rx_null_dsap_xid_c(struct sk_buff *skb) { - struct llc_station_state_ev *ev = llc_station_ev(skb); + struct llc_station_state_ev *ev = llc_station_ev(skb); struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb); return ev->type == LLC_STATION_EV_TYPE_PDU && @@ -306,7 +306,7 @@ static int llc_station_ac_send_test_r(struct sk_buff *skb) llc_pdu_decode_sa(skb, mac_da); llc_pdu_decode_ssap(skb, &dsap); llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); - llc_pdu_init_as_test_rsp(nskb, skb); + llc_pdu_init_as_test_rsp(nskb, skb); rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da); if (unlikely(rc)) goto free; @@ -688,9 +688,8 @@ int __init llc_station_init(void) skb_queue_head_init(&llc_main_station.mac_pdu_q); skb_queue_head_init(&llc_main_station.ev_q.list); spin_lock_init(&llc_main_station.ev_q.lock); - init_timer(&llc_main_station.ack_timer); - llc_main_station.ack_timer.data = (unsigned long)&llc_main_station; - llc_main_station.ack_timer.function = llc_station_ack_tmr_cb; + setup_timer(&llc_main_station.ack_timer, llc_station_ack_tmr_cb, + (unsigned long)&llc_main_station); llc_main_station.ack_timer.expires = jiffies + sysctl_llc_station_ack_timeout; skb = alloc_skb(0, GFP_ATOMIC);