diff options
| author | Stephen Hemminger <shemminger@osdl.org> | 2006-05-25 18:08:30 -0400 |
|---|---|---|
| committer | David S. Miller <davem@sunset.davemloft.net> | 2006-06-18 00:26:00 -0400 |
| commit | aecbd4e45c2e469e0452ffb2c0b0d881e2815bb8 (patch) | |
| tree | 4e5a1e9e2625287acfcb27e693c634700bf57611 | |
| parent | 17f3ae08b6e7fd778371f2cafbd1c988a67ee343 (diff) | |
[LLC]: use more efficient ether address routines
Use more cache efficient Ethernet address manipulation functions
in etherdevice.h.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
| -rw-r--r-- | include/net/llc_if.h | 13 | ||||
| -rw-r--r-- | net/llc/llc_if.c | 2 |
2 files changed, 6 insertions, 9 deletions
diff --git a/include/net/llc_if.h b/include/net/llc_if.h index 090eaa0d71f9..a05d04ac4513 100644 --- a/include/net/llc_if.h +++ b/include/net/llc_if.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/if.h> | 16 | #include <linux/if.h> |
| 17 | #include <linux/if_arp.h> | 17 | #include <linux/if_arp.h> |
| 18 | #include <linux/llc.h> | 18 | #include <linux/llc.h> |
| 19 | #include <linux/etherdevice.h> | ||
| 19 | #include <net/llc.h> | 20 | #include <net/llc.h> |
| 20 | 21 | ||
| 21 | #define LLC_DATAUNIT_PRIM 1 | 22 | #define LLC_DATAUNIT_PRIM 1 |
| @@ -61,8 +62,6 @@ | |||
| 61 | #define LLC_STATUS_CONFLICT 7 /* disconnect conn */ | 62 | #define LLC_STATUS_CONFLICT 7 /* disconnect conn */ |
| 62 | #define LLC_STATUS_RESET_DONE 8 /* */ | 63 | #define LLC_STATUS_RESET_DONE 8 /* */ |
| 63 | 64 | ||
| 64 | extern u8 llc_mac_null_var[IFHWADDRLEN]; | ||
| 65 | |||
| 66 | /** | 65 | /** |
| 67 | * llc_mac_null - determines if a address is a null mac address | 66 | * llc_mac_null - determines if a address is a null mac address |
| 68 | * @mac: Mac address to test if null. | 67 | * @mac: Mac address to test if null. |
| @@ -70,12 +69,12 @@ extern u8 llc_mac_null_var[IFHWADDRLEN]; | |||
| 70 | * Determines if a given address is a null mac address. Returns 0 if the | 69 | * Determines if a given address is a null mac address. Returns 0 if the |
| 71 | * address is not a null mac, 1 if the address is a null mac. | 70 | * address is not a null mac, 1 if the address is a null mac. |
| 72 | */ | 71 | */ |
| 73 | static __inline__ int llc_mac_null(u8 *mac) | 72 | static inline int llc_mac_null(const u8 *mac) |
| 74 | { | 73 | { |
| 75 | return !memcmp(mac, llc_mac_null_var, IFHWADDRLEN); | 74 | return is_zero_ether_addr(mac); |
| 76 | } | 75 | } |
| 77 | 76 | ||
| 78 | static __inline__ int llc_addrany(struct llc_addr *addr) | 77 | static inline int llc_addrany(const struct llc_addr *addr) |
| 79 | { | 78 | { |
| 80 | return llc_mac_null(addr->mac) && !addr->lsap; | 79 | return llc_mac_null(addr->mac) && !addr->lsap; |
| 81 | } | 80 | } |
| @@ -89,9 +88,9 @@ static __inline__ int llc_addrany(struct llc_addr *addr) | |||
| 89 | * is not a complete match up to len, 1 if a complete match up to len is | 88 | * is not a complete match up to len, 1 if a complete match up to len is |
| 90 | * found. | 89 | * found. |
| 91 | */ | 90 | */ |
| 92 | static __inline__ int llc_mac_match(u8 *mac1, u8 *mac2) | 91 | static inline int llc_mac_match(const u8 *mac1, const u8 *mac2) |
| 93 | { | 92 | { |
| 94 | return !memcmp(mac1, mac2, IFHWADDRLEN); | 93 | return !compare_ether_addr(mac1, mac2); |
| 95 | } | 94 | } |
| 96 | 95 | ||
| 97 | extern int llc_establish_connection(struct sock *sk, u8 *lmac, | 96 | extern int llc_establish_connection(struct sock *sk, u8 *lmac, |
diff --git a/net/llc/llc_if.c b/net/llc/llc_if.c index ba90f7f0801a..5ae47be7dde0 100644 --- a/net/llc/llc_if.c +++ b/net/llc/llc_if.c | |||
| @@ -26,8 +26,6 @@ | |||
| 26 | #include <net/llc_c_st.h> | 26 | #include <net/llc_c_st.h> |
| 27 | #include <net/tcp_states.h> | 27 | #include <net/tcp_states.h> |
| 28 | 28 | ||
| 29 | u8 llc_mac_null_var[IFHWADDRLEN]; | ||
| 30 | |||
| 31 | /** | 29 | /** |
| 32 | * llc_build_and_send_pkt - Connection data sending for upper layers. | 30 | * llc_build_and_send_pkt - Connection data sending for upper layers. |
| 33 | * @sk: connection | 31 | * @sk: connection |
