summaryrefslogtreecommitdiffstats
path: root/macloader
diff options
context:
space:
mode:
authorcodeworkx <daniel.hillenbrand@codeworkx.de>2012-06-27 16:13:45 +0200
committercodeworkx <daniel.hillenbrand@codeworkx.de>2012-06-27 16:21:06 +0200
commit8ddd60d8802b4c6525aa3ca105cebe4651366974 (patch)
treedf4d40bfc7f7c68435b9dcc8a74f2c0f20fa5145 /macloader
parentb66f20cd361806a6f78d45ff739b6b6a6f2c585a (diff)
downloaddevice_samsung_i9300-8ddd60d8802b4c6525aa3ca105cebe4651366974.zip
device_samsung_i9300-8ddd60d8802b4c6525aa3ca105cebe4651366974.tar.gz
device_samsung_i9300-8ddd60d8802b4c6525aa3ca105cebe4651366974.tar.bz2
macloader: added support for semcosh
Change-Id: Ib781bcb8143d54f9ddc5a8d166e89d4f6a04a567
Diffstat (limited to 'macloader')
-rw-r--r--macloader/macloader.cpp47
1 files changed, 41 insertions, 6 deletions
diff --git a/macloader/macloader.cpp b/macloader/macloader.cpp
index d47a20a..887724a 100644
--- a/macloader/macloader.cpp
+++ b/macloader/macloader.cpp
@@ -29,13 +29,21 @@
#define MACADDR_PATH "/efs/wifi/.mac.info"
#define CID_PATH "/data/.cid.info"
+enum Type {
+ NONE,
+ MURATA,
+ SEMCOSH,
+ SEMCOVE
+};
+
/*
* murata:
* 00:37:6d
* 88:30:8a
*
- * semcove:
- *
+ * semcosh:
+ * 5c:0a:5b
+ *
*/
int main() {
@@ -45,6 +53,7 @@ int main() {
char mac_addr_half[9];
int ret = -1;
int amode;
+ enum Type type = NONE;
/* open mac addr file */
file = fopen(MACADDR_PATH, "r");
@@ -64,7 +73,15 @@ int main() {
/* murata */
if(strncmp(mac_addr_half, "00:37:6d", 9) == 0 || strncmp(mac_addr_half, "88:30:8a", 9) == 0) {
+ type = MURATA;
+ }
+ /* semcosh */
+ if(strncmp(mac_addr_half, "5c:0a:5b", 9) == 0) {
+ type = SEMCOSH;
+ }
+
+ if (type != NONE) {
/* open cid file */
cidfile = fopen(CID_PATH, "w");
if(cidfile == 0) {
@@ -73,9 +90,27 @@ int main() {
return -1;
}
- /* write murata to cid file */
- LOGD("Writing murata to %s\n", CID_PATH);
- ret = fputs("murata", cidfile);
+ switch(type) {
+ case NONE:
+ return -1;
+ break;
+ case MURATA:
+ /* write murata to cid file */
+ LOGI("Writing murata to %s\n", CID_PATH);
+ ret = fputs("murata", cidfile);
+ break;
+ case SEMCOSH:
+ /* write semcosh to cid file */
+ LOGI("Writing semcosh to %s\n", CID_PATH);
+ ret = fputs("semcosh", cidfile);
+ break;
+ case SEMCOVE:
+ /* write semcove to cid file */
+ LOGI("Writing semcove to %s\n", CID_PATH);
+ ret = fputs("semcove", cidfile);
+ break;
+ }
+
if(ret != 0) {
fprintf(stderr, "fputs() to file %s failed\n", CID_PATH);
LOGE("Can't write to %s\n", CID_PATH);
@@ -102,7 +137,7 @@ int main() {
}
} else {
- /* delete cid file if not murata or semcove */
+ /* delete cid file if no specific type */
LOGD("Deleting file %s\n", CID_PATH);
remove(CID_PATH);
}