diff options
Diffstat (limited to 'include/net/llc_pdu.h')
| -rw-r--r-- | include/net/llc_pdu.h | 52 | 
1 files changed, 22 insertions, 30 deletions
diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h index 75b8e2968c9..c0f0a13ed81 100644 --- a/include/net/llc_pdu.h +++ b/include/net/llc_pdu.h @@ -13,7 +13,6 @@   */  #include <linux/if_ether.h> -#include <linux/if_tr.h>  /* Lengths of frame formats */  #define LLC_PDU_LEN_I	4       /* header and 2 control bytes */ @@ -143,7 +142,7 @@  #define LLC_S_PF_IS_1(pdu)     ((pdu->ctrl_2 & LLC_S_PF_BIT_MASK) ? 1 : 0)  #define PDU_SUPV_GET_Nr(pdu)   ((pdu->ctrl_2 & 0xFE) >> 1) -#define PDU_GET_NEXT_Vr(sn)    (++sn & ~LLC_2_SEQ_NBR_MODULO) +#define PDU_GET_NEXT_Vr(sn)    (((sn) + 1) & ~LLC_2_SEQ_NBR_MODULO)  /* FRMR information field macros */ @@ -199,7 +198,7 @@ struct llc_pdu_sn {  	u8 ssap;  	u8 ctrl_1;  	u8 ctrl_2; -}; +} __packed;  static inline struct llc_pdu_sn *llc_pdu_sn_hdr(struct sk_buff *skb)  { @@ -211,7 +210,7 @@ struct llc_pdu_un {  	u8 dsap;  	u8 ssap;  	u8 ctrl_1; -}; +} __packed;  static inline struct llc_pdu_un *llc_pdu_un_hdr(struct sk_buff *skb)  { @@ -253,10 +252,6 @@ static inline void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa)  {  	if (skb->protocol == htons(ETH_P_802_2))  		memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN); -	else if (skb->protocol == htons(ETH_P_TR_802_2)) { -		memcpy(sa, tr_hdr(skb)->saddr, ETH_ALEN); -		*sa &= 0x7F; -	}  }  /** @@ -270,8 +265,6 @@ static inline void llc_pdu_decode_da(struct sk_buff *skb, u8 *da)  {  	if (skb->protocol == htons(ETH_P_802_2))  		memcpy(da, eth_hdr(skb)->h_dest, ETH_ALEN); -	else if (skb->protocol == htons(ETH_P_TR_802_2)) -		memcpy(da, tr_hdr(skb)->daddr, ETH_ALEN);  }  /** @@ -359,7 +352,7 @@ struct llc_xid_info {  	u8 fmt_id;	/* always 0x81 for LLC */  	u8 type;	/* different if NULL/non-NULL LSAP */  	u8 rw;		/* sender receive window */ -}; +} __packed;  /**   *	llc_pdu_init_as_xid_cmd - sets bytes 3, 4 & 5 of LLC header as XID @@ -415,23 +408,22 @@ struct llc_frmr_info {  	u8  curr_ssv;		/* current send state variable val */  	u8  curr_rsv;		/* current receive state variable */  	u8  ind_bits;		/* indicator bits set with macro */ -}; - -extern void llc_pdu_set_cmd_rsp(struct sk_buff *skb, u8 type); -extern void llc_pdu_set_pf_bit(struct sk_buff *skb, u8 bit_value); -extern void llc_pdu_decode_pf_bit(struct sk_buff *skb, u8 *pf_bit); -extern void llc_pdu_init_as_disc_cmd(struct sk_buff *skb, u8 p_bit); -extern void llc_pdu_init_as_i_cmd(struct sk_buff *skb, u8 p_bit, u8 ns, u8 nr); -extern void llc_pdu_init_as_rej_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); -extern void llc_pdu_init_as_rnr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); -extern void llc_pdu_init_as_rr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); -extern void llc_pdu_init_as_sabme_cmd(struct sk_buff *skb, u8 p_bit); -extern void llc_pdu_init_as_dm_rsp(struct sk_buff *skb, u8 f_bit); -extern void llc_pdu_init_as_frmr_rsp(struct sk_buff *skb, -				     struct llc_pdu_sn *prev_pdu, -				     u8 f_bit, u8 vs, u8 vr, u8 vzyxw); -extern void llc_pdu_init_as_rr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); -extern void llc_pdu_init_as_rej_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); -extern void llc_pdu_init_as_rnr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); -extern void llc_pdu_init_as_ua_rsp(struct sk_buff *skb, u8 f_bit); +} __packed; + +void llc_pdu_set_cmd_rsp(struct sk_buff *skb, u8 type); +void llc_pdu_set_pf_bit(struct sk_buff *skb, u8 bit_value); +void llc_pdu_decode_pf_bit(struct sk_buff *skb, u8 *pf_bit); +void llc_pdu_init_as_disc_cmd(struct sk_buff *skb, u8 p_bit); +void llc_pdu_init_as_i_cmd(struct sk_buff *skb, u8 p_bit, u8 ns, u8 nr); +void llc_pdu_init_as_rej_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); +void llc_pdu_init_as_rnr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); +void llc_pdu_init_as_rr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); +void llc_pdu_init_as_sabme_cmd(struct sk_buff *skb, u8 p_bit); +void llc_pdu_init_as_dm_rsp(struct sk_buff *skb, u8 f_bit); +void llc_pdu_init_as_frmr_rsp(struct sk_buff *skb, struct llc_pdu_sn *prev_pdu, +			      u8 f_bit, u8 vs, u8 vr, u8 vzyxw); +void llc_pdu_init_as_rr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); +void llc_pdu_init_as_rej_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); +void llc_pdu_init_as_rnr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); +void llc_pdu_init_as_ua_rsp(struct sk_buff *skb, u8 f_bit);  #endif /* LLC_PDU_H */  | 
