aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-09-22 02:50:15 -0400
committerArnaldo Carvalho de Melo <acme@mandriva.com>2005-09-22 02:50:15 -0400
commite0dd55190ff8c6485a721c9473ded92d03c0fe01 (patch)
tree52a00bdf50392b457e2eaf5b6c8fddd6d9726366 /net
parent838a75dae05d59b7d7894c299508ae3d7dea9630 (diff)
[LLC]: introduce llc_conn_tmr_common_cb, to avoid code duplication
Signed-off-by: Jochen Friedrich <jochen@scram.de> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net')
-rw-r--r--net/llc/llc_c_ac.c48
1 files changed, 10 insertions, 38 deletions
diff --git a/net/llc/llc_c_ac.c b/net/llc/llc_c_ac.c
index 9abaecceea68..50c827e13a9f 100644
--- a/net/llc/llc_c_ac.c
+++ b/net/llc/llc_c_ac.c
@@ -1326,7 +1326,7 @@ int llc_conn_ac_inc_vs_by_1(struct sock *sk, struct sk_buff *skb)
1326 return 0; 1326 return 0;
1327} 1327}
1328 1328
1329void llc_conn_pf_cycle_tmr_cb(unsigned long timeout_data) 1329static void llc_conn_tmr_common_cb(unsigned long timeout_data, u8 type)
1330{ 1330{
1331 struct sock *sk = (struct sock *)timeout_data; 1331 struct sock *sk = (struct sock *)timeout_data;
1332 struct sk_buff *skb = alloc_skb(0, GFP_ATOMIC); 1332 struct sk_buff *skb = alloc_skb(0, GFP_ATOMIC);
@@ -1336,58 +1336,30 @@ void llc_conn_pf_cycle_tmr_cb(unsigned long timeout_data)
1336 struct llc_conn_state_ev *ev = llc_conn_ev(skb); 1336 struct llc_conn_state_ev *ev = llc_conn_ev(skb);
1337 1337
1338 skb->sk = sk; 1338 skb->sk = sk;
1339 ev->type = LLC_CONN_EV_TYPE_P_TMR; 1339 ev->type = type;
1340 llc_process_tmr_ev(sk, skb); 1340 llc_process_tmr_ev(sk, skb);
1341 } 1341 }
1342 bh_unlock_sock(sk); 1342 bh_unlock_sock(sk);
1343} 1343}
1344 1344
1345void llc_conn_busy_tmr_cb(unsigned long timeout_data) 1345void llc_conn_pf_cycle_tmr_cb(unsigned long timeout_data)
1346{ 1346{
1347 struct sock *sk = (struct sock *)timeout_data; 1347 llc_conn_tmr_common_cb(timeout_data, LLC_CONN_EV_TYPE_P_TMR);
1348 struct sk_buff *skb = alloc_skb(0, GFP_ATOMIC); 1348}
1349
1350 bh_lock_sock(sk);
1351 if (skb) {
1352 struct llc_conn_state_ev *ev = llc_conn_ev(skb);
1353 1349
1354 skb->sk = sk; 1350void llc_conn_busy_tmr_cb(unsigned long timeout_data)
1355 ev->type = LLC_CONN_EV_TYPE_BUSY_TMR; 1351{
1356 llc_process_tmr_ev(sk, skb); 1352 llc_conn_tmr_common_cb(timeout_data, LLC_CONN_EV_TYPE_BUSY_TMR);
1357 }
1358 bh_unlock_sock(sk);
1359} 1353}
1360 1354
1361void llc_conn_ack_tmr_cb(unsigned long timeout_data) 1355void llc_conn_ack_tmr_cb(unsigned long timeout_data)
1362{ 1356{
1363 struct sock* sk = (struct sock *)timeout_data; 1357 llc_conn_tmr_common_cb(timeout_data, LLC_CONN_EV_TYPE_ACK_TMR);
1364 struct sk_buff *skb = alloc_skb(0, GFP_ATOMIC);
1365
1366 bh_lock_sock(sk);
1367 if (skb) {
1368 struct llc_conn_state_ev *ev = llc_conn_ev(skb);
1369
1370 skb->sk = sk;
1371 ev->type = LLC_CONN_EV_TYPE_ACK_TMR;
1372 llc_process_tmr_ev(sk, skb);
1373 }
1374 bh_unlock_sock(sk);
1375} 1358}
1376 1359
1377void llc_conn_rej_tmr_cb(unsigned long timeout_data) 1360void llc_conn_rej_tmr_cb(unsigned long timeout_data)
1378{ 1361{
1379 struct sock *sk = (struct sock *)timeout_data; 1362 llc_conn_tmr_common_cb(timeout_data, LLC_CONN_EV_TYPE_REJ_TMR);
1380 struct sk_buff *skb = alloc_skb(0, GFP_ATOMIC);
1381
1382 bh_lock_sock(sk);
1383 if (skb) {
1384 struct llc_conn_state_ev *ev = llc_conn_ev(skb);
1385
1386 skb->sk = sk;
1387 ev->type = LLC_CONN_EV_TYPE_REJ_TMR;
1388 llc_process_tmr_ev(sk, skb);
1389 }
1390 bh_unlock_sock(sk);
1391} 1363}
1392 1364
1393int llc_conn_ac_rst_vs(struct sock *sk, struct sk_buff *skb) 1365int llc_conn_ac_rst_vs(struct sock *sk, struct sk_buff *skb)