BT: bluetooth device address read from ID block
author陈智 <cz@rock-chips.com>
Tue, 22 Mar 2011 07:30:22 +0000 (15:30 +0800)
committer陈智 <cz@rock-chips.com>
Tue, 22 Mar 2011 07:30:22 +0000 (15:30 +0800)
drivers/bluetooth/vflash.c

index 8be5c1bfa600e3561bf5c3ca554dd3be259d3b68..5987d9212a52ff73415378d1afee75fc9fc0f334 100755 (executable)
@@ -48,24 +48,19 @@ static int vflash_ioctl(struct inode *inode, struct file *file,
         case READ_BDADDR_FROM_FLASH:\r
         {   \r
             char *tempBuf = (char *)kmalloc(512, GFP_KERNEL);\r
+           char bd_addr[6] = {0};\r
             int i;\r
-            #if 0\r
+\r
             GetSNSectorInfo(tempBuf);\r
-            #else\r
-            tempBuf[498] = 0x00;\r
-            tempBuf[499] = 0x11;\r
-            tempBuf[500] = 0x22;\r
-            tempBuf[501] = 0x33;\r
-            tempBuf[502] = 0x44;\r
-            tempBuf[503] = 0x55;\r
-            tempBuf[504] = 0x66;\r
-            #endif\r
+\r
             for(i=498; i<=504; i++)\r
             {\r
                 DBG("tempBuf[%d]=%x\n", i, tempBuf[i]);\r
+               bd_addr[504-i] = tempBuf[i];\r
             }\r
+\r
             \r
-                       if(copy_to_user(argp, &(tempBuf[499]), 6))\r
+           if(copy_to_user(argp, bd_addr, 6))\r
                        {\r
                            printk("ERROR: copy_to_user---%s\n", __FUNCTION__);\r
                 kfree(tempBuf);\r