aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/ath6kl/os/linux/eeprom.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/ath6kl/os/linux/eeprom.c')
-rw-r--r--drivers/staging/ath6kl/os/linux/eeprom.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/drivers/staging/ath6kl/os/linux/eeprom.c b/drivers/staging/ath6kl/os/linux/eeprom.c
index be77fb8..4cff9da 100644
--- a/drivers/staging/ath6kl/os/linux/eeprom.c
+++ b/drivers/staging/ath6kl/os/linux/eeprom.c
@@ -53,9 +53,9 @@ char *p_mac = NULL;
// static variables
//
-static A_UCHAR eeprom_data[EEPROM_SZ];
-static A_UINT32 sys_sleep_reg;
-static HIF_DEVICE *p_bmi_device;
+static u8 eeprom_data[EEPROM_SZ];
+static u32 sys_sleep_reg;
+static struct hif_device *p_bmi_device;
//
// Functions
@@ -63,7 +63,7 @@ static HIF_DEVICE *p_bmi_device;
/* soft mac */
static int
-wmic_ether_aton(const char *orig, A_UINT8 *eth)
+wmic_ether_aton(const char *orig, u8 *eth)
{
const char *bufp;
int i;
@@ -103,23 +103,23 @@ wmic_ether_aton(const char *orig, A_UINT8 *eth)
}
static void
-update_mac(unsigned char* eeprom, int size, unsigned char* macaddr)
+update_mac(unsigned char *eeprom, int size, unsigned char *macaddr)
{
int i;
- A_UINT16* ptr = (A_UINT16*)(eeprom+4);
- A_UINT16 checksum = 0;
+ u16 *ptr = (u16 *)(eeprom+4);
+ u16 checksum = 0;
memcpy(eeprom+10,macaddr,6);
*ptr = 0;
- ptr = (A_UINT16*)eeprom;
+ ptr = (u16 *)eeprom;
for (i=0; i<size; i+=2) {
checksum ^= *ptr++;
}
checksum = ~checksum;
- ptr = (A_UINT16*)(eeprom+4);
+ ptr = (u16 *)(eeprom+4);
*ptr = checksum;
return;
}
@@ -127,30 +127,30 @@ update_mac(unsigned char* eeprom, int size, unsigned char* macaddr)
/* Read a Target register and return its value. */
inline void
-BMI_read_reg(A_UINT32 address, A_UINT32 *pvalue)
+BMI_read_reg(u32 address, u32 *pvalue)
{
BMIReadSOCRegister(p_bmi_device, address, pvalue);
}
/* Write a value to a Target register. */
inline void
-BMI_write_reg(A_UINT32 address, A_UINT32 value)
+BMI_write_reg(u32 address, u32 value)
{
BMIWriteSOCRegister(p_bmi_device, address, value);
}
/* Read Target memory word and return its value. */
inline void
-BMI_read_mem(A_UINT32 address, A_UINT32 *pvalue)
+BMI_read_mem(u32 address, u32 *pvalue)
{
- BMIReadMemory(p_bmi_device, address, (A_UCHAR*)(pvalue), 4);
+ BMIReadMemory(p_bmi_device, address, (u8*)(pvalue), 4);
}
/* Write a word to a Target memory. */
inline void
-BMI_write_mem(A_UINT32 address, A_UINT8 *p_data, A_UINT32 sz)
+BMI_write_mem(u32 address, u8 *p_data, u32 sz)
{
- BMIWriteMemory(p_bmi_device, address, (A_UCHAR*)(p_data), sz);
+ BMIWriteMemory(p_bmi_device, address, (u8*)(p_data), sz);
}
/*
@@ -158,9 +158,9 @@ BMI_write_mem(A_UINT32 address, A_UINT8 *p_data, A_UINT32 sz)
* so we can access the EEPROM.
*/
static void
-enable_SI(HIF_DEVICE *p_device)
+enable_SI(struct hif_device *p_device)
{
- A_UINT32 regval;
+ u32 regval;
printk("%s\n", __FUNCTION__);
@@ -200,7 +200,7 @@ enable_SI(HIF_DEVICE *p_device)
static void
disable_SI(void)
{
- A_UINT32 regval;
+ u32 regval;
printk("%s\n", __FUNCTION__);
@@ -218,7 +218,7 @@ disable_SI(void)
static void
request_8byte_read(int offset)
{
- A_UINT32 regval;
+ u32 regval;
// printk("%s: request_8byte_read from offset 0x%x\n", __FUNCTION__, offset);
@@ -241,9 +241,9 @@ request_8byte_read(int offset)
* writing values from Target TX_DATA registers.
*/
static void
-request_4byte_write(int offset, A_UINT32 data)
+request_4byte_write(int offset, u32 data)
{
- A_UINT32 regval;
+ u32 regval;
printk("%s: request_4byte_write (0x%x) to offset 0x%x\n", __FUNCTION__, data, offset);
@@ -266,10 +266,10 @@ request_4byte_write(int offset, A_UINT32 data)
* Check whether or not an EEPROM request that was started
* earlier has completed yet.
*/
-static A_BOOL
+static bool
request_in_progress(void)
{
- A_UINT32 regval;
+ u32 regval;
/* Wait for DONE_INT in SI_CS */
BMI_read_reg(SI_BASE_ADDRESS+SI_CS_OFFSET, &regval);
@@ -288,8 +288,8 @@ request_in_progress(void)
static void eeprom_type_detect(void)
{
- A_UINT32 regval;
- A_UINT8 i = 0;
+ u32 regval;
+ u8 i = 0;
request_8byte_read(0x100);
/* Wait for DONE_INT in SI_CS */
@@ -310,7 +310,7 @@ static void eeprom_type_detect(void)
* and return them to the caller.
*/
inline void
-read_8byte_results(A_UINT32 *data)
+read_8byte_results(u32 *data)
{
/* Read SI_RX_DATA0 and SI_RX_DATA1 */
BMI_read_reg(SI_BASE_ADDRESS+SI_RX_DATA0_OFFSET, &data[0]);
@@ -339,7 +339,7 @@ wait_for_eeprom_completion(void)
* waits for it to complete, and returns the result.
*/
static void
-fetch_8bytes(int offset, A_UINT32 *data)
+fetch_8bytes(int offset, u32 *data)
{
request_8byte_read(offset);
wait_for_eeprom_completion();
@@ -354,17 +354,17 @@ fetch_8bytes(int offset, A_UINT32 *data)
* and waits for it to complete.
*/
inline void
-commit_4bytes(int offset, A_UINT32 data)
+commit_4bytes(int offset, u32 data)
{
request_4byte_write(offset, data);
wait_for_eeprom_completion();
}
/* ATHENV */
#ifdef ANDROID_ENV
-void eeprom_ar6000_transfer(HIF_DEVICE *device, char *fake_file, char *p_mac)
+void eeprom_ar6000_transfer(struct hif_device *device, char *fake_file, char *p_mac)
{
- A_UINT32 first_word;
- A_UINT32 board_data_addr;
+ u32 first_word;
+ u32 board_data_addr;
int i;
printk("%s: Enter\n", __FUNCTION__);
@@ -437,17 +437,17 @@ void eeprom_ar6000_transfer(HIF_DEVICE *device, char *fake_file, char *p_mac)
* Fetch EEPROM_SZ Bytes of Board Data, 8 bytes at a time.
*/
- fetch_8bytes(0, (A_UINT32 *)(&eeprom_data[0]));
+ fetch_8bytes(0, (u32 *)(&eeprom_data[0]));
/* Check the first word of EEPROM for validity */
- first_word = *((A_UINT32 *)eeprom_data);
+ first_word = *((u32 *)eeprom_data);
if ((first_word == 0) || (first_word == 0xffffffff)) {
printk("Did not find EEPROM with valid Board Data.\n");
}
for (i=8; i<EEPROM_SZ; i+=8) {
- fetch_8bytes(i, (A_UINT32 *)(&eeprom_data[i]));
+ fetch_8bytes(i, (u32 *)(&eeprom_data[i]));
}
}
@@ -558,13 +558,13 @@ void eeprom_ar6000_transfer(HIF_DEVICE *device, char *fake_file, char *p_mac)
/* soft mac */
/* Write EEPROM data to Target RAM */
- BMI_write_mem(board_data_addr, ((A_UINT8 *)eeprom_data), EEPROM_SZ);
+ BMI_write_mem(board_data_addr, ((u8 *)eeprom_data), EEPROM_SZ);
/* Record the fact that Board Data IS initialized */
{
- A_UINT32 one = 1;
+ u32 one = 1;
BMI_write_mem(HOST_INTEREST_ITEM_ADDRESS(hi_board_data_initialized),
- (A_UINT8 *)&one, sizeof(A_UINT32));
+ (u8 *)&one, sizeof(u32));
}
disable_SI();