From: Luis Henriques <hidden> Date: 2016-02-08 22:27:32
Several network-related data structures are defined in gelic_udbg.
These could be easily dropped and the standard ones defined in network
headers could be used instead.
The 4 patches that follow replace ethernet, vlan, ip and udp
structures in gelic_udbg. Note that this has been compile-tested
only.
Changes since v1:
Include changes suggested by Joe Perches, namely the usage of
eth_broadcast_addr(), ETH_ALEN, ETH_P_8021Q and ETH_P_IP.
Luis Henriques (4):
powerpc/ps3: gelic_udbg: use struct ethhdr from <linux/if_ether.h>
powerpc/ps3: gelic_udbg: use struct vlan_hdr from <linux/if_vlan.h>
powerpc/ps3: gelic_udbg: use struct iphdr from <linux/ip.h>
powerpc/ps3: gelic_udbg: use struct udphdr from <linux/udp.h>
arch/powerpc/platforms/ps3/gelic_udbg.c | 72 +++++++++++----------------------
1 file changed, 24 insertions(+), 48 deletions(-)
From: Luis Henriques <hidden> Date: 2016-02-08 22:27:27
Instead of defining a local version of struct ethhdr use the standard
definition from <linux/if_ether.h>.
The fields in the <linux/if_ether.h> definition have different names:
- dest -> h_dest
- src -> h_source
- type -> h_proto
While there, use a few other standard functions/macros:
- eth_broadcast_addr (instead of a memset)
- ETH_ALEN
- ETH_P_8021Q
Signed-off-by: Luis Henriques <redacted>
---
arch/powerpc/platforms/ps3/gelic_udbg.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
From: Luis Henriques <hidden> Date: 2016-02-08 22:27:30
Instead of defining a local version of struct udphdr use the standard
definition from <linux/udp.h>.
The 'src' field is named 'source' in the <linux/udp.h> definition.
Signed-off-by: Luis Henriques <redacted>
---
arch/powerpc/platforms/ps3/gelic_udbg.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
From: Luis Henriques <hidden> Date: 2016-02-08 22:27:33
Instead of defining a local version of struct iphdr use the standard
definition from <linux/ip.h>.
Several fields in the <linux/ip.h> definition have different names:
- proto -> protocol
- src -> saddr
- dest -> daddr
- total_length -> tot_len
- checksum -> check
Also, 'ver_len' is composed by 'version' and 'ihl' in <linux/ip.h>.
Signed-off-by: Luis Henriques <redacted>
---
arch/powerpc/platforms/ps3/gelic_udbg.c | 29 +++++++++--------------------
1 file changed, 9 insertions(+), 20 deletions(-)
From: Luis Henriques <hidden> Date: 2016-02-08 22:28:22
Instead of defining the local struct vlantag use the standard definition
of vlan_hdr from <linux/if_vlan.h>.
The fields in the <linux/if_vlan.h> definition have different names:
- vlan -> h_vlan_TCI
- subtype -> h_vlan_encapsulated_proto
While there, use also the ETH_P_IP macro instead of an hard-coded 0x0800
value.
Signed-off-by: Luis Henriques <redacted>
---
arch/powerpc/platforms/ps3/gelic_udbg.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-02-09 02:54:16
On Mon, 2016-02-08 at 22:27 +0000, Luis Henriques wrote:
Several network-related data structures are defined in gelic_udbg.
These could be easily dropped and the standard ones defined in network
headers could be used instead.
The 4 patches that follow replace ethernet, vlan, ip and udp
structures in gelic_udbg. Note that this has been compile-tested
only.
Changes since v1:
Include changes suggested by Joe Perches, namely the usage of
eth_broadcast_addr(), ETH_ALEN, ETH_P_8021Q and ETH_P_IP.
Luis Henriques (4):
powerpc/ps3: gelic_udbg: use struct ethhdr from <linux/if_ether.h>
powerpc/ps3: gelic_udbg: use struct vlan_hdr from <linux/if_vlan.h>
powerpc/ps3: gelic_udbg: use struct iphdr from <linux/ip.h>
powerpc/ps3: gelic_udbg: use struct udphdr from <linux/udp.h>
These look good. But I don't have a setup to test them, does anyone?
I'll merge them and hopefully someone can test them at some point.
cheers
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-03-01 22:21:22
On Mon, 2016-08-02 at 22:27:04 UTC, Luis Henriques wrote:
Instead of defining a local version of struct ethhdr use the standard
definition from <linux/if_ether.h>.
The fields in the <linux/if_ether.h> definition have different names:
- dest -> h_dest
- src -> h_source
- type -> h_proto
While there, use a few other standard functions/macros:
- eth_broadcast_addr (instead of a memset)
- ETH_ALEN
- ETH_P_8021Q
Signed-off-by: Luis Henriques <redacted>