Re: [RFC PATCH net-next v0.1 1/1] net: add GeoNetworking protocol
From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-07-19 17:16:39
Also in:
linux-wireless
Can this:
+#define GN_MAX_HEADER_SZ 88
Be defined in terms of:
+#define GN_GUC_HLEN sizeof(struct gn_guc_header) +#define GN_GXC_HLEN sizeof(struct gn_gxc_header) +#define GN_SHB_HLEN sizeof(struct gn_shb_header) +#define GN_TSB_HLEN sizeof(struct gn_tsb_header) +#define GN_BEACON_HLEN sizeof(struct gn_beacon_header) +#define GN_LS_REQUEST_HLEN sizeof(struct gn_ls_request_header) +#define GN_LS_REPLY_HLEN sizeof(struct gn_ls_reply_header) +#define BTP_HLEN sizeof(struct btp_header)
#define GN_MAX_HEADER_SZ (GN_GUC_HLEN + GN_GXC_HLEN + GN_SHB_HLEN + GN_TSB_HLEN + ...) Doing it like this makes it also documentation, the assumption is, the biggest header contains these sub headers.
+/**
+ * struct gn_iface - GeoNetworking interface
+ * @dev - Network device associated with this interface
+ * @address - Our address
+ * @local_sn - Current sequence number
+ */
+struct gn_iface {
+ struct net_device *dev;
+ gn_address_t address;
+ struct gn_position pos;
+ atomic_t local_sn;
+ struct hlist_node hnode;
+ struct rcu_head rcu;
+};It does not look like all members have the same indentation here. I would suggest they are all indented to the same level, or none are indented. This is a general comment for the code as a whole.
+enum ITS_TYPE {
+ UNKNOWN,It is typical to use UNKNOWN = 0,
+ PEDESTRIAN, + CYCLIST,
and then the rest without explicit values. I don't know what the C standard says, but maybe without the = 0, a language lawyer might argue it is allowed to start at 42 and count upwards from there?
+ MOPED, + MOTORCYCLE,
Are these from the standard? Maybe reference the clause in the standard? The point being, we reviewers want to know if random developer can add HOT_AIR_BALLOON, and HORSE_AND_TRAP at the end, or if additions must first be accepted at the standards level and assigned numbers. Andrew