Christopher N. Hesse | afec0fd | 2017-02-09 19:17:06 +0100 | [diff] [blame] | 1 | /* |
Davis Mosenkovs | 8b4ba0d | 2017-01-09 12:11:31 -0800 | [diff] [blame] | 2 | * Copyright (C) 2017-2018, The LineageOS Project |
Christopher N. Hesse | afec0fd | 2017-02-09 19:17:06 +0100 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef MACADDR_MAPPINGS_H |
| 18 | #define MACADDR_MAPPINGS_H |
| 19 | |
| 20 | #define MAX_RANGE_ENTRIES 100 |
| 21 | #define RANGE_ENTRY_LEN 9 |
| 22 | |
| 23 | enum Type { |
| 24 | NONE, |
| 25 | MURATA, |
| 26 | SEMCOSH, |
Christopher N. Hesse | afec0fd | 2017-02-09 19:17:06 +0100 | [diff] [blame] | 27 | SEMCO3RD, |
| 28 | SEMCO, |
| 29 | WISOL, |
| 30 | TYPE_MAX = WISOL |
| 31 | }; |
| 32 | |
| 33 | struct company_range { |
| 34 | int type; |
| 35 | char macaddrs[MAX_RANGE_ENTRIES][RANGE_ENTRY_LEN]; |
| 36 | }; |
| 37 | |
| 38 | /* |
| 39 | * address mappings from http://hwaddress.com |
| 40 | */ |
| 41 | |
| 42 | static const struct company_range murata_ranges = { |
| 43 | .type = MURATA, |
| 44 | .macaddrs = { |
| 45 | "00:0e:6d", |
| 46 | "00:13:e0", |
| 47 | "00:21:e8", |
| 48 | "00:26:e8", |
| 49 | "00:37:6d", |
| 50 | "00:60:57", |
| 51 | "00:ae:fa", |
| 52 | "04:46:65", |
| 53 | "10:5f:06", |
| 54 | "10:a5:d0", |
| 55 | "10:d5:42", |
| 56 | "14:7d:c5", |
| 57 | "1c:99:4c", |
| 58 | "20:02:af", |
| 59 | "40:f3:08", |
| 60 | "44:a7:cf", |
| 61 | "5c:da:d4", |
| 62 | "5c:f8:a1", |
| 63 | "60:21:c0", |
| 64 | "60:f1:89", |
| 65 | "78:4b:87", |
| 66 | "78:52:1a", |
| 67 | "88:30:8a", |
Davis Mosenkovs | 2fa73d6 | 2018-01-28 15:49:52 -0800 | [diff] [blame] | 68 | "8c:45:00", |
Christopher N. Hesse | afec0fd | 2017-02-09 19:17:06 +0100 | [diff] [blame] | 69 | "90:b6:86", |
| 70 | "98:f1:70", |
Davis Mosenkovs | 8b4ba0d | 2017-01-09 12:11:31 -0800 | [diff] [blame] | 71 | "a0:c9:a0", |
Christopher N. Hesse | afec0fd | 2017-02-09 19:17:06 +0100 | [diff] [blame] | 72 | "a0:cc:2b", |
| 73 | "a4:08:ea", |
| 74 | "b0:72:bf", |
| 75 | "b8:d7:af", |
| 76 | "c8:14:79", |
| 77 | "d0:e4:4a", |
| 78 | "d8:c4:6a", |
| 79 | "dc:ef:ca", |
| 80 | "f0:27:65", |
| 81 | "fc:c2:de", |
| 82 | "fc:db:b3" |
| 83 | } |
| 84 | }; |
| 85 | |
| 86 | static const struct company_range semcosh_ranges = { |
| 87 | .type = SEMCOSH, |
| 88 | .macaddrs = { |
| 89 | "34:23:ba", |
| 90 | "38:aa:3c", |
| 91 | "5c:0a:5b", |
| 92 | "88:32:9b", |
| 93 | "90:18:7c", |
| 94 | "cc:3a:61" |
| 95 | } |
| 96 | }; |
| 97 | |
| 98 | static const struct company_range semco3rd_ranges = { |
| 99 | .type = SEMCO3RD, |
| 100 | .macaddrs = { |
| 101 | "2c:0e:3d", |
| 102 | "54:88:0e", |
| 103 | "84:38:38", |
| 104 | "8c:f5:a3", |
| 105 | "ac:36:13", |
| 106 | "ac:5f:3e", |
| 107 | "b4:79:a7", |
| 108 | "c0:97:27", |
| 109 | "c0:bd:d1", |
| 110 | "c8:ba:94", |
Martin Bouchet | 8794541 | 2017-02-15 01:26:29 -0300 | [diff] [blame] | 111 | "d0:22:be", |
Christopher N. Hesse | afec0fd | 2017-02-09 19:17:06 +0100 | [diff] [blame] | 112 | "d0:25:44", |
| 113 | "e8:50:8b", |
| 114 | "ec:1f:72", |
| 115 | "ec:9b:f3", |
| 116 | "f0:25:b7", |
| 117 | "f4:09:d8", |
| 118 | "f8:04:2e" |
| 119 | } |
| 120 | }; |
| 121 | |
| 122 | static const struct company_range semco_ranges = { |
| 123 | .type = SEMCO, |
| 124 | .macaddrs = { |
| 125 | "4c:66:41", |
| 126 | "51:f6:6b", |
Sean hoyt | e3800ac | 2017-02-14 17:32:01 +0000 | [diff] [blame] | 127 | "cc:07:ab", |
Christopher N. Hesse | afec0fd | 2017-02-09 19:17:06 +0100 | [diff] [blame] | 128 | "d8:c4:e9", |
| 129 | "ec:9b:f3" |
| 130 | } |
| 131 | }; |
| 132 | |
| 133 | static const struct company_range wisol_ranges = { |
| 134 | .type = WISOL, |
| 135 | .macaddrs = { |
| 136 | "48:5a:3f", |
| 137 | "70:2c:1f" |
| 138 | } |
| 139 | }; |
| 140 | |
| 141 | static const struct company_range *all_ranges[TYPE_MAX] = { |
| 142 | &murata_ranges, |
| 143 | &semcosh_ranges, |
| 144 | &semco3rd_ranges, |
| 145 | &semco_ranges, |
| 146 | &wisol_ranges |
| 147 | }; |
| 148 | |
| 149 | #endif // MACADDR_MAPPINGS_H |