int err = 0;
unsigned char *conf_ptr;
const struct firmware *firm = NULL;
+ struct device_node *chosen_node = NULL; //IKKANE-6
/* Fill the configuration information */
bhcs->version = BHCS_VERSION;
bhcs->bsmhcp_protocol_offset = protocol_ref;
}
#endif
+//BEGIN IKKANE-6
+#ifdef MOTO_UTAGS_MAC
+ //Moto, read MACs from bootparams
+ chosen_node = of_find_node_by_name(NULL, "chosen");
+ if (!chosen_node) {
+ SCSC_TAG_ERR(BT_COMMON, "%s: get chosen node read failed\n", __func__);
+ } else {
+ int len=0;
+ const char *cmd_line = NULL;
+ cmd_line = of_get_property(chosen_node, "bootargs", &len);
+ if (!cmd_line || len <= 0) {
+ SCSC_TAG_ERR(BT_COMMON, "%s: get bt MACs bootargs failed\n", __func__);
+ } else {
+ char * mac_idx = NULL;
+ mac_idx = strstr(cmd_line, BT_MAC_BOOTARG);
+ if (mac_idx == NULL) {
+ SCSC_TAG_ERR(BT_COMMON, "%s: " BT_MAC_BOOTARG " not present in bootargs", __func__);
+ } else {
+ char macStr[MACSTRLEN+1] = {0};
+ u32 u[SCSC_BT_ADDR_LEN] = {0};
+ // extract MAC from boot params
+ mac_idx += strlen(WIFI_MAC_BOOTARG);
+ memcpy(macStr, mac_idx, MACSTRLEN);
+ sscanf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X",
+ u[0], u[1], u[2], u[3], u[4], u[5]);
+ bhcs->bluetooth_address_lap =
+ (u[3] << 16) | (u[4] << 8) | u[5];
+ bhcs->bluetooth_address_uap = u[2];
+ bhcs->bluetooth_address_nap = (u[0] << 8) | u[1];
+ SCSC_TAG_ERR(BT_COMMON,, "BT MAC address loaded from utag: %02X:%02X:%02X:%02X:%02X:%02X\n",
+ u[0], u[1], u[2], u[3], u[4], u[5]);
+ }
+ }
+ }
+#endif
+//END IKKANE-6
+
#ifdef CONFIG_SCSC_DEBUG
SCSC_TAG_DEBUG(BT_COMMON, "Bluetooth address: %04X:%02X:%06X\n",
bhcs->bluetooth_address_nap,
spin_lock_init(&bt_service.avdtp_detect.lock);
spin_lock_init(&bt_service.avdtp_detect.fw_write_lock);
-#ifdef CONFIG_ARCH_EXYNOS
+//BEGIN IKKANE-6
+#ifdef MOTO_UTAGS_MAC
+ sprintf(bluetooth_address_fallback, "F0:D7:AA:%02X:%02X:%02X",
+ (exynos_soc_info.unique_id & 0xFF0000000000) >> 40,
+ (exynos_soc_info.unique_id & 0x00FF00000000) >> 32,
+ (exynos_soc_info.unique_id & 0x0000FF000000) >> 24);
+#elif CONFIG_ARCH_EXYNOS
sprintf(bluetooth_address_fallback, "%02X:%02X:%02X:%02X:%02X:%02X",
- (exynos_soc_info.unique_id & 0x000000FF0000) >> 16,
- (exynos_soc_info.unique_id & 0x00000000FF00) >> 8,
- (exynos_soc_info.unique_id & 0x0000000000FF) >> 0,
- (exynos_soc_info.unique_id & 0xFF0000000000) >> 40,
- (exynos_soc_info.unique_id & 0x00FF00000000) >> 32,
- (exynos_soc_info.unique_id & 0x0000FF000000) >> 24);
+ (exynos_soc_info.unique_id & 0x000000FF0000) >> 16,
+ (exynos_soc_info.unique_id & 0x00000000FF00) >> 8,
+ (exynos_soc_info.unique_id & 0x0000000000FF) >> 0,
+ (exynos_soc_info.unique_id & 0xFF0000000000) >> 40,
+ (exynos_soc_info.unique_id & 0x00FF00000000) >> 32,
+ (exynos_soc_info.unique_id & 0x0000FF000000) >> 24);
#endif
+//END IKKANE-6
#ifdef CONFIG_SCSC_ANT
SCSC_TAG_DEBUG(BT_COMMON, "dev=%u class=%p\n",
u32 u[ETH_ALEN];
char path_name[MX_WLAN_FILE_PATH_LEN_MAX];
int r;
- bool valid = false;
-
- /* Module parameter override */
- r = sscanf(mac_addr_override, "%02X:%02X:%02X:%02X:%02X:%02X", &u[0], &u[1], &u[2], &u[3], &u[4], &u[5]);
- if (r != ETH_ALEN) {
- SLSI_ERR(sdev, "mac_addr modparam set, but format is incorrect (should be e.g. xx:xx:xx:xx:xx:xx)\n");
- goto mac_sysfs;
- }
- for (i = 0; i < ETH_ALEN; i++) {
- if (u[i] != 0xff)
- valid = true;
- addr[i] = u[i] & 0xff;
+ bool valid = false;
+//BEGIN IKKANE-6
+#ifdef MOTO_UTAGS_MAC
+ struct device_node *chosen_node = NULL;
+ //Moto, read MACs from bootparams
+ chosen_node = of_find_node_by_name(NULL, "chosen");
+ if (!chosen_node) {
+ SLSI_ERR(sdev, "%s: get chosen node read failed\n", __func__);
+ goto mac_ss;
+ } else {
+ int len=0;
+ const char *cmd_line = NULL;
+ cmd_line = of_get_property(chosen_node, "bootargs", &len);
+ if (!cmd_line || len <= 0) {
+ SLSI_ERR(sdev, "%s: get wlan MACs bootargs failed\n", __func__);
+ goto mac_ss;
+ } else {
+ char * mac_idx = NULL;
+ mac_idx = strstr(cmd_line, WIFI_MAC_BOOTARG);
+ if (mac_idx == NULL) {
+ SLSI_ERR(sdev, "%s: " WIFI_MAC_BOOTARG " not present in bootargs", __func__);
+ goto mac_ss;
+ } else {
+ char macStr[MACSTRLEN+1] = {0};
+ // extract MAC from boot params
+ mac_idx += strlen(WIFI_MAC_BOOTARG);
+ memcpy(macStr, mac_idx, MACSTRLEN);
+ sscanf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X",
+ u[0], u[1], u[2], u[3], u[4], u[5]);
+ for (i = 0; i < ETH_ALEN; i++)
+ addr[i] = u[i] & 0xff;
+ SLSI_INFO(sdev, "WiFi MAC address loaded from utag: %02X:%02X:%02X:%02X:%02X:%02X\n",
+ u[0], u[1], u[2], u[3], u[4], u[5]);
+ }
+ }
}
+ return;
+mac_ss:
+#endif
+//END IKKANE-6
+
+ /* Module parameter override */
+ r = sscanf(mac_addr_override, "%02X:%02X:%02X:%02X:%02X:%02X", &u[0], &u[1], &u[2], &u[3], &u[4], &u[5]);
+ if (r != ETH_ALEN) {
+ SLSI_ERR(sdev, "mac_addr modparam set, but format is incorrect (should be e.g. xx:xx:xx:xx:xx:xx)\n");
+ goto mac_sysfs;
+ }
+ for (i = 0; i < ETH_ALEN; i++) {
+ if (u[i] != 0xff)
+ valid = true;
+ addr[i] = u[i] & 0xff;
+ }
/* If the override is valid, use it */
if (valid) {
mx140_file_release_conf(sdev->maxwell_core, e);
SLSI_ETHER_COPY(addr, SLSI_DEFAULT_HW_MAC_ADDR);
+//BEGIN IKKANE-6
+#ifdef MOTO_UTAGS_MAC
+ /* Motorola OUI */
+ addr[0] = 0xF0;
+ addr[1] = 0xD7;
+ addr[2] = 0xAA;
+#endif
+//END IKKANE-6
+
#ifdef CONFIG_ARCH_EXYNOS
/* Randomise MAC address from the soc uid */
addr[3] = (exynos_soc_info.unique_id & 0xFF0000000000) >> 40;