Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 376b7bd3 authored by Phoebe Buckheister's avatar Phoebe Buckheister Committed by David S. Miller
Browse files

ieee802154: rename struct ieee802154_addr to *_sa



The struct as currently defined uses host byte order for some fields,
and most big endian/EUI display byte order for other fields. Inside the
stack, endianness should ideally match network byte order where possible
to minimize the number of byteswaps done in critical paths, but this
patch does not address this; it is only preparatory.

Signed-off-by: default avatarPhoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 17794326
Loading
Loading
Loading
Loading
+7 −7
Original line number Original line Diff line number Diff line
@@ -119,7 +119,7 @@ static u8 fake_get_dsn(const struct net_device *dev)
 *       802.15.4-2006 document.
 *       802.15.4-2006 document.
 */
 */
static int fake_assoc_req(struct net_device *dev,
static int fake_assoc_req(struct net_device *dev,
		struct ieee802154_addr *addr, u8 channel, u8 page, u8 cap)
		struct ieee802154_addr_sa *addr, u8 channel, u8 page, u8 cap)
{
{
	struct wpan_phy *phy = fake_to_phy(dev);
	struct wpan_phy *phy = fake_to_phy(dev);


@@ -149,7 +149,7 @@ static int fake_assoc_req(struct net_device *dev,
 *       802.15.4-2006 document.
 *       802.15.4-2006 document.
 */
 */
static int fake_assoc_resp(struct net_device *dev,
static int fake_assoc_resp(struct net_device *dev,
		struct ieee802154_addr *addr, u16 short_addr, u8 status)
		struct ieee802154_addr_sa *addr, u16 short_addr, u8 status)
{
{
	return 0;
	return 0;
}
}
@@ -167,7 +167,7 @@ static int fake_assoc_resp(struct net_device *dev,
 *       document, with the reason described in 7.3.3.2.
 *       document, with the reason described in 7.3.3.2.
 */
 */
static int fake_disassoc_req(struct net_device *dev,
static int fake_disassoc_req(struct net_device *dev,
		struct ieee802154_addr *addr, u8 reason)
		struct ieee802154_addr_sa *addr, u8 reason)
{
{
	return ieee802154_nl_disassoc_confirm(dev, IEEE802154_SUCCESS);
	return ieee802154_nl_disassoc_confirm(dev, IEEE802154_SUCCESS);
}
}
@@ -191,8 +191,8 @@ static int fake_disassoc_req(struct net_device *dev,
 * Note: This is in section 7.5.2.3 of the IEEE 802.15.4-2006
 * Note: This is in section 7.5.2.3 of the IEEE 802.15.4-2006
 * document, with 7.3.8 describing coordinator realignment.
 * document, with 7.3.8 describing coordinator realignment.
 */
 */
static int fake_start_req(struct net_device *dev, struct ieee802154_addr *addr,
static int fake_start_req(struct net_device *dev,
				u8 channel, u8 page,
			  struct ieee802154_addr_sa *addr, u8 channel, u8 page,
			  u8 bcn_ord, u8 sf_ord, u8 pan_coord, u8 blx,
			  u8 bcn_ord, u8 sf_ord, u8 pan_coord, u8 blx,
			  u8 coord_realign)
			  u8 coord_realign)
{
{
+2 −2
Original line number Original line Diff line number Diff line
@@ -36,7 +36,7 @@ enum {
/* address length, octets */
/* address length, octets */
#define IEEE802154_ADDR_LEN	8
#define IEEE802154_ADDR_LEN	8


struct ieee802154_addr {
struct ieee802154_addr_sa {
	int addr_type;
	int addr_type;
	u16 pan_id;
	u16 pan_id;
	union {
	union {
@@ -51,7 +51,7 @@ struct ieee802154_addr {


struct sockaddr_ieee802154 {
struct sockaddr_ieee802154 {
	sa_family_t family; /* AF_IEEE802154 */
	sa_family_t family; /* AF_IEEE802154 */
	struct ieee802154_addr addr;
	struct ieee802154_addr_sa addr;
};
};


/* get/setsockopt */
/* get/setsockopt */
+6 −6
Original line number Original line Diff line number Diff line
@@ -41,8 +41,8 @@ struct ieee802154_frag_info {
 */
 */
struct ieee802154_mac_cb {
struct ieee802154_mac_cb {
	u8 lqi;
	u8 lqi;
	struct ieee802154_addr sa;
	struct ieee802154_addr_sa sa;
	struct ieee802154_addr da;
	struct ieee802154_addr_sa da;
	u8 flags;
	u8 flags;
	u8 seq;
	u8 seq;
	struct ieee802154_frag_info frag_info;
	struct ieee802154_frag_info frag_info;
@@ -95,16 +95,16 @@ struct ieee802154_mlme_ops {
	/* The following fields are optional (can be NULL). */
	/* The following fields are optional (can be NULL). */


	int (*assoc_req)(struct net_device *dev,
	int (*assoc_req)(struct net_device *dev,
			struct ieee802154_addr *addr,
			struct ieee802154_addr_sa *addr,
			u8 channel, u8 page, u8 cap);
			u8 channel, u8 page, u8 cap);
	int (*assoc_resp)(struct net_device *dev,
	int (*assoc_resp)(struct net_device *dev,
			struct ieee802154_addr *addr,
			struct ieee802154_addr_sa *addr,
			u16 short_addr, u8 status);
			u16 short_addr, u8 status);
	int (*disassoc_req)(struct net_device *dev,
	int (*disassoc_req)(struct net_device *dev,
			struct ieee802154_addr *addr,
			struct ieee802154_addr_sa *addr,
			u8 reason);
			u8 reason);
	int (*start_req)(struct net_device *dev,
	int (*start_req)(struct net_device *dev,
			struct ieee802154_addr *addr,
			struct ieee802154_addr_sa *addr,
			u8 channel, u8 page, u8 bcn_ord, u8 sf_ord,
			u8 channel, u8 page, u8 bcn_ord, u8 sf_ord,
			u8 pan_coord, u8 blx, u8 coord_realign);
			u8 pan_coord, u8 blx, u8 coord_realign);
	int (*scan_req)(struct net_device *dev,
	int (*scan_req)(struct net_device *dev,
+3 −3
Original line number Original line Diff line number Diff line
@@ -22,7 +22,7 @@
#define IEEE802154_NL_H
#define IEEE802154_NL_H


struct net_device;
struct net_device;
struct ieee802154_addr;
struct ieee802154_addr_sa;


/**
/**
 * ieee802154_nl_assoc_indic - Notify userland of an association request.
 * ieee802154_nl_assoc_indic - Notify userland of an association request.
@@ -37,7 +37,7 @@ struct ieee802154_addr;
 * Note: This is in section 7.3.1 of the IEEE 802.15.4-2006 document.
 * Note: This is in section 7.3.1 of the IEEE 802.15.4-2006 document.
 */
 */
int ieee802154_nl_assoc_indic(struct net_device *dev,
int ieee802154_nl_assoc_indic(struct net_device *dev,
		struct ieee802154_addr *addr, u8 cap);
		struct ieee802154_addr_sa *addr, u8 cap);


/**
/**
 * ieee802154_nl_assoc_confirm - Notify userland of association.
 * ieee802154_nl_assoc_confirm - Notify userland of association.
@@ -65,7 +65,7 @@ int ieee802154_nl_assoc_confirm(struct net_device *dev,
 * Note: This is in section 7.3.3 of the IEEE 802.15.4 document.
 * Note: This is in section 7.3.3 of the IEEE 802.15.4 document.
 */
 */
int ieee802154_nl_disassoc_indic(struct net_device *dev,
int ieee802154_nl_disassoc_indic(struct net_device *dev,
		struct ieee802154_addr *addr, u8 reason);
		struct ieee802154_addr_sa *addr, u8 reason);


/**
/**
 * ieee802154_nl_disassoc_confirm - Notify userland of disassociation
 * ieee802154_nl_disassoc_confirm - Notify userland of disassociation
+2 −2
Original line number Original line Diff line number Diff line
@@ -91,7 +91,7 @@ static int lowpan_header_create(struct sk_buff *skb,
{
{
	const u8 *saddr = _saddr;
	const u8 *saddr = _saddr;
	const u8 *daddr = _daddr;
	const u8 *daddr = _daddr;
	struct ieee802154_addr sa, da;
	struct ieee802154_addr_sa sa, da;


	/* TODO:
	/* TODO:
	 * if this package isn't ipv6 one, where should it be routed?
	 * if this package isn't ipv6 one, where should it be routed?
@@ -171,7 +171,7 @@ static int lowpan_give_skb_to_devices(struct sk_buff *skb,
static int process_data(struct sk_buff *skb)
static int process_data(struct sk_buff *skb)
{
{
	u8 iphc0, iphc1;
	u8 iphc0, iphc1;
	const struct ieee802154_addr *_saddr, *_daddr;
	const struct ieee802154_addr_sa *_saddr, *_daddr;


	raw_dump_table(__func__, "raw skb data dump", skb->data, skb->len);
	raw_dump_table(__func__, "raw skb data dump", skb->data, skb->len);
	/* at least two bytes will be used for the encoding */
	/* at least two bytes will be used for the encoding */
Loading