From b0132ed08d94a0b9a7ede245263e412ee60ae4e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=99=88=E6=99=BA?= Date: Tue, 22 Mar 2011 15:30:22 +0800 Subject: [PATCH] BT: bluetooth device address read from ID block --- drivers/bluetooth/vflash.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/bluetooth/vflash.c b/drivers/bluetooth/vflash.c index 8be5c1bfa600..5987d9212a52 100755 --- a/drivers/bluetooth/vflash.c +++ b/drivers/bluetooth/vflash.c @@ -48,24 +48,19 @@ static int vflash_ioctl(struct inode *inode, struct file *file, case READ_BDADDR_FROM_FLASH: { char *tempBuf = (char *)kmalloc(512, GFP_KERNEL); + char bd_addr[6] = {0}; int i; - #if 0 + GetSNSectorInfo(tempBuf); - #else - tempBuf[498] = 0x00; - tempBuf[499] = 0x11; - tempBuf[500] = 0x22; - tempBuf[501] = 0x33; - tempBuf[502] = 0x44; - tempBuf[503] = 0x55; - tempBuf[504] = 0x66; - #endif + for(i=498; i<=504; i++) { DBG("tempBuf[%d]=%x\n", i, tempBuf[i]); + bd_addr[504-i] = tempBuf[i]; } + - if(copy_to_user(argp, &(tempBuf[499]), 6)) + if(copy_to_user(argp, bd_addr, 6)) { printk("ERROR: copy_to_user---%s\n", __FUNCTION__); kfree(tempBuf); -- 2.34.1