/* * Write to the AR6000 through its diagnostic window. * No cooperation from the Target is required for this. */ A_STATUS ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data) { A_STATUS status; /* set write data */ status = HIFReadWrite(hifDevice, WINDOW_DATA_ADDRESS, (A_UCHAR *)data, sizeof(A_UINT32), HIF_WR_SYNC_BYTE_INC, NULL); if (status != A_OK) { AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to WINDOW_DATA_ADDRESS\n", *data)); printk("Cannot write 0x%x to WINDOW_DATA_ADDRESS\n", *data); return status; } /* set window register, which starts the write cycle */ #if 1 status = ar6000_SetAddressWindowRegister(hifDevice, WINDOW_WRITE_ADDR_ADDRESS, *address); return status; #else return ar6000_SetAddressWindowRegister(hifDevice, WINDOW_WRITE_ADDR_ADDRESS, *address); #endif }
/* * Read from the AR6000 through its diagnostic window. * No cooperation from the Target is required for this. */ A_STATUS ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data) { A_STATUS status; /* set window register to start read cycle */ status = ar6000_SetAddressWindowRegister(hifDevice, WINDOW_READ_ADDR_ADDRESS, *address); if (status != A_OK) { return status; } /* read the data */ status = HIFReadWrite(hifDevice, WINDOW_DATA_ADDRESS, (A_UCHAR *)data, sizeof(A_UINT32), HIF_RD_SYNC_BYTE_INC, NULL); if (status != A_OK) { AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot read from WINDOW_DATA_ADDRESS\n")); return status; } return status; }
/* * Write to the AR6000 through its diagnostic window. * No cooperation from the Target is required for this. */ A_STATUS HIFDiagWriteAccess(HIF_DEVICE *hifDevice, A_UINT32 address, A_UINT32 data) { A_STATUS status; static A_UINT32 writeValue; writeValue = data; /* set write data */ status = HIFReadWrite(hifDevice, WINDOW_DATA_ADDRESS, (A_UCHAR *)&writeValue, sizeof(A_UINT32), HIF_WR_SYNC_BYTE_INC, NULL); if (status != A_OK) { AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to WINDOW_DATA_ADDRESS\n", data)); return status; } /* set window register, which starts the write cycle */ return ar6000_SetAddressWindowRegister(hifDevice, WINDOW_WRITE_ADDR_ADDRESS, address); }