static void spl2sw_check_mac_vendor_id_and_convert(u8 *mac_addr)
{
- u8 tmp;
-
/* Byte order of MAC address of some samples are reversed.
* Check vendor id and convert byte order if it is wrong.
* OUI of Sunplus: fc:4b:bc
*/
if (mac_addr[5] == 0xfc && mac_addr[4] == 0x4b && mac_addr[3] == 0xbc &&
(mac_addr[0] != 0xfc || mac_addr[1] != 0x4b || mac_addr[2] != 0xbc)) {
- /* Swap mac_addr[0] and mac_addr[5] */
- tmp = mac_addr[0];
- mac_addr[0] = mac_addr[5];
- mac_addr[5] = tmp;
-
- /* Swap mac_addr[1] and mac_addr[4] */
- tmp = mac_addr[1];
- mac_addr[1] = mac_addr[4];
- mac_addr[4] = tmp;
-
- /* Swap mac_addr[2] and mac_addr[3] */
- tmp = mac_addr[2];
- mac_addr[2] = mac_addr[3];
- mac_addr[3] = tmp;
+
+ swap(mac_addr[0], mac_addr[5]);
+ swap(mac_addr[1], mac_addr[4]);
+ swap(mac_addr[2], mac_addr[3]);
}
}