On 06/22/2006 02:55 PM, Andrew Morton wrote:
> - Is there a better way of doing this?
>
> static void ql_swap_mac_addr(u8 * macAddress)
> {
> #ifdef __BIG_ENDIAN
> u8 temp;
> temp = macAddress[0];
> macAddress[0] = macAddress[1];
> macAddress[1] = temp;
> temp = macAddress[2];
> macAddress[2] = macAddress[3];
> macAddress[3] = temp;
> temp = macAddress[4];
> macAddress[4] = macAddress[5];
> macAddress[5] = temp;
> #endif
> }
Perhaps something like:
static void ql_swap_mac_addr(u8 * macAddress)
{
u16 *p = (u16 *)macAddress;
cpu_to_le16s(p);
cpu_to_le16s(p+1);
cpu_to_le16s(p+2);
}
You could use cpu_to_le16s for the version/numPorts conversion too.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html