00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include <include.h>
00029 #include <src/manuf.h>
00030 #include <src/manuf_table.h>
00031
00032
00033
00034
00035 char *AddMacToManufName(char AddMac[WLAN_ADDR_LEN])
00036 {
00037
00038 UINT16 i;
00039 UINT32 MAC;
00040
00041 #ifdef WORDS_BIGENDIAN
00042
00043 MAC = (UINT32) AddMac;
00044 #else
00045
00046 MAC =
00047 (UINT32) (((AddMac[3])) + ((AddMac[2]) << 8) +
00048 ((AddMac[1]) << 16) + ((AddMac[0]) << 24));
00049 #endif
00050 for (i = 0; i < SIZE_OF_MANUF_TABLE; i++) {
00051 if (MAC == manuf_mac_table[i]) {
00052 break;
00053 }
00054 }
00055
00056 if (i == SIZE_OF_MANUF_TABLE) {
00057 #ifdef WORDS_BIGENDIAN
00058
00059 MAC = (UINT32) (AddMac && 0xFFFFFF00);
00060 #else
00061
00062 MAC =
00063 (UINT32) (((AddMac[2]) << 8) + ((AddMac[1]) << 16) +
00064 ((AddMac[0]) << 24));
00065 #endif
00066 for (i = 0; i < SIZE_OF_MANUF_TABLE; i++) {
00067 if (MAC == manuf_mac_table[i]) {
00068 break;
00069 }
00070 }
00071
00072 }
00073 return ((char *) manuf_name_table[i]);
00074 }
00075
00076 char *AddMacToManufModel(char *AddMac)
00077 {
00078
00079 UINT16 i;
00080 UINT32 MAC;
00081
00082 #ifdef WORDS_BIGENDIAN
00083
00084 MAC = (UINT32) AddMac;
00085 #else
00086
00087 MAC =
00088 (UINT32) (((AddMac[3])) + ((AddMac[2]) << 8) +
00089 ((AddMac[1]) << 16) + ((AddMac[0]) << 24));
00090 #endif
00091 for (i = 0; i < SIZE_OF_MANUF_TABLE; i++) {
00092 if (MAC == manuf_mac_table[i]) {
00093 break;
00094 }
00095 }
00096
00097 if (i == SIZE_OF_MANUF_TABLE) {
00098 #ifdef WORDS_BIGENDIAN
00099
00100 MAC = (UINT32) (AddMac && 0xFFFFFF00);
00101 #else
00102
00103 MAC =
00104 (UINT32) (((AddMac[2]) << 8) + ((AddMac[1]) << 16) +
00105 ((AddMac[0]) << 24));
00106 #endif
00107 for (i = 0; i < SIZE_OF_MANUF_TABLE; i++) {
00108 if (MAC == manuf_mac_table[i]) {
00109 break;
00110 }
00111 }
00112
00113 }
00114 return ((char *) manuf_model_table[i]);
00115 }