Commit c84af579 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller

[LLC] move sap->rcv_func call to llc_rcv

parent 0284d996
......@@ -63,5 +63,4 @@ extern void llc_station_state_process(struct llc_station *station,
extern void llc_station_send_pdu(struct llc_station *station,
struct sk_buff *skb);
extern struct sk_buff *llc_alloc_frame(void);
extern struct packet_type llc_packet_type;
#endif /* LLC_MAIN_H */
......@@ -42,8 +42,7 @@ struct llc_sap {
extern void llc_sap_assign_sock(struct llc_sap *sap, struct sock *sk);
extern void llc_sap_unassign_sock(struct llc_sap *sap, struct sock *sk);
extern void llc_sap_state_process(struct llc_sap *sap, struct sk_buff *skb,
struct packet_type *pt);
extern void llc_sap_state_process(struct llc_sap *sap, struct sk_buff *skb);
extern void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb);
extern void llc_sap_send_pdu(struct llc_sap *sap, struct sk_buff *skb);
#endif /* LLC_SAP_H */
......@@ -107,7 +107,7 @@ void llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb,
ev->type = LLC_SAP_EV_TYPE_PRIM;
ev->prim = LLC_DATAUNIT_PRIM;
ev->prim_type = LLC_PRIM_TYPE_REQ;
llc_sap_state_process(sap, skb, &llc_packet_type);
llc_sap_state_process(sap, skb);
}
/**
......@@ -133,7 +133,7 @@ void llc_build_and_send_test_pkt(struct llc_sap *sap,
ev->type = LLC_SAP_EV_TYPE_PRIM;
ev->prim = LLC_TEST_PRIM;
ev->prim_type = LLC_PRIM_TYPE_REQ;
llc_sap_state_process(sap, skb, &llc_packet_type);
llc_sap_state_process(sap, skb);
}
/**
......@@ -159,7 +159,7 @@ void llc_build_and_send_xid_pkt(struct llc_sap *sap, struct sk_buff *skb,
ev->type = LLC_SAP_EV_TYPE_PRIM;
ev->prim = LLC_XID_PRIM;
ev->prim_type = LLC_PRIM_TYPE_REQ;
llc_sap_state_process(sap, skb, &llc_packet_type);
llc_sap_state_process(sap, skb);
}
/**
......
......@@ -37,8 +37,7 @@ u8 llc_mac_null_var[IFHWADDRLEN];
static void fix_up_incoming_skb(struct sk_buff *skb);
static void llc_station_rcv(struct sk_buff *skb);
static void llc_sap_rcv(struct llc_sap *sap, struct sk_buff *skb,
struct packet_type *pt);
static void llc_sap_rcv(struct llc_sap *sap, struct sk_buff *skb);
/**
* mac_send_pdu - Sends PDU to specific device.
......@@ -114,16 +113,22 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
}
llc_decode_pdu_type(skb, &dest);
if (dest == LLC_DEST_SAP) { /* type 1 services */
if (sap->rcv_func)
sap->rcv_func(skb, dev, pt);
else {
struct llc_addr laddr;
struct sock *sk;
llc_pdu_decode_da(skb, laddr.mac);
llc_pdu_decode_dsap(skb, &laddr.lsap);
skb->sk = sk = llc_lookup_dgram(sap, &laddr);
llc_sap_rcv(sap, skb, pt);
if (sk)
sk = llc_lookup_dgram(sap, &laddr);
if (!sk)
goto drop;
skb->sk = sk;
llc_sap_rcv(sap, skb);
sock_put(sk);
}
} else if (dest == LLC_DEST_CONN) {
struct llc_addr saddr, daddr;
struct sock *sk;
......@@ -254,18 +259,16 @@ int llc_conn_rcv(struct sock* sk, struct sk_buff *skb)
* llc_sap_rcv - sends received pdus to the sap state machine
* @sap: current sap component structure.
* @skb: received frame.
* @pt: packet type
*
* Sends received pdus to the sap state machine.
*/
static void llc_sap_rcv(struct llc_sap *sap, struct sk_buff *skb,
struct packet_type *pt)
static void llc_sap_rcv(struct llc_sap *sap, struct sk_buff *skb)
{
struct llc_sap_state_ev *ev = llc_sap_ev(skb);
ev->type = LLC_SAP_EV_TYPE_PDU;
ev->reason = 0;
llc_sap_state_process(sap, skb, pt);
llc_sap_state_process(sap, skb);
}
/**
......
......@@ -613,7 +613,7 @@ static int llc_proc_get_info(char *bf, char **start, off_t offset, int length)
return len;
}
struct packet_type llc_packet_type = {
static struct packet_type llc_packet_type = {
.type = __constant_htons(ETH_P_802_2),
.func = llc_rcv,
.data = (void *)1,
......
......@@ -79,14 +79,12 @@ void llc_sap_unassign_sock(struct llc_sap *sap, struct sock *sk)
* llc_sap_state_process - sends event to SAP state machine
* @sap: sap to use
* @skb: pointer to occurred event
* @pt: packet type, for datalink protos
*
* After executing actions of the event, upper layer will be indicated
* if needed(on receiving an UI frame). sk can be null for the
* datalink_proto case.
*/
void llc_sap_state_process(struct llc_sap *sap, struct sk_buff *skb,
struct packet_type *pt)
void llc_sap_state_process(struct llc_sap *sap, struct sk_buff *skb)
{
struct llc_sap_state_ev *ev = llc_sap_ev(skb);
......@@ -99,9 +97,6 @@ void llc_sap_state_process(struct llc_sap *sap, struct sk_buff *skb,
ev->ind_cfm_flag = 0;
llc_sap_next_state(sap, skb);
if (ev->ind_cfm_flag == LLC_IND) {
if (sap->rcv_func)
sap->rcv_func(skb, skb->dev, pt);
else {
if (skb->sk->state == TCP_LISTEN)
kfree_skb(skb);
else {
......@@ -112,7 +107,6 @@ void llc_sap_state_process(struct llc_sap *sap, struct sk_buff *skb,
kfree_skb(skb);
}
}
}
kfree_skb(skb);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment