extern void llc_pdu_decode_da(struct sk_buff *skb, u8 *ds);
extern void llc_pdu_decode_dsap(struct sk_buff *skb, u8 *dsap);
extern void llc_pdu_decode_ssap(struct sk_buff *skb, u8 *ssap);
-extern void llc_decode_pdu_type(struct sk_buff *skb, u8 *destination);
extern void llc_pdu_header_init(struct sk_buff *skb, u8 pdu_type, u8 ssap,
u8 dsap, u8 cr);
extern void llc_pdu_init_as_ui_cmd(struct sk_buff *skb);
[LLC_DEST_CONN - 1] = llc_conn_handler,
};
+/**
+ * llc_pdu_type - returns which LLC component must handle for PDU
+ * @skb: input skb
+ *
+ * This function returns which LLC component must handle this PDU.
+ */
+static __inline__ int llc_pdu_type(struct sk_buff *skb)
+{
+ int type = LLC_DEST_CONN; /* I-PDU or S-PDU type */
+ struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb);
+
+ if ((pdu->ctrl_1 & LLC_PDU_TYPE_MASK) != LLC_PDU_TYPE_U)
+ goto out;
+ switch (LLC_U_PDU_CMD(pdu)) {
+ case LLC_1_PDU_CMD_XID:
+ case LLC_1_PDU_CMD_UI:
+ case LLC_1_PDU_CMD_TEST:
+ type = LLC_DEST_SAP;
+ break;
+ case LLC_2_PDU_CMD_SABME:
+ case LLC_2_PDU_CMD_DISC:
+ case LLC_2_PDU_RSP_UA:
+ case LLC_2_PDU_RSP_DM:
+ case LLC_2_PDU_RSP_FRMR:
+ break;
+ default:
+ type = LLC_DEST_INVALID;
+ break;
+ }
+out:
+ return type;
+}
+
/**
* llc_rcv - 802.2 entry point from net lower layers
* @skb: received pdu
{
struct llc_sap *sap;
struct llc_pdu_sn *pdu;
- u8 dest;
+ int dest;
/*
* When the interface is in promisc. mode, drop all the crap that it
sap->rcv_func(skb, dev, pt);
goto out;
}
- llc_decode_pdu_type(skb, &dest);
+ dest = llc_pdu_type(skb);
if (unlikely(!dest || !llc_type_handlers[dest - 1]))
goto drop;
llc_type_handlers[dest - 1](sap, skb);
*type = LLC_PDU_TYPE_I;
}
-/**
- * llc_decode_pdu_type - designates component LLC must handle for PDU
- * @skb: input skb
- * @dest: destination component
- *
- * This function designates which component of LLC must handle this PDU.
- */
-void llc_decode_pdu_type(struct sk_buff *skb, u8 *dest)
-{
- u8 type = LLC_DEST_CONN; /* I-PDU or S-PDU type */
- struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb);
-
- if ((pdu->ctrl_1 & LLC_PDU_TYPE_MASK) != LLC_PDU_TYPE_U)
- goto out;
- switch (LLC_U_PDU_CMD(pdu)) {
- case LLC_1_PDU_CMD_XID:
- case LLC_1_PDU_CMD_UI:
- case LLC_1_PDU_CMD_TEST:
- type = LLC_DEST_SAP;
- break;
- case LLC_2_PDU_CMD_SABME:
- case LLC_2_PDU_CMD_DISC:
- case LLC_2_PDU_RSP_UA:
- case LLC_2_PDU_RSP_DM:
- case LLC_2_PDU_RSP_FRMR:
- break;
- default:
- type = LLC_DEST_INVALID;
- break;
- }
-out:
- *dest = type;
-}
-
/**
* llc_get_hdr_len - designates LLC header length
* @type: type of PDU.