Staging: west bridge, removal of " " before ";"

This patch fixes removes all of the the " ;"'s in the west bridge driver
and instead replaces them with ";" only. Although this is a large patch,
this is the only thing that it does. I can break it up on a file basis
if needed.

Signed-off-by: David Cross <david.cross@cypress.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
David Cross 2010-09-23 17:24:45 -07:00 committed by Greg Kroah-Hartman
parent 9ebed608bd
commit 0769c38d26
38 changed files with 5751 additions and 5751 deletions

File diff suppressed because it is too large Load Diff

View File

@ -24,80 +24,80 @@
#include "../../include/linux/westbridge/cyasregs.h"
#include "../../include/linux/westbridge/cyaserr.h"
extern void cy_as_mail_box_interrupt_handler(cy_as_device *) ;
extern void cy_as_mail_box_interrupt_handler(cy_as_device *);
void
cy_as_mcu_interrupt_handler(cy_as_device *dev_p)
{
/* Read and clear the interrupt. */
uint16_t v ;
uint16_t v;
v = cy_as_hal_read_register(dev_p->tag, CY_AS_MEM_P0_MCU_STAT) ;
v = v ;
v = cy_as_hal_read_register(dev_p->tag, CY_AS_MEM_P0_MCU_STAT);
v = v;
}
void
cy_as_power_management_interrupt_handler(cy_as_device *dev_p)
{
uint16_t v ;
uint16_t v;
v = cy_as_hal_read_register(dev_p->tag, CY_AS_MEM_PWR_MAGT_STAT) ;
v = v ;
v = cy_as_hal_read_register(dev_p->tag, CY_AS_MEM_PWR_MAGT_STAT);
v = v;
}
void
cy_as_pll_lock_loss_interrupt_handler(cy_as_device *dev_p)
{
uint16_t v ;
uint16_t v;
v = cy_as_hal_read_register(dev_p->tag, CY_AS_MEM_PLL_LOCK_LOSS_STAT) ;
v = v ;
v = cy_as_hal_read_register(dev_p->tag, CY_AS_MEM_PLL_LOCK_LOSS_STAT);
v = v;
}
uint32_t cy_as_intr_start(cy_as_device *dev_p, cy_bool dmaintr)
{
uint16_t v ;
uint16_t v;
cy_as_hal_assert(dev_p->sig == CY_AS_DEVICE_HANDLE_SIGNATURE) ;
cy_as_hal_assert(dev_p->sig == CY_AS_DEVICE_HANDLE_SIGNATURE);
if (cy_as_device_is_intr_running(dev_p) != 0)
return CY_AS_ERROR_ALREADY_RUNNING ;
return CY_AS_ERROR_ALREADY_RUNNING;
v = CY_AS_MEM_P0_INT_MASK_REG_MMCUINT |
CY_AS_MEM_P0_INT_MASK_REG_MMBINT |
CY_AS_MEM_P0_INT_MASK_REG_MPMINT ;
CY_AS_MEM_P0_INT_MASK_REG_MPMINT;
if (dmaintr)
v |= CY_AS_MEM_P0_INT_MASK_REG_MDRQINT ;
v |= CY_AS_MEM_P0_INT_MASK_REG_MDRQINT;
/* Enable the interrupts of interest */
cy_as_hal_write_register(dev_p->tag, CY_AS_MEM_P0_INT_MASK_REG, v) ;
cy_as_hal_write_register(dev_p->tag, CY_AS_MEM_P0_INT_MASK_REG, v);
/* Mark the interrupt module as initialized */
cy_as_device_set_intr_running(dev_p) ;
cy_as_device_set_intr_running(dev_p);
return CY_AS_ERROR_SUCCESS ;
return CY_AS_ERROR_SUCCESS;
}
uint32_t cy_as_intr_stop(cy_as_device *dev_p)
{
cy_as_hal_assert(dev_p->sig == CY_AS_DEVICE_HANDLE_SIGNATURE) ;
cy_as_hal_assert(dev_p->sig == CY_AS_DEVICE_HANDLE_SIGNATURE);
if (cy_as_device_is_intr_running(dev_p) == 0)
return CY_AS_ERROR_NOT_RUNNING ;
return CY_AS_ERROR_NOT_RUNNING;
cy_as_hal_write_register(dev_p->tag, CY_AS_MEM_P0_INT_MASK_REG, 0) ;
cy_as_device_set_intr_stopped(dev_p) ;
cy_as_hal_write_register(dev_p->tag, CY_AS_MEM_P0_INT_MASK_REG, 0);
cy_as_device_set_intr_stopped(dev_p);
return CY_AS_ERROR_SUCCESS ;
return CY_AS_ERROR_SUCCESS;
}
void cy_as_intr_service_interrupt(cy_as_hal_device_tag tag)
{
uint16_t v ;
cy_as_device *dev_p ;
uint16_t v;
cy_as_device *dev_p;
dev_p = cy_as_device_find_from_tag(tag) ;
dev_p = cy_as_device_find_from_tag(tag);
/*
* only power management interrupts can occur before the
@ -105,39 +105,39 @@ void cy_as_intr_service_interrupt(cy_as_hal_device_tag tag)
* handle it here; otherwise output a warning message.
*/
if (dev_p == 0) {
v = cy_as_hal_read_register(tag, CY_AS_MEM_P0_INTR_REG) ;
v = cy_as_hal_read_register(tag, CY_AS_MEM_P0_INTR_REG);
if (v == CY_AS_MEM_P0_INTR_REG_PMINT) {
/* Read the PWR_MAGT_STAT register
* to clear this interrupt. */
v = cy_as_hal_read_register(tag,
CY_AS_MEM_PWR_MAGT_STAT) ;
CY_AS_MEM_PWR_MAGT_STAT);
} else
cy_as_hal_print_message("stray antioch "
"interrupt detected"
", tag not associated "
"with any created device.") ;
return ;
"with any created device.");
return;
}
/* Make sure we got a valid object from CyAsDeviceFindFromTag */
cy_as_hal_assert(dev_p->sig == CY_AS_DEVICE_HANDLE_SIGNATURE) ;
cy_as_hal_assert(dev_p->sig == CY_AS_DEVICE_HANDLE_SIGNATURE);
v = cy_as_hal_read_register(dev_p->tag, CY_AS_MEM_P0_INTR_REG) ;
v = cy_as_hal_read_register(dev_p->tag, CY_AS_MEM_P0_INTR_REG);
if (v & CY_AS_MEM_P0_INTR_REG_MCUINT)
cy_as_mcu_interrupt_handler(dev_p) ;
cy_as_mcu_interrupt_handler(dev_p);
if (v & CY_AS_MEM_P0_INTR_REG_PMINT)
cy_as_power_management_interrupt_handler(dev_p) ;
cy_as_power_management_interrupt_handler(dev_p);
if (v & CY_AS_MEM_P0_INTR_REG_PLLLOCKINT)
cy_as_pll_lock_loss_interrupt_handler(dev_p) ;
cy_as_pll_lock_loss_interrupt_handler(dev_p);
/* If the interrupt module is not running, no mailbox
* interrupts are expected from the west bridge. */
if (cy_as_device_is_intr_running(dev_p) == 0)
return ;
return;
if (v & CY_AS_MEM_P0_INTR_REG_MBINT)
cy_as_mail_box_interrupt_handler(dev_p) ;
cy_as_mail_box_interrupt_handler(dev_p);
}

View File

@ -40,7 +40,7 @@ typedef enum cy_as_physical_endpoint_state {
* LEP register indexes into actual EP numbers.
*/
static cy_as_end_point_number_t end_point_map[] = {
3, 5, 7, 9, 10, 11, 12, 13, 14, 15 } ;
3, 5, 7, 9, 10, 11, 12, 13, 14, 15 };
#define CY_AS_EPCFG_1024 (1 << 3)
#define CY_AS_EPCFG_DBL (0x02)
@ -116,23 +116,23 @@ static uint8_t pep_register_values[12][4] = {
CY_AS_EPCFG_DBL,
},/* Config 12 - PEP1 (4 * 1024), PEP2 (N/A),
* PEP3 (N/A), PEP4 (N/A) */
} ;
};
static cy_as_return_status_t
find_endpoint_directions(cy_as_device *dev_p,
cy_as_physical_endpoint_state epstate[4])
{
int i ;
cy_as_physical_endpoint_state desired ;
int i;
cy_as_physical_endpoint_state desired;
/*
* note, there is no error checking here becuase
* ISO error checking happens when the API is called.
*/
for (i = 0 ; i < 10 ; i++) {
int epno = end_point_map[i] ;
for (i = 0; i < 10; i++) {
int epno = end_point_map[i];
if (dev_p->usb_config[epno].enabled) {
int pep = dev_p->usb_config[epno].physical ;
int pep = dev_p->usb_config[epno].physical;
if (dev_p->usb_config[epno].type == cy_as_usb_iso) {
/*
* marking this as an ISO endpoint, removes the
@ -140,14 +140,14 @@ find_endpoint_directions(cy_as_device *dev_p,
* mapping the remaining E_ps.
*/
if (dev_p->usb_config[epno].dir == cy_as_usb_in)
desired = cy_as_e_p_iso_in ;
desired = cy_as_e_p_iso_in;
else
desired = cy_as_e_p_iso_out ;
desired = cy_as_e_p_iso_out;
} else {
if (dev_p->usb_config[epno].dir == cy_as_usb_in)
desired = cy_as_e_p_in ;
desired = cy_as_e_p_in;
else
desired = cy_as_e_p_out ;
desired = cy_as_e_p_out;
}
/*
@ -157,9 +157,9 @@ find_endpoint_directions(cy_as_device *dev_p,
*/
if (epstate[pep - 1] !=
cy_as_e_p_free && epstate[pep - 1] != desired)
return CY_AS_ERROR_INVALID_CONFIGURATION ;
return CY_AS_ERROR_INVALID_CONFIGURATION;
epstate[pep - 1] = desired ;
epstate[pep - 1] = desired;
}
}
@ -167,91 +167,91 @@ find_endpoint_directions(cy_as_device *dev_p,
* create the EP1 config values directly.
* both EP1OUT and EP1IN are invalid by default.
*/
dev_p->usb_ep1cfg[0] = 0 ;
dev_p->usb_ep1cfg[1] = 0 ;
dev_p->usb_ep1cfg[0] = 0;
dev_p->usb_ep1cfg[1] = 0;
if (dev_p->usb_config[1].enabled) {
if ((dev_p->usb_config[1].dir == cy_as_usb_out) ||
(dev_p->usb_config[1].dir == cy_as_usb_in_out)) {
/* Set the valid bit and type field. */
dev_p->usb_ep1cfg[0] = (1 << 7) ;
dev_p->usb_ep1cfg[0] = (1 << 7);
if (dev_p->usb_config[1].type == cy_as_usb_bulk)
dev_p->usb_ep1cfg[0] |= (2 << 4) ;
dev_p->usb_ep1cfg[0] |= (2 << 4);
else
dev_p->usb_ep1cfg[0] |= (3 << 4) ;
dev_p->usb_ep1cfg[0] |= (3 << 4);
}
if ((dev_p->usb_config[1].dir == cy_as_usb_in) ||
(dev_p->usb_config[1].dir == cy_as_usb_in_out)) {
/* Set the valid bit and type field. */
dev_p->usb_ep1cfg[1] = (1 << 7) ;
dev_p->usb_ep1cfg[1] = (1 << 7);
if (dev_p->usb_config[1].type == cy_as_usb_bulk)
dev_p->usb_ep1cfg[1] |= (2 << 4) ;
dev_p->usb_ep1cfg[1] |= (2 << 4);
else
dev_p->usb_ep1cfg[1] |= (3 << 4) ;
dev_p->usb_ep1cfg[1] |= (3 << 4);
}
}
return CY_AS_ERROR_SUCCESS ;
return CY_AS_ERROR_SUCCESS;
}
static void
create_register_settings(cy_as_device *dev_p,
cy_as_physical_endpoint_state epstate[4])
{
int i ;
uint8_t v ;
int i;
uint8_t v;
for (i = 0 ; i < 4 ; i++) {
for (i = 0; i < 4; i++) {
if (i == 0) {
/* Start with the values that specify size */
dev_p->usb_pepcfg[i] =
pep_register_values
[dev_p->usb_phy_config - 1][0] ;
[dev_p->usb_phy_config - 1][0];
} else if (i == 2) {
/* Start with the values that specify size */
dev_p->usb_pepcfg[i] =
pep_register_values
[dev_p->usb_phy_config - 1][1] ;
[dev_p->usb_phy_config - 1][1];
} else
dev_p->usb_pepcfg[i] = 0 ;
dev_p->usb_pepcfg[i] = 0;
/* Adjust direction if it is in */
if (epstate[i] == cy_as_e_p_iso_in ||
epstate[i] == cy_as_e_p_in)
dev_p->usb_pepcfg[i] |= (1 << 6) ;
dev_p->usb_pepcfg[i] |= (1 << 6);
}
/* Configure the logical EP registers */
for (i = 0 ; i < 10 ; i++) {
int val ;
int epnum = end_point_map[i] ;
for (i = 0; i < 10; i++) {
int val;
int epnum = end_point_map[i];
v = 0x10 ; /* PEP 1, Bulk Endpoint, EP not valid */
v = 0x10; /* PEP 1, Bulk Endpoint, EP not valid */
if (dev_p->usb_config[epnum].enabled) {
v |= (1 << 7) ; /* Enabled */
v |= (1 << 7); /* Enabled */
val = dev_p->usb_config[epnum].physical - 1 ;
cy_as_hal_assert(val >= 0 && val <= 3) ;
v |= (val << 5) ;
val = dev_p->usb_config[epnum].physical - 1;
cy_as_hal_assert(val >= 0 && val <= 3);
v |= (val << 5);
switch (dev_p->usb_config[epnum].type) {
case cy_as_usb_bulk:
val = 2 ;
break ;
val = 2;
break;
case cy_as_usb_int:
val = 3 ;
break ;
val = 3;
break;
case cy_as_usb_iso:
val = 1 ;
break ;
val = 1;
break;
default:
cy_as_hal_assert(cy_false) ;
break ;
cy_as_hal_assert(cy_false);
break;
}
v |= (val << 3) ;
v |= (val << 3);
}
dev_p->usb_lepcfg[i] = v ;
dev_p->usb_lepcfg[i] = v;
}
}
@ -259,100 +259,100 @@ create_register_settings(cy_as_device *dev_p,
cy_as_return_status_t
cy_as_usb_map_logical2_physical(cy_as_device *dev_p)
{
cy_as_return_status_t ret ;
cy_as_return_status_t ret;
/* Physical EPs 3 5 7 9 respectively in the array */
cy_as_physical_endpoint_state epstate[4] = {
cy_as_e_p_free, cy_as_e_p_free,
cy_as_e_p_free, cy_as_e_p_free } ;
cy_as_e_p_free, cy_as_e_p_free };
/* Find the direction for the endpoints */
ret = find_endpoint_directions(dev_p, epstate) ;
ret = find_endpoint_directions(dev_p, epstate);
if (ret != CY_AS_ERROR_SUCCESS)
return ret ;
return ret;
/*
* now create the register settings based on the given
* assigned of logical E_ps to physical endpoints.
*/
create_register_settings(dev_p, epstate) ;
create_register_settings(dev_p, epstate);
return ret ;
return ret;
}
static uint16_t
get_max_dma_size(cy_as_device *dev_p, cy_as_end_point_number_t ep)
{
uint16_t size = dev_p->usb_config[ep].size ;
uint16_t size = dev_p->usb_config[ep].size;
if (size == 0) {
switch (dev_p->usb_config[ep].type) {
case cy_as_usb_control:
size = 64 ;
break ;
size = 64;
break;
case cy_as_usb_bulk:
size = cy_as_device_is_usb_high_speed(dev_p) ?
512 : 64 ;
break ;
512 : 64;
break;
case cy_as_usb_int:
size = cy_as_device_is_usb_high_speed(dev_p) ?
1024 : 64 ;
break ;
1024 : 64;
break;
case cy_as_usb_iso:
size = cy_as_device_is_usb_high_speed(dev_p) ?
1024 : 1023 ;
break ;
1024 : 1023;
break;
}
}
return size ;
return size;
}
cy_as_return_status_t
cy_as_usb_set_dma_sizes(cy_as_device *dev_p)
{
cy_as_return_status_t ret = CY_AS_ERROR_SUCCESS ;
uint32_t i ;
cy_as_return_status_t ret = CY_AS_ERROR_SUCCESS;
uint32_t i;
for (i = 0 ; i < 10 ; i++) {
for (i = 0; i < 10; i++) {
cy_as_usb_end_point_config *config_p =
&dev_p->usb_config[end_point_map[i]] ;
&dev_p->usb_config[end_point_map[i]];
if (config_p->enabled) {
ret = cy_as_dma_set_max_dma_size(dev_p,
end_point_map[i],
get_max_dma_size(dev_p, end_point_map[i])) ;
get_max_dma_size(dev_p, end_point_map[i]));
if (ret != CY_AS_ERROR_SUCCESS)
break ;
break;
}
}
return ret ;
return ret;
}
cy_as_return_status_t
cy_as_usb_setup_dma(cy_as_device *dev_p)
{
cy_as_return_status_t ret = CY_AS_ERROR_SUCCESS ;
uint32_t i ;
cy_as_return_status_t ret = CY_AS_ERROR_SUCCESS;
uint32_t i;
for (i = 0 ; i < 10 ; i++) {
for (i = 0; i < 10; i++) {
cy_as_usb_end_point_config *config_p =
&dev_p->usb_config[end_point_map[i]] ;
&dev_p->usb_config[end_point_map[i]];
if (config_p->enabled) {
/* Map the endpoint direction to the DMA direction */
cy_as_dma_direction dir = cy_as_direction_out ;
cy_as_dma_direction dir = cy_as_direction_out;
if (config_p->dir == cy_as_usb_in)
dir = cy_as_direction_in ;
dir = cy_as_direction_in;
ret = cy_as_dma_enable_end_point(dev_p,
end_point_map[i], cy_true, dir) ;
end_point_map[i], cy_true, dir);
if (ret != CY_AS_ERROR_SUCCESS)
break ;
break;
}
}
return ret ;
return ret;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -135,7 +135,7 @@ typedef enum cy_as_hal_dma_type {
cy_as_hal_read,
cy_as_hal_write,
cy_as_hal_none
} cy_as_hal_dma_type ;
} cy_as_hal_dma_type;
/*
@ -146,9 +146,9 @@ typedef enum cy_as_hal_dma_type {
((struct scatterlist *) ((sg)->page_link & ~0x03))
*/
typedef struct cy_as_hal_endpoint_dma {
cy_bool buffer_valid ;
uint8_t *data_p ;
uint32_t size ;
cy_bool buffer_valid;
uint8_t *data_p;
uint32_t size;
/*
* sg_list_enabled - if true use, r/w DMA transfers use sg list,
* FALSE use pointer to a buffer
@ -162,14 +162,14 @@ typedef struct cy_as_hal_endpoint_dma {
* req_length - total request length
*/
bool sg_list_enabled;
struct scatterlist *sg_p ;
struct scatterlist *sg_p;
uint16_t dma_xfer_sz;
uint32_t seg_xfer_cnt;
uint16_t req_xfer_cnt;
uint16_t req_length;
cy_as_hal_dma_type type ;
cy_bool pending ;
} cy_as_hal_endpoint_dma ;
cy_as_hal_dma_type type;
cy_bool pending;
} cy_as_hal_endpoint_dma;
/*
* The list of OMAP devices (should be one)
@ -184,7 +184,7 @@ static cy_as_hal_dma_complete_callback callback;
/*
* Pending data size for the endpoints
*/
static cy_as_hal_endpoint_dma end_points[16] ;
static cy_as_hal_endpoint_dma end_points[16];
/*
* Forward declaration
@ -193,7 +193,7 @@ static void cy_handle_d_r_q_interrupt(cy_as_omap_dev_kernel *dev_p);
static uint16_t intr_sequence_num;
static uint8_t intr__enable;
spinlock_t int_lock ;
spinlock_t int_lock;
static u32 iomux_vma;
static u32 csa_phy;
@ -201,7 +201,7 @@ static u32 csa_phy;
/*
* gpmc I/O registers VMA
*/
static u32 gpmc_base ;
static u32 gpmc_base;
/*
* gpmc data VMA associated with CS4 (ASTORIA CS on GPMC)
@ -496,8 +496,8 @@ static irqreturn_t cy_astoria_int_handler(int irq,
void *dev_id, struct pt_regs *regs)
{
cy_as_omap_dev_kernel *dev_p;
uint16_t read_val = 0 ;
uint16_t mask_val = 0 ;
uint16_t read_val = 0;
uint16_t mask_val = 0;
/*
* debug stuff, counts number of loops per one intr trigger
@ -520,7 +520,7 @@ static irqreturn_t cy_astoria_int_handler(int irq,
/*
* this one just for debugging
*/
intr_sequence_num++ ;
intr_sequence_num++;
/*
* astoria device handle
@ -531,13 +531,13 @@ static irqreturn_t cy_astoria_int_handler(int irq,
* read Astoria intr register
*/
read_val = cy_as_hal_read_register((cy_as_hal_device_tag)dev_p,
CY_AS_MEM_P0_INTR_REG) ;
CY_AS_MEM_P0_INTR_REG);
/*
* save current mask value
*/
mask_val = cy_as_hal_read_register((cy_as_hal_device_tag)dev_p,
CY_AS_MEM_P0_INT_MASK_REG) ;
CY_AS_MEM_P0_INT_MASK_REG);
DBGPRN("<1>HAL__intr__enter:_seq:%d, P0_INTR_REG:%x\n",
intr_sequence_num, read_val);
@ -546,7 +546,7 @@ static irqreturn_t cy_astoria_int_handler(int irq,
* Disable WB interrupt signal generation while we are in ISR
*/
cy_as_hal_write_register((cy_as_hal_device_tag)dev_p,
CY_AS_MEM_P0_INT_MASK_REG, 0x0000) ;
CY_AS_MEM_P0_INT_MASK_REG, 0x0000);
/*
* this is a DRQ Interrupt
@ -559,7 +559,7 @@ static irqreturn_t cy_astoria_int_handler(int irq,
*/
drq_loop_cnt++;
cy_handle_d_r_q_interrupt(dev_p) ;
cy_handle_d_r_q_interrupt(dev_p);
/*
* spending to much time in ISR may impact
@ -577,7 +577,7 @@ static irqreturn_t cy_astoria_int_handler(int irq,
}
if (read_val & sentinel)
cy_as_intr_service_interrupt((cy_as_hal_device_tag)dev_p) ;
cy_as_intr_service_interrupt((cy_as_hal_device_tag)dev_p);
DBGPRN("<1>_hal:_intr__exit seq:%d, mask=%4.4x,"
"int_pin:%d DRQ_jobs:%d\n",
@ -590,9 +590,9 @@ static irqreturn_t cy_astoria_int_handler(int irq,
* re-enable WB hw interrupts
*/
cy_as_hal_write_register((cy_as_hal_device_tag)dev_p,
CY_AS_MEM_P0_INT_MASK_REG, mask_val) ;
CY_AS_MEM_P0_INT_MASK_REG, mask_val);
return IRQ_HANDLED ;
return IRQ_HANDLED;
}
static int cy_as_hal_configure_interrupts(void *dev_p)
@ -827,34 +827,34 @@ void cy_as_hal_omap_hardware_deinit(cy_as_omap_dev_kernel *dev_p)
*/
int stop_o_m_a_p_kernel(const char *pgm, cy_as_hal_device_tag tag)
{
cy_as_omap_dev_kernel *dev_p = (cy_as_omap_dev_kernel *)tag ;
cy_as_omap_dev_kernel *dev_p = (cy_as_omap_dev_kernel *)tag;
/*
* TODO: Need to disable WB interrupt handlere 1st
*/
if (0 == dev_p)
return 1 ;
return 1;
cy_as_hal_print_message("<1>_stopping OMAP34xx HAL layer object\n");
if (dev_p->m_sig != CY_AS_OMAP_KERNEL_HAL_SIG) {
cy_as_hal_print_message("<1>%s: %s: bad HAL tag\n",
pgm, __func__) ;
return 1 ;
pgm, __func__);
return 1;
}
/*
* disable interrupt
*/
cy_as_hal_write_register((cy_as_hal_device_tag)dev_p,
CY_AS_MEM_P0_INT_MASK_REG, 0x0000) ;
CY_AS_MEM_P0_INT_MASK_REG, 0x0000);
#if 0
if (dev_p->thread_flag == 0) {
dev_p->thread_flag = 1 ;
wait_for_completion(&dev_p->thread_complete) ;
dev_p->thread_flag = 1;
wait_for_completion(&dev_p->thread_complete);
cy_as_hal_print_message("cyasomaphal:"
"done cleaning thread\n");
cy_as_hal_destroy_sleep_channel(&dev_p->thread_sc) ;
cy_as_hal_destroy_sleep_channel(&dev_p->thread_sc);
}
#endif
@ -864,9 +864,9 @@ int stop_o_m_a_p_kernel(const char *pgm, cy_as_hal_device_tag tag)
* Rearrange the list
*/
if (m_omap_list_p == dev_p)
m_omap_list_p = dev_p->m_next_p ;
m_omap_list_p = dev_p->m_next_p;
cy_as_hal_free(dev_p) ;
cy_as_hal_free(dev_p);
cy_as_hal_print_message(KERN_INFO"OMAP_kernel_hal stopped\n");
return 0;
@ -874,23 +874,23 @@ int stop_o_m_a_p_kernel(const char *pgm, cy_as_hal_device_tag tag)
int omap_start_intr(cy_as_hal_device_tag tag)
{
cy_as_omap_dev_kernel *dev_p = (cy_as_omap_dev_kernel *)tag ;
int ret = 0 ;
cy_as_omap_dev_kernel *dev_p = (cy_as_omap_dev_kernel *)tag;
int ret = 0;
const uint16_t mask = CY_AS_MEM_P0_INTR_REG_DRQINT |
CY_AS_MEM_P0_INTR_REG_MBINT ;
CY_AS_MEM_P0_INTR_REG_MBINT;
/*
* register for interrupts
*/
ret = cy_as_hal_configure_interrupts(dev_p) ;
ret = cy_as_hal_configure_interrupts(dev_p);
/*
* enable only MBox & DRQ interrupts for now
*/
cy_as_hal_write_register((cy_as_hal_device_tag)dev_p,
CY_AS_MEM_P0_INT_MASK_REG, mask) ;
CY_AS_MEM_P0_INT_MASK_REG, mask);
return 1 ;
return 1;
}
/*
@ -1175,7 +1175,7 @@ static void p_nand_lbd_read(u16 col_addr, u32 row_addr, u16 count, void *buff)
ptr32 = buff;
do {
pfe_status = IORD32(GPMC_VMA(GPMC_PREFETCH_STATUS)) ;
pfe_status = IORD32(GPMC_VMA(GPMC_PREFETCH_STATUS));
rd_cnt = pfe_status >> (24+2);
while (rd_cnt--)
@ -1481,14 +1481,14 @@ void cy_as_hal_write_register(
*/
uint16_t cy_as_hal_read_register(cy_as_hal_device_tag tag, uint16_t addr)
{
uint16_t data = 0 ;
uint16_t data = 0;
/*
* READ ASTORIA REGISTER USING CASDO
*/
data = ast_p_nand_casdo_read((u8)addr);
return data ;
return data;
}
/*
@ -1587,7 +1587,7 @@ static inline bool prep_for_next_xfer(cy_as_hal_device_tag tag, uint8_t ep)
static void cy_service_e_p_dma_read_request(
cy_as_omap_dev_kernel *dev_p, uint8_t ep)
{
cy_as_hal_device_tag tag = (cy_as_hal_device_tag)dev_p ;
cy_as_hal_device_tag tag = (cy_as_hal_device_tag)dev_p;
uint16_t v, size;
void *dptr;
uint16_t col_addr = 0x0000;
@ -1628,7 +1628,7 @@ static void cy_service_e_p_dma_read_request(
/*
* clear DMAVALID bit indicating that the data has been read
*/
cy_as_hal_write_register(tag, ep_dma_reg, 0) ;
cy_as_hal_write_register(tag, ep_dma_reg, 0);
end_points[ep].seg_xfer_cnt += size;
end_points[ep].req_xfer_cnt += size;
@ -1646,12 +1646,12 @@ static void cy_service_e_p_dma_read_request(
* data we are going to xfer next
*/
v = end_points[ep].dma_xfer_sz/*HAL_DMA_PKT_SZ*/ |
CY_AS_MEM_P0_E_pn_DMA_REG_DMAVAL ;
CY_AS_MEM_P0_E_pn_DMA_REG_DMAVAL;
cy_as_hal_write_register(tag, ep_dma_reg, v);
} else {
end_points[ep].pending = cy_false ;
end_points[ep].type = cy_as_hal_none ;
end_points[ep].buffer_valid = cy_false ;
end_points[ep].pending = cy_false;
end_points[ep].type = cy_as_hal_none;
end_points[ep].buffer_valid = cy_false;
/*
* notify the API that we are done with rq on this EP
@ -1679,13 +1679,13 @@ static void cy_service_e_p_dma_write_request(
uint32_t row_addr = CYAS_DEV_CALC_EP_ADDR(ep);
void *dptr;
cy_as_hal_device_tag tag = (cy_as_hal_device_tag)dev_p ;
cy_as_hal_device_tag tag = (cy_as_hal_device_tag)dev_p;
/*
* note: size here its the size of the dma transfer could be
* anything > 0 && < P_PORT packet size
*/
size = end_points[ep].dma_xfer_sz ;
dptr = end_points[ep].data_p ;
size = end_points[ep].dma_xfer_sz;
dptr = end_points[ep].data_p;
/*
* perform the soft DMA transfer, soft in this case
@ -1708,8 +1708,8 @@ static void cy_service_e_p_dma_write_request(
* or used internally.
*/
addr = CY_AS_MEM_P0_EP2_DMA_REG + ep - 2 ;
cy_as_hal_write_register(tag, addr, size) ;
addr = CY_AS_MEM_P0_EP2_DMA_REG + ep - 2;
cy_as_hal_write_register(tag, addr, size);
/*
* finally, tell the USB subsystem that the
@ -1721,13 +1721,13 @@ static void cy_service_e_p_dma_write_request(
* There is more data to go. Re-init the WestBridge DMA side
*/
v = end_points[ep].dma_xfer_sz |
CY_AS_MEM_P0_E_pn_DMA_REG_DMAVAL ;
cy_as_hal_write_register(tag, addr, v) ;
CY_AS_MEM_P0_E_pn_DMA_REG_DMAVAL;
cy_as_hal_write_register(tag, addr, v);
} else {
end_points[ep].pending = cy_false ;
end_points[ep].type = cy_as_hal_none ;
end_points[ep].buffer_valid = cy_false ;
end_points[ep].pending = cy_false;
end_points[ep].type = cy_as_hal_none;
end_points[ep].buffer_valid = cy_false;
/*
* notify the API that we are done with rq on this EP
@ -1749,17 +1749,17 @@ static void cy_service_e_p_dma_write_request(
*/
static void cy_handle_d_r_q_interrupt(cy_as_omap_dev_kernel *dev_p)
{
uint16_t v ;
static uint8_t service_ep = 2 ;
uint16_t v;
static uint8_t service_ep = 2;
/*
* We've got DRQ INT, read DRQ STATUS Register */
v = cy_as_hal_read_register((cy_as_hal_device_tag)dev_p,
CY_AS_MEM_P0_DRQ) ;
CY_AS_MEM_P0_DRQ);
if (v == 0) {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message("stray DRQ interrupt detected\n") ;
cy_as_hal_print_message("stray DRQ interrupt detected\n");
#endif
return;
}
@ -1773,9 +1773,9 @@ static void cy_handle_d_r_q_interrupt(cy_as_omap_dev_kernel *dev_p)
while ((v & (1 << service_ep)) == 0) {
if (service_ep == 15)
service_ep = 2 ;
service_ep = 2;
else
service_ep++ ;
service_ep++;
}
if (end_points[service_ep].type == cy_as_hal_write) {
@ -1783,19 +1783,19 @@ static void cy_handle_d_r_q_interrupt(cy_as_omap_dev_kernel *dev_p)
* handle DMA WRITE REQUEST: app_cpu will
* write data into astoria EP buffer
*/
cy_service_e_p_dma_write_request(dev_p, service_ep) ;
cy_service_e_p_dma_write_request(dev_p, service_ep);
} else if (end_points[service_ep].type == cy_as_hal_read) {
/*
* handle DMA READ REQUEST: cpu will
* read EP buffer from Astoria
*/
cy_service_e_p_dma_read_request(dev_p, service_ep) ;
cy_service_e_p_dma_read_request(dev_p, service_ep);
}
#ifndef WESTBRIDGE_NDEBUG
else
cy_as_hal_print_message("cyashalomap:interrupt,"
" w/o pending DMA job,"
"-check DRQ_MASK logic\n") ;
"-check DRQ_MASK logic\n");
#endif
/*
@ -1804,9 +1804,9 @@ static void cy_handle_d_r_q_interrupt(cy_as_omap_dev_kernel *dev_p)
*/
if (end_points[service_ep].type == cy_as_hal_none) {
if (service_ep == 15)
service_ep = 2 ;
service_ep = 2;
else
service_ep++ ;
service_ep++;
}
}
@ -1818,7 +1818,7 @@ void cy_as_hal_dma_cancel_request(cy_as_hal_device_tag tag, uint8_t ep)
cy_as_hal_write_register(tag,
CY_AS_MEM_P0_EP2_DMA_REG + ep - 2, 0);
end_points[ep].buffer_valid = cy_false ;
end_points[ep].buffer_valid = cy_false;
end_points[ep].type = cy_as_hal_none;
}
@ -1845,7 +1845,7 @@ void cy_as_hal_dma_setup_write(cy_as_hal_device_tag tag,
uint8_t ep, void *buf,
uint32_t size, uint16_t maxsize)
{
uint32_t addr = 0 ;
uint32_t addr = 0;
uint16_t v = 0;
/*
@ -1853,15 +1853,15 @@ void cy_as_hal_dma_setup_write(cy_as_hal_device_tag tag,
* "maxsize" - is the P port fragment size
* No EP0 or EP1 traffic should get here
*/
cy_as_hal_assert(ep != 0 && ep != 1) ;
cy_as_hal_assert(ep != 0 && ep != 1);
/*
* If this asserts, we have an ordering problem. Another DMA request
* is coming down before the previous one has completed.
*/
cy_as_hal_assert(end_points[ep].buffer_valid == cy_false) ;
end_points[ep].buffer_valid = cy_true ;
end_points[ep].type = cy_as_hal_write ;
cy_as_hal_assert(end_points[ep].buffer_valid == cy_false);
end_points[ep].buffer_valid = cy_true;
end_points[ep].type = cy_as_hal_write;
end_points[ep].pending = cy_true;
/*
@ -1899,7 +1899,7 @@ void cy_as_hal_dma_setup_write(cy_as_hal_device_tag tag,
*/
end_points[ep].sg_p = buf;
end_points[ep].data_p = sg_virt(end_points[ep].sg_p);
end_points[ep].seg_xfer_cnt = 0 ;
end_points[ep].seg_xfer_cnt = 0;
end_points[ep].req_xfer_cnt = 0;
#ifdef DBGPRN_DMA_SETUP_WR
@ -1940,11 +1940,11 @@ void cy_as_hal_dma_setup_write(cy_as_hal_device_tag tag,
* Tell WB we are ready to send data on the given endpoint
*/
v = (end_points[ep].dma_xfer_sz & CY_AS_MEM_P0_E_pn_DMA_REG_COUNT_MASK)
| CY_AS_MEM_P0_E_pn_DMA_REG_DMAVAL ;
| CY_AS_MEM_P0_E_pn_DMA_REG_DMAVAL;
addr = CY_AS_MEM_P0_EP2_DMA_REG + ep - 2 ;
addr = CY_AS_MEM_P0_EP2_DMA_REG + ep - 2;
cy_as_hal_write_register(tag, addr, v) ;
cy_as_hal_write_register(tag, addr, v);
}
/*
@ -1957,15 +1957,15 @@ void cy_as_hal_dma_setup_read(cy_as_hal_device_tag tag,
uint8_t ep, void *buf,
uint32_t size, uint16_t maxsize)
{
uint32_t addr ;
uint16_t v ;
uint32_t addr;
uint16_t v;
/*
* Note: "size" is the actual request size
* "maxsize" - is the P port fragment size
* No EP0 or EP1 traffic should get here
*/
cy_as_hal_assert(ep != 0 && ep != 1) ;
cy_as_hal_assert(ep != 0 && ep != 1);
/*
* If this asserts, we have an ordering problem.
@ -1976,8 +1976,8 @@ void cy_as_hal_dma_setup_read(cy_as_hal_device_tag tag,
cy_as_hal_assert(end_points[ep].buffer_valid == cy_false);
end_points[ep].buffer_valid = cy_true ;
end_points[ep].type = cy_as_hal_read ;
end_points[ep].buffer_valid = cy_true;
end_points[ep].type = cy_as_hal_read;
end_points[ep].pending = cy_true;
end_points[ep].req_xfer_cnt = 0;
end_points[ep].req_length = size;
@ -1996,7 +1996,7 @@ void cy_as_hal_dma_setup_read(cy_as_hal_device_tag tag,
end_points[ep].dma_xfer_sz = size;
}
addr = CY_AS_MEM_P0_EP2_DMA_REG + ep - 2 ;
addr = CY_AS_MEM_P0_EP2_DMA_REG + ep - 2;
if (end_points[ep].sg_list_enabled) {
/*
@ -2005,7 +2005,7 @@ void cy_as_hal_dma_setup_read(cy_as_hal_device_tag tag,
* buf - pointer to the SG list
* data_p - data pointer for the 1st DMA segment
*/
end_points[ep].seg_xfer_cnt = 0 ;
end_points[ep].seg_xfer_cnt = 0;
end_points[ep].sg_p = buf;
end_points[ep].data_p = sg_virt(end_points[ep].sg_p);
@ -2020,7 +2020,7 @@ void cy_as_hal_dma_setup_read(cy_as_hal_device_tag tag,
#endif
v = (end_points[ep].dma_xfer_sz &
CY_AS_MEM_P0_E_pn_DMA_REG_COUNT_MASK) |
CY_AS_MEM_P0_E_pn_DMA_REG_DMAVAL ;
CY_AS_MEM_P0_E_pn_DMA_REG_DMAVAL;
cy_as_hal_write_register(tag, addr, v);
} else {
/*
@ -2045,7 +2045,7 @@ void cy_as_hal_dma_setup_read(cy_as_hal_device_tag tag,
if (is_storage_e_p(ep)) {
v = (end_points[ep].dma_xfer_sz &
CY_AS_MEM_P0_E_pn_DMA_REG_COUNT_MASK) |
CY_AS_MEM_P0_E_pn_DMA_REG_DMAVAL ;
CY_AS_MEM_P0_E_pn_DMA_REG_DMAVAL;
cy_as_hal_write_register(tag, addr, v);
}
}
@ -2061,7 +2061,7 @@ void cy_as_hal_dma_register_callback(cy_as_hal_device_tag tag,
{
DBGPRN("<1>\n%s: WB API has registered a dma_complete callback:%x\n",
__func__, (uint32_t)cb);
callback = cb ;
callback = cb;
}
/*
@ -2106,14 +2106,14 @@ cy_bool cy_as_hal_set_wakeup_pin(cy_as_hal_device_tag tag, cy_bool state)
/*
* Not supported as of now.
*/
return cy_false ;
return cy_false;
}
void cy_as_hal_pll_lock_loss_handler(cy_as_hal_device_tag tag)
{
cy_as_hal_print_message("error: astoria PLL lock is lost\n") ;
cy_as_hal_print_message("error: astoria PLL lock is lost\n");
cy_as_hal_print_message("please check the input voltage levels");
cy_as_hal_print_message("and clock, and restart the system\n") ;
cy_as_hal_print_message("and clock, and restart the system\n");
}
/*
@ -2127,10 +2127,10 @@ void cy_as_hal_pll_lock_loss_handler(cy_as_hal_device_tag tag)
*/
void *cy_as_hal_alloc(uint32_t cnt)
{
void *ret_p ;
void *ret_p;
ret_p = kmalloc(cnt, GFP_ATOMIC) ;
return ret_p ;
ret_p = kmalloc(cnt, GFP_ATOMIC);
return ret_p;
}
/*
@ -2140,7 +2140,7 @@ void *cy_as_hal_alloc(uint32_t cnt)
*/
void cy_as_hal_free(void *mem_p)
{
kfree(mem_p) ;
kfree(mem_p);
}
/*
@ -2150,10 +2150,10 @@ void cy_as_hal_free(void *mem_p)
*/
void *cy_as_hal_c_b_alloc(uint32_t cnt)
{
void *ret_p ;
void *ret_p;
ret_p = kmalloc(cnt, GFP_ATOMIC) ;
return ret_p ;
ret_p = kmalloc(cnt, GFP_ATOMIC);
return ret_p;
}
/*
@ -2163,7 +2163,7 @@ void *cy_as_hal_c_b_alloc(uint32_t cnt)
*/
void cy_as_hal_mem_set(void *ptr, uint8_t value, uint32_t cnt)
{
memset(ptr, value, cnt) ;
memset(ptr, value, cnt);
}
/*
@ -2176,8 +2176,8 @@ void cy_as_hal_mem_set(void *ptr, uint8_t value, uint32_t cnt)
*/
cy_bool cy_as_hal_create_sleep_channel(cy_as_hal_sleep_channel *channel)
{
init_waitqueue_head(&channel->wq) ;
return cy_true ;
init_waitqueue_head(&channel->wq);
return cy_true;
}
/*
@ -2187,7 +2187,7 @@ cy_bool cy_as_hal_create_sleep_channel(cy_as_hal_sleep_channel *channel)
*/
cy_bool cy_as_hal_destroy_sleep_channel(cy_as_hal_sleep_channel *channel)
{
return cy_true ;
return cy_true;
}
/*
@ -2195,8 +2195,8 @@ cy_bool cy_as_hal_destroy_sleep_channel(cy_as_hal_sleep_channel *channel)
*/
cy_bool cy_as_hal_sleep_on(cy_as_hal_sleep_channel *channel, uint32_t ms)
{
wait_event_interruptible_timeout(channel->wq, 0, ((ms * HZ)/1000)) ;
return cy_true ;
wait_event_interruptible_timeout(channel->wq, 0, ((ms * HZ)/1000));
return cy_true;
}
/*
@ -2205,7 +2205,7 @@ cy_bool cy_as_hal_sleep_on(cy_as_hal_sleep_channel *channel, uint32_t ms)
cy_bool cy_as_hal_wake(cy_as_hal_sleep_channel *channel)
{
wake_up_interruptible_all(&channel->wq);
return cy_true ;
return cy_true;
}
uint32_t cy_as_hal_disable_interrupts()
@ -2213,13 +2213,13 @@ uint32_t cy_as_hal_disable_interrupts()
if (0 == intr__enable)
;
intr__enable++ ;
return 0 ;
intr__enable++;
return 0;
}
void cy_as_hal_enable_interrupts(uint32_t val)
{
intr__enable-- ;
intr__enable--;
if (0 == intr__enable)
;
}
@ -2240,9 +2240,9 @@ void cy_as_hal_sleep(uint32_t ms)
{
cy_as_hal_sleep_channel channel;
cy_as_hal_create_sleep_channel(&channel) ;
cy_as_hal_sleep_on(&channel, ms) ;
cy_as_hal_destroy_sleep_channel(&channel) ;
cy_as_hal_create_sleep_channel(&channel);
cy_as_hal_sleep_on(&channel, ms);
cy_as_hal_destroy_sleep_channel(&channel);
}
cy_bool cy_as_hal_is_polling()
@ -2287,7 +2287,7 @@ cy_bool cy_as_hal_sync_device_clocks(cy_as_hal_device_tag tag)
int start_o_m_a_p_kernel(const char *pgm,
cy_as_hal_device_tag *tag, cy_bool debug)
{
cy_as_omap_dev_kernel *dev_p ;
cy_as_omap_dev_kernel *dev_p;
int i;
u16 data16[4];
u8 pncfg_reg;
@ -2302,11 +2302,11 @@ int start_o_m_a_p_kernel(const char *pgm,
/*
* Initialize the HAL level endpoint DMA data.
*/
for (i = 0 ; i < sizeof(end_points)/sizeof(end_points[0]) ; i++) {
end_points[i].data_p = 0 ;
end_points[i].pending = cy_false ;
end_points[i].size = 0 ;
end_points[i].type = cy_as_hal_none ;
for (i = 0; i < sizeof(end_points)/sizeof(end_points[0]); i++) {
end_points[i].data_p = 0;
end_points[i].pending = cy_false;
end_points[i].size = 0;
end_points[i].type = cy_as_hal_none;
end_points[i].sg_list_enabled = cy_false;
/*
@ -2321,11 +2321,11 @@ int start_o_m_a_p_kernel(const char *pgm,
* allocate memory for OMAP HAL
*/
dev_p = (cy_as_omap_dev_kernel *)cy_as_hal_alloc(
sizeof(cy_as_omap_dev_kernel)) ;
sizeof(cy_as_omap_dev_kernel));
if (dev_p == 0) {
cy_as_hal_print_message("out of memory allocating OMAP"
"device structure\n") ;
return 0 ;
"device structure\n");
return 0;
}
dev_p->m_sig = CY_AS_OMAP_KERNEL_HAL_SIG;
@ -2403,11 +2403,11 @@ int start_o_m_a_p_kernel(const char *pgm,
"after cfg_wr:%4.4x\n\n",
data16[0], pncfg_reg, data16[1]);
dev_p->thread_flag = 1 ;
spin_lock_init(&int_lock) ;
dev_p->m_next_p = m_omap_list_p ;
dev_p->thread_flag = 1;
spin_lock_init(&int_lock);
dev_p->m_next_p = m_omap_list_p;
m_omap_list_p = dev_p ;
m_omap_list_p = dev_p;
*tag = dev_p;
cy_as_hal_configure_interrupts((void *)dev_p);
@ -2421,7 +2421,7 @@ int start_o_m_a_p_kernel(const char *pgm,
cy_as_hal_set_ep_dma_mode(4, true);
cy_as_hal_set_ep_dma_mode(8, true);
return 1 ;
return 1;
/*
* there's been a NAND bus access error or
@ -2433,7 +2433,7 @@ bus_acc_error:
* so the device will not call omap_stop
*/
cy_as_hal_omap_hardware_deinit(dev_p);
cy_as_hal_free(dev_p) ;
cy_as_hal_free(dev_p);
return 0;
}

View File

@ -47,7 +47,7 @@
#if !defined(__doxygen__)
typedef int cy_bool ;
typedef int cy_bool;
#define cy_true (1)
#define cy_false (0)
#endif

View File

@ -38,8 +38,8 @@
*/
#include <linux/../../arch/arm/plat-omap/include/plat/gpmc.h>
typedef struct cy_as_hal_sleep_channel_t {
wait_queue_head_t wq ;
} cy_as_hal_sleep_channel ;
wait_queue_head_t wq;
} cy_as_hal_sleep_channel;
/* moved to staging location, eventual location
* considered is here
@ -61,7 +61,7 @@ typedef struct cy_as_hal_sleep_channel_t {
* device in the system. In this case the tag is a void * which is
* really an OMAP device pointer
*/
typedef void *cy_as_hal_device_tag ;
typedef void *cy_as_hal_device_tag;
/* This must be included after the CyAsHalDeviceTag type is defined */
@ -84,7 +84,7 @@ typedef void *cy_as_hal_device_tag ;
*/
void
cy_as_hal_write_register(cy_as_hal_device_tag tag,
uint16_t addr, uint16_t data) ;
uint16_t addr, uint16_t data);
/*
* This function must be defined to read a register from
@ -93,7 +93,7 @@ cy_as_hal_write_register(cy_as_hal_device_tag tag,
* of the west bridge device.
*/
uint16_t
cy_as_hal_read_register(cy_as_hal_device_tag tag, uint16_t addr) ;
cy_as_hal_read_register(cy_as_hal_device_tag tag, uint16_t addr);
/*
* This function must be defined to transfer a block of data
@ -103,7 +103,7 @@ cy_as_hal_read_register(cy_as_hal_device_tag tag, uint16_t addr) ;
*/
void
cy_as_hal_dma_setup_write(cy_as_hal_device_tag tag,
uint8_t ep, void *buf, uint32_t size, uint16_t maxsize) ;
uint8_t ep, void *buf, uint32_t size, uint16_t maxsize);
/*
* This function must be defined to transfer a block of data
@ -113,13 +113,13 @@ cy_as_hal_dma_setup_write(cy_as_hal_device_tag tag,
*/
void
cy_as_hal_dma_setup_read(cy_as_hal_device_tag tag, uint8_t ep,
void *buf, uint32_t size, uint16_t maxsize) ;
void *buf, uint32_t size, uint16_t maxsize);
/*
* This function must be defined to cancel any pending DMA request.
*/
void
cy_as_hal_dma_cancel_request(cy_as_hal_device_tag tag, uint8_t ep) ;
cy_as_hal_dma_cancel_request(cy_as_hal_device_tag tag, uint8_t ep);
/*
* This function must be defined to allow the Antioch API to
@ -128,7 +128,7 @@ cy_as_hal_dma_cancel_request(cy_as_hal_device_tag tag, uint8_t ep) ;
*/
void
cy_as_hal_dma_register_callback(cy_as_hal_device_tag tag,
cy_as_hal_dma_complete_callback cb) ;
cy_as_hal_dma_complete_callback cb);
/*
* This function must be defined to return the maximum size of DMA
@ -138,7 +138,7 @@ cy_as_hal_dma_register_callback(cy_as_hal_device_tag tag,
*/
uint32_t
cy_as_hal_dma_max_request_size(cy_as_hal_device_tag tag,
cy_as_end_point_number_t ep) ;
cy_as_end_point_number_t ep);
/*
* This function must be defined to set the state of the WAKEUP pin
@ -146,14 +146,14 @@ cy_as_hal_dma_max_request_size(cy_as_hal_device_tag tag,
* type.
*/
cy_bool
cy_as_hal_set_wakeup_pin(cy_as_hal_device_tag tag, cy_bool state) ;
cy_as_hal_set_wakeup_pin(cy_as_hal_device_tag tag, cy_bool state);
/*
* This function is called when the Antioch PLL loses lock, because
* of a problem in the supply voltage or the input clock.
*/
void
cy_as_hal_pll_lock_loss_handler(cy_as_hal_device_tag tag) ;
cy_as_hal_pll_lock_loss_handler(cy_as_hal_device_tag tag);
/**********************************************************************
@ -168,14 +168,14 @@ cy_as_hal_pll_lock_loss_handler(cy_as_hal_device_tag tag) ;
* is expected to work exactly like malloc().
*/
void *
cy_as_hal_alloc(uint32_t cnt) ;
cy_as_hal_alloc(uint32_t cnt);
/*
* This function is required by the API to free memory allocated with
* CyAsHalAlloc(). This function is expected to work exacly like free().
*/
void
cy_as_hal_free(void *mem_p) ;
cy_as_hal_free(void *mem_p);
/*
* This function is required by the API to allocate memory during a
@ -183,21 +183,21 @@ cy_as_hal_free(void *mem_p) ;
* time.
*/
void *
cy_as_hal_c_b_alloc(uint32_t cnt) ;
cy_as_hal_c_b_alloc(uint32_t cnt);
/*
* This function is required by the API to free memory allocated with
* CyAsCBHalAlloc().
*/
void
cy_as_hal_c_b_free(void *ptr) ;
cy_as_hal_c_b_free(void *ptr);
/*
* This function is required to set a block of memory to a specific
* value. This function is expected to work exactly like memset()
*/
void
cy_as_hal_mem_set(void *ptr, uint8_t value, uint32_t cnt) ;
cy_as_hal_mem_set(void *ptr, uint8_t value, uint32_t cnt);
/*
* This function is expected to create a sleep channel. The data
@ -205,7 +205,7 @@ cy_as_hal_mem_set(void *ptr, uint8_t value, uint32_t cnt) ;
* pointer in the argument.
*/
cy_bool
cy_as_hal_create_sleep_channel(cy_as_hal_sleep_channel *channel) ;
cy_as_hal_create_sleep_channel(cy_as_hal_sleep_channel *channel);
/*
* This function is expected to destroy a sleep channel. The data
@ -215,16 +215,16 @@ cy_as_hal_create_sleep_channel(cy_as_hal_sleep_channel *channel) ;
cy_bool
cy_as_hal_destroy_sleep_channel(cy_as_hal_sleep_channel *channel) ;
cy_as_hal_destroy_sleep_channel(cy_as_hal_sleep_channel *channel);
cy_bool
cy_as_hal_sleep_on(cy_as_hal_sleep_channel *channel, uint32_t ms) ;
cy_as_hal_sleep_on(cy_as_hal_sleep_channel *channel, uint32_t ms);
cy_bool
cy_as_hal_wake(cy_as_hal_sleep_channel *channel) ;
cy_as_hal_wake(cy_as_hal_sleep_channel *channel);
uint32_t
cy_as_hal_disable_interrupts(void) ;
cy_as_hal_disable_interrupts(void);
void
cy_as_hal_enable_interrupts(uint32_t);
@ -283,7 +283,7 @@ void cy_as_hal_read_regs_before_standby(cy_as_hal_device_tag tag);
/*
CyAsMiscSetLogLevel(uint8_t level)
{
debug_level = level ;
debug_level = level;
}
#ifdef CY_AS_LOG_SUPPORT
@ -292,7 +292,7 @@ void
cy_as_log_debug_message(int level, const char *str)
{
if (level <= debug_level)
cy_as_hal_print_message("log %d: %s\n", level, str) ;
cy_as_hal_print_message("log %d: %s\n", level, str);
}
*/
@ -307,9 +307,9 @@ void cyashal_prn_buf(void *buf, uint16_t offset, int len);
* but are required to be called for this HAL.
*/
int start_o_m_a_p_kernel(const char *pgm,
cy_as_hal_device_tag *tag, cy_bool debug) ;
int stop_o_m_a_p_kernel(const char *pgm, cy_as_hal_device_tag tag) ;
int omap_start_intr(cy_as_hal_device_tag tag) ;
cy_as_hal_device_tag *tag, cy_bool debug);
int stop_o_m_a_p_kernel(const char *pgm, cy_as_hal_device_tag tag);
int omap_start_intr(cy_as_hal_device_tag tag);
void cy_as_hal_set_ep_dma_mode(uint8_t ep, bool sg_xfer_enabled);
/* moved to staging location

View File

@ -44,7 +44,7 @@
*/
typedef struct cy_as_omap_dev_kernel {
/* This is the signature for this data structure */
unsigned int m_sig ;
unsigned int m_sig;
/* Address base of Antioch Device */
void *m_addr_base;

View File

@ -155,7 +155,7 @@ struct cyasblkdev_blk_data {
};
/* pointer to west bridge block data device superstructure */
static struct cyasblkdev_blk_data *gl_bd ;
static struct cyasblkdev_blk_data *gl_bd;
static DECLARE_MUTEX(open_lock);
@ -203,7 +203,7 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_get(
bd->usage++;
#ifndef NBDEBUG
cy_as_hal_print_message(
"cyasblkdev_blk_get: usage = %d\n", bd->usage) ;
"cyasblkdev_blk_get: usage = %d\n", bd->usage);
#endif
}
up(&open_lock);
@ -232,7 +232,7 @@ static void cyasblkdev_blk_put(
bd->usage);
#endif
up(&open_lock);
return ;
return;
}
if (bd->usage == 0) {
@ -245,7 +245,7 @@ static void cyasblkdev_blk_put(
cy_as_storage_release(bd->dev_handle, 0, 0, 0, 0)) {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"cyasblkdev: cannot release bus 0\n") ;
"cyasblkdev: cannot release bus 0\n");
#endif
}
@ -253,7 +253,7 @@ static void cyasblkdev_blk_put(
cy_as_storage_release(bd->dev_handle, 1, 0, 0, 0)) {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"cyasblkdev: cannot release bus 1\n") ;
"cyasblkdev: cannot release bus 1\n");
#endif
}
@ -261,7 +261,7 @@ static void cyasblkdev_blk_put(
cy_as_storage_stop(bd->dev_handle, 0, 0)) {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"cyasblkdev: cannot stop storage stack\n") ;
"cyasblkdev: cannot stop storage stack\n");
#endif
}
@ -269,18 +269,18 @@ static void cyasblkdev_blk_put(
/* If the SCM Kernel HAL is being used, disable the use
* of scatter/gather lists at the end of block driver usage.
*/
cy_as_hal_disable_scatter_list(cyasdevice_gethaltag()) ;
cy_as_hal_disable_scatter_list(cyasdevice_gethaltag());
#endif
/*ptr to global struct cyasblkdev_blk_data */
gl_bd = NULL ;
gl_bd = NULL;
kfree(bd);
}
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"cyasblkdev (blk_put): usage = %d\n",
bd->usage) ;
bd->usage);
#endif
up(&open_lock);
}
@ -498,7 +498,7 @@ static void cyasblkdev_issuecallback(
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"%s: async r/w: op:%d failed with error %d at address %d\n",
__func__, op, status, block_number) ;
__func__, op, status, block_number);
#endif
}
@ -507,7 +507,7 @@ static void cyasblkdev_issuecallback(
"%s calling blk_end_request from issue_callback "
"req=0x%x, status=0x%x, nr_sectors=0x%x\n",
__func__, (unsigned int) gl_bd->queue.req, status,
(unsigned int) blk_rq_sectors(gl_bd->queue.req)) ;
(unsigned int) blk_rq_sectors(gl_bd->queue.req));
#endif
/* note: blk_end_request w/o __ prefix should
@ -560,7 +560,7 @@ static int cyasblkdev_blk_issue_rq(
)
{
struct cyasblkdev_blk_data *bd = bq->data;
int index = 0 ;
int index = 0;
int ret = CY_AS_ERROR_SUCCESS;
uint32_t req_sector = 0;
uint32_t req_nr_sectors = 0;
@ -648,7 +648,7 @@ static int cyasblkdev_blk_issue_rq(
req_nr_sectors*512))
;
bq->req = NULL ;
bq->req = NULL;
}
} else {
ret = cy_as_storage_write_async(bd->dev_handle, bus_num, 0,
@ -669,7 +669,7 @@ static int cyasblkdev_blk_issue_rq(
req_nr_sectors*512))
;
bq->req = NULL ;
bq->req = NULL;
}
}
@ -741,7 +741,7 @@ uint32_t cyasblkdev_get_vfat_offset(int bus_num, int unit_no)
*/
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"%s scanning media for vfat partition...\n", __func__) ;
"%s scanning media for vfat partition...\n", __func__);
#endif
for (sect_no = 0; sect_no < SECTORS_TO_SCAN; sect_no++) {
@ -808,7 +808,7 @@ uint32_t cyasblkdev_get_vfat_offset(int bus_num, int unit_no)
}
}
cy_as_storage_query_device_data dev_data = {0} ;
cy_as_storage_query_device_data dev_data = {0};
static int cyasblkdev_add_disks(int bus_num,
struct cyasblkdev_blk_data *bd,
@ -818,7 +818,7 @@ static int cyasblkdev_add_disks(int bus_num,
int ret = 0;
uint64_t disk_cap;
int lcl_unit_no;
cy_as_storage_query_unit_data unit_data = {0} ;
cy_as_storage_query_unit_data unit_data = {0};
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message("%s:query device: "
@ -843,29 +843,29 @@ static int cyasblkdev_add_disks(int bus_num,
"%s: device is locked\n", __func__);
#endif
ret = cy_as_storage_release(
bd->dev_handle, bus_num, 0, 0, 0) ;
bd->dev_handle, bus_num, 0, 0, 0);
if (ret != CY_AS_ERROR_SUCCESS) {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message("%s cannot release"
" storage\n", __func__) ;
" storage\n", __func__);
#endif
goto out;
}
goto out;
}
unit_data.device = 0 ;
unit_data.unit = 0 ;
unit_data.device = 0;
unit_data.unit = 0;
unit_data.bus = bus_num;
ret = cy_as_storage_query_unit(bd->dev_handle,
&unit_data, 0, 0) ;
&unit_data, 0, 0);
if (ret != CY_AS_ERROR_SUCCESS) {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message("%s: cannot query "
"%d device unit - reason code %d\n",
__func__, bus_num, ret) ;
__func__, bus_num, ret);
#endif
goto out ;
goto out;
}
if (private_partition_bus == bus_num) {
@ -906,15 +906,15 @@ static int cyasblkdev_add_disks(int bus_num,
bd->dev_handle, bus_num, 0,
private_partition_size, 0, 0);
if (ret == CY_AS_ERROR_SUCCESS) {
unit_data.bus = bus_num ;
unit_data.device = 0 ;
unit_data.unit = 1 ;
unit_data.bus = bus_num;
unit_data.device = 0;
unit_data.unit = 1;
} else {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"%s: cy_as_storage_create_p_partition "
"after removal unexpectedly failed "
"with error %d\n", __func__, ret) ;
"with error %d\n", __func__, ret);
#endif
/* need to requery bus
@ -922,22 +922,22 @@ static int cyasblkdev_add_disks(int bus_num,
* successful and create
* failed we have changed
* the disk properties */
unit_data.bus = bus_num ;
unit_data.device = 0 ;
unit_data.unit = 0 ;
unit_data.bus = bus_num;
unit_data.device = 0;
unit_data.unit = 0;
}
ret = cy_as_storage_query_unit(
bd->dev_handle,
&unit_data, 0, 0) ;
&unit_data, 0, 0);
if (ret != CY_AS_ERROR_SUCCESS) {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"%s: cannot query %d "
"device unit - reason code %d\n",
__func__, bus_num, ret) ;
__func__, bus_num, ret);
#endif
goto out ;
goto out;
} else {
disk_cap = (uint64_t)
(unit_data.desc_p.unit_size);
@ -952,27 +952,27 @@ static int cyasblkdev_add_disks(int bus_num,
__func__, ret);
#endif
unit_data.bus = bus_num ;
unit_data.device = 0 ;
unit_data.unit = 1 ;
unit_data.bus = bus_num;
unit_data.device = 0;
unit_data.unit = 1;
ret = cy_as_storage_query_unit(
bd->dev_handle, &unit_data, 0, 0) ;
bd->dev_handle, &unit_data, 0, 0);
if (ret != CY_AS_ERROR_SUCCESS) {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"%s: cannot query %d "
"device unit - reason "
"code %d\n", __func__,
bus_num, ret) ;
bus_num, ret);
#endif
goto out ;
goto out;
}
disk_cap = (uint64_t)
(unit_data.desc_p.unit_size);
lcl_unit_no =
unit_data.unit ;
unit_data.unit;
}
} else {
#ifndef WESTBRIDGE_NDEBUG
@ -983,25 +983,25 @@ static int cyasblkdev_add_disks(int bus_num,
/*partition already existed,
* need to query second unit*/
unit_data.bus = bus_num ;
unit_data.device = 0 ;
unit_data.unit = 1 ;
unit_data.bus = bus_num;
unit_data.device = 0;
unit_data.unit = 1;
ret = cy_as_storage_query_unit(
bd->dev_handle, &unit_data, 0, 0) ;
bd->dev_handle, &unit_data, 0, 0);
if (ret != CY_AS_ERROR_SUCCESS) {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"%s: cannot query %d "
"device unit "
"- reason code %d\n",
__func__, bus_num, ret) ;
__func__, bus_num, ret);
#endif
goto out ;
goto out;
} else {
disk_cap = (uint64_t)
(unit_data.desc_p.unit_size);
lcl_unit_no = unit_data.unit ;
lcl_unit_no = unit_data.unit;
}
}
} else {
@ -1067,7 +1067,7 @@ static int cyasblkdev_add_disks(int bus_num,
/* this will create a
* queue kernel thread */
cyasblkdev_init_queue(
&bd->queue, &bd->lock) ;
&bd->queue, &bd->lock);
bd->queue.prep_fn = cyasblkdev_blk_prep_rq;
bd->queue.issue_fn = cyasblkdev_blk_issue_rq;
@ -1261,7 +1261,7 @@ static int cyasblkdev_add_disks(int bus_num,
if (bd->system_disk == NULL) {
kfree(bd);
bd = ERR_PTR(-ENOMEM);
return bd ;
return bd;
}
disk_cap = (uint64_t)
(private_partition_size);
@ -1294,7 +1294,7 @@ static int cyasblkdev_add_disks(int bus_num,
else {
cy_as_hal_print_message(
"%s: system disk already allocated %d\n",
__func__, bus_num) ;
__func__, bus_num);
}
#endif
}
@ -1305,8 +1305,8 @@ out:
static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void)
{
struct cyasblkdev_blk_data *bd;
int ret = 0 ;
cy_as_return_status_t stat = -1 ;
int ret = 0;
cy_as_return_status_t stat = -1;
int bus_num = 0;
int total_media_count = 0;
int devidx = 0;
@ -1322,7 +1322,7 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void)
bd = kzalloc(sizeof(struct cyasblkdev_blk_data), GFP_KERNEL);
if (bd) {
gl_bd = bd ;
gl_bd = bd;
spin_lock_init(&bd->lock);
bd->usage = 1;
@ -1331,14 +1331,14 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void)
bd->blkops = &cyasblkdev_bdops;
/* Get the device handle */
bd->dev_handle = cyasdevice_getdevhandle() ;
bd->dev_handle = cyasdevice_getdevhandle();
if (0 == bd->dev_handle) {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"%s: get device failed\n", __func__) ;
"%s: get device failed\n", __func__);
#endif
ret = ENODEV ;
goto out ;
ret = ENODEV;
goto out;
}
#ifndef WESTBRIDGE_NDEBUG
@ -1350,7 +1350,7 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void)
* device we are interested in. */
/* Error code to use if the conditions are not satisfied. */
ret = ENOMEDIUM ;
ret = ENOMEDIUM;
stat = cy_as_misc_release_resource(bd->dev_handle, cy_as_bus_0);
if ((stat != CY_AS_ERROR_SUCCESS) &&
@ -1358,7 +1358,7 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void)
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message("%s: cannot release "
"resource bus 0 - reason code %d\n",
__func__, stat) ;
__func__, stat);
#endif
}
@ -1368,16 +1368,16 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void)
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message("%s: cannot release "
"resource bus 0 - reason code %d\n",
__func__, stat) ;
__func__, stat);
#endif
}
/* start storage stack*/
stat = cy_as_storage_start(bd->dev_handle, 0, 0x101) ;
stat = cy_as_storage_start(bd->dev_handle, 0, 0x101);
if (stat != CY_AS_ERROR_SUCCESS) {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message("%s: cannot start storage "
"stack - reason code %d\n", __func__, stat) ;
"stack - reason code %d\n", __func__, stat);
#endif
goto out;
}
@ -1392,14 +1392,14 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void)
if (stat != CY_AS_ERROR_SUCCESS) {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message("%s: cannot register callback "
"- reason code %d\n", __func__, stat) ;
"- reason code %d\n", __func__, stat);
#endif
goto out;
}
for (bus_num = 0; bus_num < 2; bus_num++) {
stat = cy_as_storage_query_bus(bd->dev_handle,
bus_num, &bd->media_count[bus_num], 0, 0) ;
bus_num, &bd->media_count[bus_num], 0, 0);
if (stat == CY_AS_ERROR_SUCCESS) {
total_media_count = total_media_count +
bd->media_count[bus_num];
@ -1407,7 +1407,7 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void)
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message("%s: cannot query %d, "
"reason code: %d\n",
__func__, bus_num, stat) ;
__func__, bus_num, stat);
#endif
goto out;
}
@ -1416,9 +1416,9 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void)
if (total_media_count == 0) {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"%s: no storage media was found\n", __func__) ;
"%s: no storage media was found\n", __func__);
#endif
goto out ;
goto out;
} else if (total_media_count >= 1) {
if (bd->user_disk_0 == NULL) {
@ -1428,7 +1428,7 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void)
if (bd->user_disk_0 == NULL) {
kfree(bd);
bd = ERR_PTR(-ENOMEM);
return bd ;
return bd;
}
}
#ifndef WESTBRIDGE_NDEBUG
@ -1448,7 +1448,7 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void)
if (bd->user_disk_1 == NULL) {
kfree(bd);
bd = ERR_PTR(-ENOMEM);
return bd ;
return bd;
}
}
#ifndef WESTBRIDGE_NDEBUG
@ -1468,25 +1468,25 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void)
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message("%s: %d device(s) found\n",
__func__, total_media_count) ;
__func__, total_media_count);
#endif
for (bus_num = 0; bus_num <= 1; bus_num++) {
/*claim storage for cpu */
stat = cy_as_storage_claim(bd->dev_handle,
bus_num, 0, 0, 0) ;
bus_num, 0, 0, 0);
if (stat != CY_AS_ERROR_SUCCESS) {
cy_as_hal_print_message("%s: cannot claim "
"%d bus - reason code %d\n",
__func__, bus_num, stat) ;
__func__, bus_num, stat);
goto out;
}
dev_data.bus = bus_num ;
dev_data.device = 0 ;
dev_data.bus = bus_num;
dev_data.device = 0;
stat = cy_as_storage_query_device(bd->dev_handle,
&dev_data, 0, 0) ;
&dev_data, 0, 0);
if (stat == CY_AS_ERROR_SUCCESS) {
cyasblkdev_add_disks(bus_num, bd,
total_media_count, devidx);
@ -1494,20 +1494,20 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void)
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"%s: no device on bus %d\n",
__func__, bus_num) ;
__func__, bus_num);
#endif
} else {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"%s: cannot query %d device "
"- reason code %d\n",
__func__, bus_num, stat) ;
__func__, bus_num, stat);
#endif
goto out ;
goto out;
}
} /* end for (bus_num = 0; bus_num <= 1; bus_num++)*/
return bd ;
return bd;
}
out:
#ifndef WESTBRIDGE_NDEBUG
@ -1546,7 +1546,7 @@ static int cyasblkdev_blk_initialize(void)
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"%s cyasblkdev registered with major number: %d\n",
__func__, major) ;
__func__, major);
#endif
bd = cyasblkdev_blk_alloc();

View File

@ -98,7 +98,7 @@ static int cyasblkdev_prep_request(
if (req->cmd_type != REQ_TYPE_FS && !(req->cmd_flags & REQ_DISCARD)) {
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message("%s:%x bad request received\n",
__func__, current->pid) ;
__func__, current->pid);
#endif
blk_dump_rq_flags(req, "cyasblkdev bad request");
@ -136,7 +136,7 @@ static int cyasblkdev_queue_thread(void *d)
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message(
"%s:%x started, bq:%p, q:%p\n", __func__, qth_pid, bq, q) ;
"%s:%x started, bq:%p, q:%p\n", __func__, qth_pid, bq, q);
#endif
do {
@ -249,7 +249,7 @@ static int cyasblkdev_queue_thread(void *d)
complete_and_exit(&bq->thread_complete, 0);
#ifndef WESTBRIDGE_NDEBUG
cy_as_hal_print_message("%s: is finished\n", __func__) ;
cy_as_hal_print_message("%s: is finished\n", __func__);
#endif
return 0;

View File

@ -55,7 +55,7 @@ extern void cyasblkdev_cleanup_queue(struct cyasblkdev_queue *);
extern void cyasblkdev_queue_suspend(struct cyasblkdev_queue *);
extern void cyasblkdev_queue_resume(struct cyasblkdev_queue *);
extern cy_as_device_handle cyasdevice_getdevhandle(void) ;
extern cy_as_device_handle cyasdevice_getdevhandle(void);
#define MOD_LOGS 1
void verbose_rq_flags(int flags);

View File

@ -26,77 +26,77 @@
* The APIs to create a device handle and download firmware are not exported
* because they are expected to be used only by this kernel module.
*/
EXPORT_SYMBOL(cy_as_misc_get_firmware_version) ;
EXPORT_SYMBOL(cy_as_misc_read_m_c_u_register) ;
EXPORT_SYMBOL(cy_as_misc_reset) ;
EXPORT_SYMBOL(cy_as_misc_acquire_resource) ;
EXPORT_SYMBOL(cy_as_misc_release_resource) ;
EXPORT_SYMBOL(cy_as_misc_enter_standby) ;
EXPORT_SYMBOL(cy_as_misc_leave_standby) ;
EXPORT_SYMBOL(cy_as_misc_enter_suspend) ;
EXPORT_SYMBOL(cy_as_misc_leave_suspend) ;
EXPORT_SYMBOL(cy_as_misc_storage_changed) ;
EXPORT_SYMBOL(cy_as_misc_heart_beat_control) ;
EXPORT_SYMBOL(cy_as_misc_get_gpio_value) ;
EXPORT_SYMBOL(cy_as_misc_set_gpio_value) ;
EXPORT_SYMBOL(cy_as_misc_set_low_speed_sd_freq) ;
EXPORT_SYMBOL(cy_as_misc_set_high_speed_sd_freq) ;
EXPORT_SYMBOL(cy_as_misc_get_firmware_version);
EXPORT_SYMBOL(cy_as_misc_read_m_c_u_register);
EXPORT_SYMBOL(cy_as_misc_reset);
EXPORT_SYMBOL(cy_as_misc_acquire_resource);
EXPORT_SYMBOL(cy_as_misc_release_resource);
EXPORT_SYMBOL(cy_as_misc_enter_standby);
EXPORT_SYMBOL(cy_as_misc_leave_standby);
EXPORT_SYMBOL(cy_as_misc_enter_suspend);
EXPORT_SYMBOL(cy_as_misc_leave_suspend);
EXPORT_SYMBOL(cy_as_misc_storage_changed);
EXPORT_SYMBOL(cy_as_misc_heart_beat_control);
EXPORT_SYMBOL(cy_as_misc_get_gpio_value);
EXPORT_SYMBOL(cy_as_misc_set_gpio_value);
EXPORT_SYMBOL(cy_as_misc_set_low_speed_sd_freq);
EXPORT_SYMBOL(cy_as_misc_set_high_speed_sd_freq);
/*
* Export the USB APIs that can be used by the dependent kernel modules.
*/
EXPORT_SYMBOL(cy_as_usb_set_end_point_config) ;
EXPORT_SYMBOL(cy_as_usb_read_data_async) ;
EXPORT_SYMBOL(cy_as_usb_write_data_async) ;
EXPORT_SYMBOL(cy_as_usb_cancel_async) ;
EXPORT_SYMBOL(cy_as_usb_set_stall) ;
EXPORT_SYMBOL(cy_as_usb_clear_stall) ;
EXPORT_SYMBOL(cy_as_usb_connect) ;
EXPORT_SYMBOL(cy_as_usb_disconnect) ;
EXPORT_SYMBOL(cy_as_usb_start) ;
EXPORT_SYMBOL(cy_as_usb_stop) ;
EXPORT_SYMBOL(cy_as_usb_set_enum_config) ;
EXPORT_SYMBOL(cy_as_usb_get_enum_config) ;
EXPORT_SYMBOL(cy_as_usb_set_physical_configuration) ;
EXPORT_SYMBOL(cy_as_usb_register_callback) ;
EXPORT_SYMBOL(cy_as_usb_commit_config) ;
EXPORT_SYMBOL(cy_as_usb_set_descriptor) ;
EXPORT_SYMBOL(cy_as_usb_clear_descriptors) ;
EXPORT_SYMBOL(cy_as_usb_get_descriptor) ;
EXPORT_SYMBOL(cy_as_usb_get_end_point_config) ;
EXPORT_SYMBOL(cy_as_usb_read_data) ;
EXPORT_SYMBOL(cy_as_usb_write_data) ;
EXPORT_SYMBOL(cy_as_usb_get_stall) ;
EXPORT_SYMBOL(cy_as_usb_set_nak) ;
EXPORT_SYMBOL(cy_as_usb_clear_nak) ;
EXPORT_SYMBOL(cy_as_usb_get_nak) ;
EXPORT_SYMBOL(cy_as_usb_signal_remote_wakeup) ;
EXPORT_SYMBOL(cy_as_usb_set_m_s_report_threshold) ;
EXPORT_SYMBOL(cy_as_usb_select_m_s_partitions) ;
EXPORT_SYMBOL(cy_as_usb_set_end_point_config);
EXPORT_SYMBOL(cy_as_usb_read_data_async);
EXPORT_SYMBOL(cy_as_usb_write_data_async);
EXPORT_SYMBOL(cy_as_usb_cancel_async);
EXPORT_SYMBOL(cy_as_usb_set_stall);
EXPORT_SYMBOL(cy_as_usb_clear_stall);
EXPORT_SYMBOL(cy_as_usb_connect);
EXPORT_SYMBOL(cy_as_usb_disconnect);
EXPORT_SYMBOL(cy_as_usb_start);
EXPORT_SYMBOL(cy_as_usb_stop);
EXPORT_SYMBOL(cy_as_usb_set_enum_config);
EXPORT_SYMBOL(cy_as_usb_get_enum_config);
EXPORT_SYMBOL(cy_as_usb_set_physical_configuration);
EXPORT_SYMBOL(cy_as_usb_register_callback);
EXPORT_SYMBOL(cy_as_usb_commit_config);
EXPORT_SYMBOL(cy_as_usb_set_descriptor);
EXPORT_SYMBOL(cy_as_usb_clear_descriptors);
EXPORT_SYMBOL(cy_as_usb_get_descriptor);
EXPORT_SYMBOL(cy_as_usb_get_end_point_config);
EXPORT_SYMBOL(cy_as_usb_read_data);
EXPORT_SYMBOL(cy_as_usb_write_data);
EXPORT_SYMBOL(cy_as_usb_get_stall);
EXPORT_SYMBOL(cy_as_usb_set_nak);
EXPORT_SYMBOL(cy_as_usb_clear_nak);
EXPORT_SYMBOL(cy_as_usb_get_nak);
EXPORT_SYMBOL(cy_as_usb_signal_remote_wakeup);
EXPORT_SYMBOL(cy_as_usb_set_m_s_report_threshold);
EXPORT_SYMBOL(cy_as_usb_select_m_s_partitions);
/*
* Export all Storage APIs that can be used by dependent kernel modules.
*/
EXPORT_SYMBOL(cy_as_storage_start) ;
EXPORT_SYMBOL(cy_as_storage_stop) ;
EXPORT_SYMBOL(cy_as_storage_register_callback) ;
EXPORT_SYMBOL(cy_as_storage_query_bus) ;
EXPORT_SYMBOL(cy_as_storage_query_media) ;
EXPORT_SYMBOL(cy_as_storage_query_device) ;
EXPORT_SYMBOL(cy_as_storage_query_unit) ;
EXPORT_SYMBOL(cy_as_storage_device_control) ;
EXPORT_SYMBOL(cy_as_storage_claim) ;
EXPORT_SYMBOL(cy_as_storage_release) ;
EXPORT_SYMBOL(cy_as_storage_read) ;
EXPORT_SYMBOL(cy_as_storage_write) ;
EXPORT_SYMBOL(cy_as_storage_read_async) ;
EXPORT_SYMBOL(cy_as_storage_write_async) ;
EXPORT_SYMBOL(cy_as_storage_cancel_async) ;
EXPORT_SYMBOL(cy_as_storage_sd_register_read) ;
EXPORT_SYMBOL(cy_as_storage_create_p_partition) ;
EXPORT_SYMBOL(cy_as_storage_remove_p_partition) ;
EXPORT_SYMBOL(cy_as_storage_get_transfer_amount) ;
EXPORT_SYMBOL(cy_as_storage_erase) ;
EXPORT_SYMBOL(cy_as_storage_start);
EXPORT_SYMBOL(cy_as_storage_stop);
EXPORT_SYMBOL(cy_as_storage_register_callback);
EXPORT_SYMBOL(cy_as_storage_query_bus);
EXPORT_SYMBOL(cy_as_storage_query_media);
EXPORT_SYMBOL(cy_as_storage_query_device);
EXPORT_SYMBOL(cy_as_storage_query_unit);
EXPORT_SYMBOL(cy_as_storage_device_control);
EXPORT_SYMBOL(cy_as_storage_claim);
EXPORT_SYMBOL(cy_as_storage_release);
EXPORT_SYMBOL(cy_as_storage_read);
EXPORT_SYMBOL(cy_as_storage_write);
EXPORT_SYMBOL(cy_as_storage_read_async);
EXPORT_SYMBOL(cy_as_storage_write_async);
EXPORT_SYMBOL(cy_as_storage_cancel_async);
EXPORT_SYMBOL(cy_as_storage_sd_register_read);
EXPORT_SYMBOL(cy_as_storage_create_p_partition);
EXPORT_SYMBOL(cy_as_storage_remove_p_partition);
EXPORT_SYMBOL(cy_as_storage_get_transfer_amount);
EXPORT_SYMBOL(cy_as_storage_erase);
EXPORT_SYMBOL(cy_as_sdio_query_card);
EXPORT_SYMBOL(cy_as_sdio_init_function);
@ -106,13 +106,13 @@ EXPORT_SYMBOL(cy_as_sdio_direct_write);
EXPORT_SYMBOL(cy_as_sdio_extended_read);
EXPORT_SYMBOL(cy_as_sdio_extended_write);
EXPORT_SYMBOL(cy_as_hal_alloc) ;
EXPORT_SYMBOL(cy_as_hal_free) ;
EXPORT_SYMBOL(cy_as_hal_sleep) ;
EXPORT_SYMBOL(cy_as_hal_create_sleep_channel) ;
EXPORT_SYMBOL(cy_as_hal_destroy_sleep_channel) ;
EXPORT_SYMBOL(cy_as_hal_sleep_on) ;
EXPORT_SYMBOL(cy_as_hal_wake) ;
EXPORT_SYMBOL(cy_as_hal_alloc);
EXPORT_SYMBOL(cy_as_hal_free);
EXPORT_SYMBOL(cy_as_hal_sleep);
EXPORT_SYMBOL(cy_as_hal_create_sleep_channel);
EXPORT_SYMBOL(cy_as_hal_destroy_sleep_channel);
EXPORT_SYMBOL(cy_as_hal_sleep_on);
EXPORT_SYMBOL(cy_as_hal_wake);
EXPORT_SYMBOL(cy_as_hal_mem_set);
EXPORT_SYMBOL(cy_as_mtp_storage_only_start);
@ -125,8 +125,8 @@ EXPORT_SYMBOL(cy_as_mtp_cancel_get_object);
#ifdef __CY_ASTORIA_SCM_KERNEL_HAL__
/* Functions in the SCM kernel HAL implementation only. */
EXPORT_SYMBOL(cy_as_hal_enable_scatter_list) ;
EXPORT_SYMBOL(cy_as_hal_disable_scatter_list) ;
EXPORT_SYMBOL(cy_as_hal_enable_scatter_list);
EXPORT_SYMBOL(cy_as_hal_disable_scatter_list);
#endif
/*[]*/

View File

@ -48,12 +48,12 @@ typedef struct cyasdevice {
cy_as_device_handle dev_handle;
/* Handle to the HAL */
cy_as_hal_device_tag hal_tag;
} cyasdevice ;
} cyasdevice;
/* global ptr to astoria device */
static cyasdevice *cy_as_device_controller ;
static cyasdevice *cy_as_device_controller;
int cy_as_device_init_done;
const char *dev_handle_name = "cy_astoria_dev_handle" ;
const char *dev_handle_name = "cy_astoria_dev_handle";
#ifdef CONFIG_MACH_OMAP3_WESTBRIDGE_AST_PNAND_HAL
extern void cy_as_hal_config_c_s_mux(void);
@ -61,17 +61,17 @@ extern void cy_as_hal_config_c_s_mux(void);
static void cyasdevice_deinit(cyasdevice *cy_as_dev)
{
cy_as_hal_print_message("<1>_cy_as_device deinitialize called\n") ;
cy_as_hal_print_message("<1>_cy_as_device deinitialize called\n");
if (!cy_as_dev) {
cy_as_hal_print_message("<1>_cy_as_device_deinit: "
"device handle %x is invalid\n", (uint32_t)cy_as_dev) ;
return ;
"device handle %x is invalid\n", (uint32_t)cy_as_dev);
return;
}
/* stop west_brige */
if (cy_as_dev->dev_handle) {
cy_as_hal_print_message("<1>_cy_as_device: "
"cy_as_misc_destroy_device called\n") ;
"cy_as_misc_destroy_device called\n");
if (cy_as_misc_destroy_device(cy_as_dev->dev_handle) !=
CY_AS_ERROR_SUCCESS) {
cy_as_hal_print_message(
@ -89,40 +89,40 @@ static void cyasdevice_deinit(cyasdevice *cy_as_dev)
#endif
}
cy_as_hal_print_message("<1>_cy_as_device:HAL layer stopped\n") ;
cy_as_hal_print_message("<1>_cy_as_device:HAL layer stopped\n");
kfree(cy_as_dev) ;
cy_as_device_controller = NULL ;
cy_as_hal_print_message("<1>_cy_as_device: deinitialized\n") ;
kfree(cy_as_dev);
cy_as_device_controller = NULL;
cy_as_hal_print_message("<1>_cy_as_device: deinitialized\n");
}
/*called from src/cyasmisc.c:MyMiscCallback() as a func
* pointer [dev_p->misc_event_cb] which was previously
* registered by CyAsLLRegisterRequestCallback(...,
* MyMiscCallback) ; called from CyAsMiscConfigureDevice()
* MyMiscCallback); called from CyAsMiscConfigureDevice()
* which is in turn called from cyasdevice_initialize() in
* this src
*/
static void cy_misc_callback(cy_as_device_handle h,
cy_as_misc_event_type evtype, void *evdata)
{
(void)h ;
(void)evdata ;
(void)h;
(void)evdata;
switch (evtype) {
case cy_as_event_misc_initialized:
cy_as_hal_print_message("<1>_cy_as_device: "
"initialization done callback triggered\n") ;
cy_as_device_init_done = 1 ;
break ;
"initialization done callback triggered\n");
cy_as_device_init_done = 1;
break;
case cy_as_event_misc_awake:
cy_as_hal_print_message("<1>_cy_as_device: "
"cy_as_event_misc_awake event callback triggered\n") ;
cy_as_device_init_done = 1 ;
break ;
"cy_as_event_misc_awake event callback triggered\n");
cy_as_device_init_done = 1;
break;
default:
break ;
break;
}
}
@ -133,7 +133,7 @@ void hal_reset(cy_as_hal_device_tag tag)
cy_as_hal_print_message("<1> send soft hard rst: "
"MEM_RST_CTRL_REG_HARD...\n");
cy_as_hal_write_register(tag, CY_AS_MEM_RST_CTRL_REG,
CY_AS_MEM_RST_CTRL_REG_HARD) ;
CY_AS_MEM_RST_CTRL_REG_HARD);
mdelay(60);
cy_as_hal_print_message("<1> after RST: si_rev_REG:%x, "
@ -144,7 +144,7 @@ void hal_reset(cy_as_hal_device_tag tag)
/* set it to LBD */
cy_as_hal_write_register(tag, CY_AS_MEM_PNAND_CFG,
PNAND_REG_CFG_INIT_VAL) ;
PNAND_REG_CFG_INIT_VAL);
}
EXPORT_SYMBOL(hal_reset);
@ -175,13 +175,13 @@ static struct platform_driver west_bridge_driver = {
/* west bridge device driver main init */
static int cyasdevice_initialize(void)
{
cyasdevice *cy_as_dev = 0 ;
int ret = 0 ;
int retval = 0 ;
cy_as_device_config config ;
cy_as_hal_sleep_channel channel ;
cyasdevice *cy_as_dev = 0;
int ret = 0;
int retval = 0;
cy_as_device_config config;
cy_as_hal_sleep_channel channel;
cy_as_get_firmware_version_data ver_data = {0};
const char *str = "" ;
const char *str = "";
int spin_lim;
const struct firmware *fw_entry;
@ -189,19 +189,19 @@ static int cyasdevice_initialize(void)
cy_as_misc_set_log_level(8);
cy_as_hal_print_message("<1>_cy_as_device initialize called\n") ;
cy_as_hal_print_message("<1>_cy_as_device initialize called\n");
if (cy_as_device_controller != 0) {
cy_as_hal_print_message("<1>_cy_as_device: the device "
"has already been initilaized. ignoring\n") ;
return -EBUSY ;
"has already been initilaized. ignoring\n");
return -EBUSY;
}
/* cy_as_dev = CyAsHalAlloc (sizeof(cyasdevice), SLAB_KERNEL); */
cy_as_dev = cy_as_hal_alloc(sizeof(cyasdevice));
if (cy_as_dev == NULL) {
cy_as_hal_print_message("<1>_cy_as_device: "
"memmory allocation failed\n") ;
"memmory allocation failed\n");
return -ENOMEM;
}
memset(cy_as_dev, 0, sizeof(cyasdevice));
@ -216,7 +216,7 @@ static int cyasdevice_initialize(void)
&(cy_as_dev->hal_tag), cy_false)) {
cy_as_hal_print_message(
"<1>_cy_as_device: start OMAP34xx HAL failed\n") ;
"<1>_cy_as_device: start OMAP34xx HAL failed\n");
goto done;
}
#endif
@ -226,28 +226,28 @@ static int cyasdevice_initialize(void)
cy_as_dev->hal_tag) != CY_AS_ERROR_SUCCESS) {
cy_as_hal_print_message(
"<1>_cy_as_device: create device failed\n") ;
goto done ;
"<1>_cy_as_device: create device failed\n");
goto done;
}
memset(&config, 0, sizeof(config));
config.dmaintr = cy_true;
ret = cy_as_misc_configure_device(cy_as_dev->dev_handle, &config) ;
ret = cy_as_misc_configure_device(cy_as_dev->dev_handle, &config);
if (ret != CY_AS_ERROR_SUCCESS) {
cy_as_hal_print_message(
"<1>_cy_as_device: configure device "
"failed. reason code: %d\n", ret) ;
"failed. reason code: %d\n", ret);
goto done;
}
ret = cy_as_misc_register_callback(cy_as_dev->dev_handle,
cy_misc_callback) ;
cy_misc_callback);
if (ret != CY_AS_ERROR_SUCCESS) {
cy_as_hal_print_message("<1>_cy_as_device: "
"cy_as_misc_register_callback failed. "
"reason code: %d\n", ret) ;
"reason code: %d\n", ret);
goto done;
}
@ -275,12 +275,12 @@ static int cyasdevice_initialize(void)
cy_as_dev->dev_handle,
fw_entry->data,
fw_entry->size ,
0, 0) ;
0, 0);
}
if (ret != CY_AS_ERROR_SUCCESS) {
cy_as_hal_print_message("<1>_cy_as_device: cannot download "
"firmware. reason code: %d\n", ret) ;
"firmware. reason code: %d\n", ret);
goto done;
}
@ -289,10 +289,10 @@ static int cyasdevice_initialize(void)
* to complete is 5sec*/
spin_lim = 50;
cy_as_hal_create_sleep_channel(&channel) ;
cy_as_hal_create_sleep_channel(&channel);
while (!cy_as_device_init_done) {
cy_as_hal_sleep_on(&channel, 100) ;
cy_as_hal_sleep_on(&channel, 100);
if (spin_lim-- <= 0) {
cy_as_hal_print_message(
@ -301,46 +301,46 @@ static int cyasdevice_initialize(void)
break;
}
}
cy_as_hal_destroy_sleep_channel(&channel) ;
cy_as_hal_destroy_sleep_channel(&channel);
if (spin_lim > 0)
cy_as_hal_print_message(
"cy_as_device: astoria firmware is loaded\n") ;
"cy_as_device: astoria firmware is loaded\n");
ret = cy_as_misc_get_firmware_version(cy_as_dev->dev_handle,
&ver_data, 0, 0) ;
&ver_data, 0, 0);
if (ret != CY_AS_ERROR_SUCCESS) {
cy_as_hal_print_message("<1>_cy_as_device: cannot get firmware "
"version. reason code: %d\n", ret) ;
"version. reason code: %d\n", ret);
goto done;
}
if ((ver_data.media_type & 0x01) && (ver_data.media_type & 0x06))
str = "nand and SD/MMC." ;
str = "nand and SD/MMC.";
else if ((ver_data.media_type & 0x01) && (ver_data.media_type & 0x08))
str = "nand and CEATA." ;
str = "nand and CEATA.";
else if (ver_data.media_type & 0x01)
str = "nand." ;
str = "nand.";
else if (ver_data.media_type & 0x08)
str = "CEATA." ;
str = "CEATA.";
else
str = "SD/MMC." ;
str = "SD/MMC.";
cy_as_hal_print_message("<1> cy_as_device:_firmware version: %s "
"major=%d minor=%d build=%d,\n_media types supported:%s\n",
((ver_data.is_debug_mode) ? "debug" : "release"),
ver_data.major, ver_data.minor, ver_data.build, str) ;
ver_data.major, ver_data.minor, ver_data.build, str);
/* done now */
cy_as_device_controller = cy_as_dev ;
cy_as_device_controller = cy_as_dev;
return 0 ;
return 0;
done:
if (cy_as_dev)
cyasdevice_deinit(cy_as_dev) ;
cyasdevice_deinit(cy_as_dev);
return -EINVAL ;
return -EINVAL;
}
cy_as_device_handle cyasdevice_getdevhandle(void)
@ -350,21 +350,21 @@ cy_as_device_handle cyasdevice_getdevhandle(void)
cy_as_hal_config_c_s_mux();
#endif
return cy_as_device_controller->dev_handle ;
return cy_as_device_controller->dev_handle;
}
return NULL;
}
EXPORT_SYMBOL(cyasdevice_getdevhandle) ;
EXPORT_SYMBOL(cyasdevice_getdevhandle);
cy_as_hal_device_tag cyasdevice_gethaltag(void)
{
if (cy_as_device_controller)
return (cy_as_hal_device_tag)
cy_as_device_controller->hal_tag ;
cy_as_device_controller->hal_tag;
return NULL;
}
EXPORT_SYMBOL(cyasdevice_gethaltag) ;
EXPORT_SYMBOL(cyasdevice_gethaltag);
/*init Westbridge device driver **/
@ -373,14 +373,14 @@ static int __init cyasdevice_init(void)
if (cyasdevice_initialize() != 0)
return ENODEV;
return 0 ;
return 0;
}
static void __exit cyasdevice_cleanup(void)
{
cyasdevice_deinit(cy_as_device_controller) ;
cyasdevice_deinit(cy_as_device_controller);
}

View File

@ -84,7 +84,7 @@
extern int mpage_cleardirty(struct address_space *mapping, int num_pages);
extern int fat_get_block(struct inode *, sector_t , struct buffer_head *, int);
extern cy_as_device_handle *cyasdevice_getdevhandle(void) ;
extern cy_as_device_handle *cyasdevice_getdevhandle(void);
/* Driver data structures and utilities */
typedef struct cyasgadget_ep {
@ -102,7 +102,7 @@ typedef struct cyasgadget_ep {
is_in:1,
is_iso:1;
cy_as_usb_end_point_config cyepconfig;
} cyasgadget_ep ;
} cyasgadget_ep;
typedef struct cyasgadget_req {
struct usb_request req;
@ -112,7 +112,7 @@ typedef struct cyasgadget_req {
valid:1,
complete:1,
ep_stopped:1;
} cyasgadget_req ;
} cyasgadget_req;
typedef struct cyasgadget {
/* each device provides one gadget, several endpoints */
@ -139,16 +139,16 @@ typedef struct cyasgadget {
/* Data member used to store the GetObjectComplete event data */
cy_as_mtp_get_object_complete_data tmtp_get_complete_data;
} cyasgadget ;
} cyasgadget;
static inline void set_halt(cyasgadget_ep *ep)
{
return ;
return;
}
static inline void clear_halt(cyasgadget_ep *ep)
{
return ;
return;
}
#define xprintk(dev, level, fmt, args...) \
@ -182,12 +182,12 @@ static inline void clear_halt(cyasgadget_ep *ep)
static inline void start_out_naking(struct cyasgadget_ep *ep)
{
return ;
return;
}
static inline void stop_out_naking(struct cyasgadget_ep *ep)
{
return ;
return;
}
#endif /* _INCLUDED_CYANGADGET_H_ */

View File

@ -29,14 +29,14 @@
typedef struct cy_as_gadget_ioctl_send_object {
uint32_t status;
uint32_t byte_count ;
uint32_t transaction_id ;
} cy_as_gadget_ioctl_send_object ;
uint32_t byte_count;
uint32_t transaction_id;
} cy_as_gadget_ioctl_send_object;
typedef struct cy_as_gadget_ioctl_get_object {
uint32_t status;
uint32_t byte_count ;
} cy_as_gadget_ioctl_get_object ;
uint32_t byte_count;
} cy_as_gadget_ioctl_get_object;
typedef struct cy_as_gadget_ioctl_tmtp_status {
@ -46,7 +46,7 @@ typedef struct cy_as_gadget_ioctl_tmtp_status {
cy_as_gadget_ioctl_send_object tmtp_send_complete_data;
cy_as_gadget_ioctl_get_object tmtp_get_complete_data;
uint32_t t_usec;
} cy_as_gadget_ioctl_tmtp_status ;
} cy_as_gadget_ioctl_tmtp_status;
/*Init send object data*/
typedef struct cy_as_gadget_ioctl_i_s_o_j_d {
@ -57,7 +57,7 @@ typedef struct cy_as_gadget_ioctl_i_s_o_j_d {
uint32_t num_bytes;
/* in case if more prcise timestamping is done in kernel mode */
uint32_t t_usec;
uint32_t ret_val ;
uint32_t ret_val;
char *file_name;
uint32_t name_length;
@ -70,12 +70,12 @@ typedef struct cy_as_gadget_ioctl_i_g_o_j_d {
uint16_t *blk_count_p;
uint32_t item_count;
uint32_t num_bytes;
uint32_t tid ;
uint32_t ret_val ;
uint32_t tid;
uint32_t ret_val;
char *file_name;
uint32_t name_length;
} cy_as_gadget_ioctl_i_g_o_j_d ;
} cy_as_gadget_ioctl_i_g_o_j_d;
typedef struct cy_as_gadget_ioctl_cancel {
uint32_t ret_val;

View File

@ -130,7 +130,7 @@ EXTERN cy_an_return_status_t
cy_an_misc_create_device(
cy_an_device_handle *handle_p,
cy_an_hal_device_tag tag
) ;
);
#define cy_an_misc_create_device(h, tag) \
cy_as_misc_create_device((cy_as_device_handle *)(h), \
(cy_as_hal_device_tag)(tag))
@ -138,7 +138,7 @@ cy_an_misc_create_device(
EXTERN cy_an_return_status_t
cy_an_misc_destroy_device(
cy_an_device_handle handle
) ;
);
#define cy_an_misc_destroy_device(h) \
cy_as_misc_destroy_device((cy_as_device_handle)(h))
@ -146,7 +146,7 @@ EXTERN cy_an_return_status_t
cy_an_misc_configure_device(
cy_an_device_handle handle,
cy_an_device_config *config_p
) ;
);
#define cy_an_misc_configure_device(h, cfg) \
cy_as_misc_configure_device((cy_as_device_handle)(h), \
(cy_as_device_config *)(cfg))
@ -155,7 +155,7 @@ EXTERN cy_an_return_status_t
cy_an_misc_in_standby(
cy_an_device_handle handle,
cy_bool *standby
) ;
);
#define cy_an_misc_in_standby(h, standby) \
cy_as_misc_in_standby((cy_as_device_handle)(h), (standby))
@ -165,7 +165,7 @@ cy_an_misc_download_firmware(
cy_an_device_handle handle,
const void *fw_p,
uint16_t size
) ;
);
#define cy_an_misc_download_firmware(handle, fw_p, size) \
cy_as_misc_download_firmware((cy_as_device_handle)\
@ -179,7 +179,7 @@ cy_an_misc_download_firmware_e_x(
uint16_t size,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_download_firmware_e_x(h, fw_p, size, cb, client) \
cy_as_misc_download_firmware((cy_as_device_handle)(h), \
@ -207,7 +207,7 @@ cy_an_misc_get_firmware_version_e_x(
cy_an_get_firmware_version_data *data,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_get_firmware_version_e_x\
(h, data, cb, client) \
cy_as_misc_get_firmware_version((cy_as_device_handle)(h), \
@ -219,7 +219,7 @@ cy_an_misc_read_m_c_u_register(
cy_an_device_handle handle,
uint16_t address,
uint8_t *value
) ;
);
#define cy_an_misc_read_m_c_u_register(handle, address, value) \
cy_as_misc_read_m_c_u_register((cy_as_device_handle)(handle), \
@ -233,7 +233,7 @@ cy_an_misc_read_m_c_u_register_e_x(
uint8_t *value,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_read_m_c_u_register_e_x\
(h, addr, val, cb, client) \
@ -247,7 +247,7 @@ cy_an_misc_write_m_c_u_register(
uint16_t address,
uint8_t mask,
uint8_t value
) ;
);
#define cy_an_misc_write_m_c_u_register\
(handle, address, mask, value) \
cy_as_misc_write_m_c_u_register((cy_as_device_handle)(handle), \
@ -262,7 +262,7 @@ cy_an_misc_write_m_c_u_register_e_x(
uint8_t value,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_write_m_c_u_register_e_x\
(h, addr, mask, val, cb, client) \
cy_as_misc_write_m_c_u_register((cy_as_device_handle)(h), \
@ -274,7 +274,7 @@ cy_an_misc_reset(
cy_an_device_handle handle,
cy_an_reset_type type,
cy_bool flush
) ;
);
#define cy_an_misc_reset(handle, type, flush) \
cy_as_misc_reset((cy_as_device_handle)(handle), \
(type), (flush), 0, 0)
@ -287,7 +287,7 @@ cy_an_misc_reset_e_x(
cy_bool flush,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_reset_e_x(h, type, flush, cb, client) \
cy_as_misc_reset((cy_as_device_handle)(h), \
(cy_as_reset_type)(type), (flush), \
@ -299,7 +299,7 @@ cy_an_misc_acquire_resource(
cy_an_device_handle handle,
cy_an_resource_type type,
cy_bool force
) ;
);
#define cy_an_misc_acquire_resource(h, type, force) \
cy_as_misc_acquire_resource_dep((cy_as_device_handle)(h), \
(cy_as_resource_type)(type), (force))
@ -312,7 +312,7 @@ cy_an_misc_acquire_resource_e_x(
cy_bool force,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_acquire_resource_e_x\
(h, type_p, force, cb, client) \
cy_as_misc_acquire_resource((cy_as_device_handle)(h), \
@ -324,7 +324,7 @@ EXTERN cy_an_return_status_t
cy_an_misc_release_resource(
cy_an_device_handle handle,
cy_an_resource_type type
) ;
);
#define cy_an_misc_release_resource(h, type)\
cy_as_misc_release_resource((cy_as_device_handle)(h), \
(cy_as_resource_type)(type))
@ -337,7 +337,7 @@ cy_an_misc_set_trace_level(
cy_an_media_type media,
uint32_t device,
uint32_t unit
) ;
);
#define cy_an_misc_set_trace_level\
(handle, level, media, device, unit) \
@ -354,7 +354,7 @@ cy_an_misc_set_trace_level_e_x(
uint32_t unit,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_set_trace_level_e_x\
(h, level, media, device, unit, cb, client) \
cy_as_misc_set_trace_level_dep((cy_as_device_handle)(h), \
@ -366,7 +366,7 @@ EXTERN cy_an_return_status_t
cy_an_misc_enter_standby(
cy_an_device_handle handle,
cy_bool pin
) ;
);
#define cy_an_misc_enter_standby(handle, pin) \
cy_as_misc_enter_standby(\
(cy_as_device_handle)(handle), (pin), 0, 0)
@ -378,7 +378,7 @@ cy_an_misc_enter_standby_e_x(
cy_bool pin,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_enter_standby_e_x(h, pin, cb, client) \
cy_as_misc_enter_standby((cy_as_device_handle)(h), \
(pin), (cy_as_function_callback)(cb), (client))
@ -388,7 +388,7 @@ EXTERN cy_an_return_status_t
cy_an_misc_leave_standby(
cy_an_device_handle handle,
cy_an_resource_type type
) ;
);
#define cy_an_misc_leave_standby(h, type) \
cy_as_misc_leave_standby((cy_as_device_handle)(h), \
(cy_as_resource_type)(type))
@ -398,7 +398,7 @@ EXTERN cy_an_return_status_t
cy_an_misc_register_callback(
cy_an_device_handle handle,
cy_an_misc_event_callback callback
) ;
);
#define cy_an_misc_register_callback(h, cb) \
cy_as_misc_register_callback((cy_as_device_handle)(h), \
(cy_as_misc_event_callback)(cb))
@ -407,7 +407,7 @@ cy_an_misc_register_callback(
EXTERN void
cy_an_misc_set_log_level(
uint8_t level
) ;
);
#define cy_an_misc_set_log_level(level) \
cy_as_misc_set_log_level(level)
@ -415,7 +415,7 @@ cy_an_misc_set_log_level(
EXTERN cy_an_return_status_t
cy_an_misc_storage_changed(
cy_an_device_handle handle
) ;
);
#define cy_an_misc_storage_changed(handle) \
cy_as_misc_storage_changed((cy_as_device_handle)(handle), 0, 0)
@ -425,7 +425,7 @@ cy_an_misc_storage_changed_e_x(
cy_an_device_handle handle,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_storage_changed_e_x(h, cb, client) \
cy_as_misc_storage_changed((cy_as_device_handle)(h), \
(cy_as_function_callback)(cb), (client))
@ -435,7 +435,7 @@ EXTERN cy_an_return_status_t
cy_an_misc_heart_beat_control(
cy_an_device_handle handle,
cy_bool enable
) ;
);
#define cy_an_misc_heart_beat_control(handle, enable) \
cy_as_misc_heart_beat_control((cy_as_device_handle)\
(handle), (enable), 0, 0)
@ -447,7 +447,7 @@ cy_an_misc_heart_beat_control_e_x(
cy_bool enable,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_heart_beat_control_e_x(h, enable, cb, client) \
cy_as_misc_heart_beat_control((cy_as_device_handle)(h), \
(enable), (cy_as_function_callback)(cb), (client))
@ -458,7 +458,7 @@ cy_an_misc_get_gpio_value(
cy_an_device_handle handle,
cy_an_misc_gpio pin,
uint8_t *value
) ;
);
#define cy_an_misc_get_gpio_value(handle, pin, value) \
cy_as_misc_get_gpio_value((cy_as_device_handle)(handle), \
(cy_as_misc_gpio)(pin), (value), 0, 0)
@ -471,7 +471,7 @@ cy_an_misc_get_gpio_value_e_x(
uint8_t *value,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_get_gpio_value_e_x(h, pin, value, cb, client) \
cy_as_misc_get_gpio_value((cy_as_device_handle)(h), \
(cy_as_misc_gpio)(pin), (value), \
@ -483,7 +483,7 @@ cy_an_misc_set_gpio_value(
cy_an_device_handle handle,
cy_an_misc_gpio pin,
uint8_t value
) ;
);
#define cy_an_misc_set_gpio_value(handle, pin, value) \
cy_as_misc_set_gpio_value((cy_as_device_handle)(handle), \
(cy_as_misc_gpio)(pin), (value), 0, 0)
@ -496,7 +496,7 @@ cy_an_misc_set_gpio_value_e_x(
uint8_t value,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_set_gpio_value_e_x\
(h, pin, value, cb, client) \
cy_as_misc_set_gpio_value((cy_as_device_handle)(h), \
@ -509,7 +509,7 @@ cy_an_misc_enter_suspend(
cy_an_device_handle handle,
cy_bool usb_wakeup_en,
cy_bool gpio_wakeup_en
) ;
);
#define cy_an_misc_enter_suspend(handle, usb_wakeup_en, \
gpio_wakeup_en) \
cy_as_misc_enter_suspend((cy_as_device_handle)(handle), \
@ -523,7 +523,7 @@ cy_an_misc_enter_suspend_e_x(
cy_bool gpio_wakeup_en,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_enter_suspend_e_x(h, usb_en, gpio_en, cb, client)\
cy_as_misc_enter_suspend((cy_as_device_handle)(h), (usb_en), \
(gpio_en), (cy_as_function_callback)(cb), (client))
@ -532,7 +532,7 @@ cy_an_misc_enter_suspend_e_x(
EXTERN cy_an_return_status_t
cy_an_misc_leave_suspend(
cy_an_device_handle handle
) ;
);
#define cy_an_misc_leave_suspend(handle) \
cy_as_misc_leave_suspend((cy_as_device_handle)(handle), 0, 0)
@ -542,7 +542,7 @@ cy_an_misc_leave_suspend_e_x(
cy_an_device_handle handle,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_leave_suspend_e_x(h, cb, client) \
cy_as_misc_leave_suspend((cy_as_device_handle)(h), \
@ -553,7 +553,7 @@ EXTERN cy_an_return_status_t
cy_an_misc_set_low_speed_sd_freq(
cy_an_device_handle handle,
cy_an_low_speed_sd_freq setting
) ;
);
#define cy_an_misc_set_low_speed_sd_freq(h, setting) \
cy_as_misc_set_low_speed_sd_freq((cy_as_device_handle)(h), \
(cy_as_low_speed_sd_freq)(setting), 0, 0)
@ -565,7 +565,7 @@ cy_an_misc_set_low_speed_sd_freq_e_x(
cy_an_low_speed_sd_freq setting,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_set_low_speed_sd_freq_e_x\
(h, setting, cb, client) \
cy_as_misc_set_low_speed_sd_freq((cy_as_device_handle)(h), \
@ -579,7 +579,7 @@ cy_an_misc_set_high_speed_sd_freq(
cy_an_high_speed_sd_freq setting,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_misc_set_high_speed_sd_freq(h, setting, cb, client) \
cy_as_misc_set_high_speed_sd_freq((cy_as_device_handle)(h), \
(cy_as_high_speed_sd_freq)(setting), \

View File

@ -60,10 +60,10 @@ typedef cy_as_sd_card_reg_type \
cy_an_sd_card_reg_type;
typedef cy_as_storage_query_device_data_dep \
cy_an_storage_query_device_data ;
cy_an_storage_query_device_data;
typedef cy_as_storage_query_unit_data_dep \
cy_an_storage_query_unit_data ;
cy_an_storage_query_unit_data;
typedef cy_as_storage_sd_reg_read_data \
cy_an_storage_sd_reg_read_data;
@ -80,7 +80,7 @@ typedef cy_as_storage_sd_reg_read_data \
EXTERN cy_an_return_status_t
cy_an_storage_start(
cy_an_device_handle handle
) ;
);
#define cy_an_storage_start(handle) \
cy_as_storage_start((cy_as_device_handle)(handle), 0, 0)
@ -90,7 +90,7 @@ cy_an_storage_start_e_x(
cy_an_device_handle handle,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_storage_start_e_x(h, cb, client) \
cy_as_storage_start((cy_as_device_handle)(h), \
(cy_as_function_callback)(cb), (client))
@ -99,7 +99,7 @@ cy_an_storage_start_e_x(
EXTERN cy_an_return_status_t
cy_an_storage_stop(
cy_an_device_handle handle
) ;
);
#define cy_an_storage_stop(handle) \
cy_as_storage_stop((cy_as_device_handle)(handle), 0, 0)
@ -109,7 +109,7 @@ cy_an_storage_stop_e_x(
cy_an_device_handle handle,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_storage_stop_e_x(h, cb, client) \
cy_as_storage_stop((cy_as_device_handle)(h), \
(cy_as_function_callback)(cb), (client))
@ -119,7 +119,7 @@ EXTERN cy_an_return_status_t
cy_an_storage_register_callback(
cy_an_device_handle handle,
cy_an_storage_event_callback callback
) ;
);
#define cy_an_storage_register_callback(h, cb) \
cy_as_storage_register_callback_dep((cy_as_device_handle)(h), \
(cy_as_storage_event_callback_dep)(cb))
@ -129,7 +129,7 @@ EXTERN cy_an_return_status_t
cy_an_storage_claim(
cy_an_device_handle handle,
cy_an_media_type type
) ;
);
#define cy_an_storage_claim(h, type) \
cy_as_storage_claim_dep((cy_as_device_handle)(h), \
(cy_as_media_type)(type))
@ -141,7 +141,7 @@ cy_an_storage_claim_e_x(
cy_an_media_type *type,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_storage_claim_e_x(h, type_p, cb, client) \
cy_as_storage_claim_dep_EX((cy_as_device_handle)(h), \
(cy_as_media_type *)(type_p), \
@ -152,7 +152,7 @@ EXTERN cy_an_return_status_t
cy_an_storage_release(
cy_an_device_handle handle,
cy_an_media_type type
) ;
);
#define cy_an_storage_release(h, type) \
cy_as_storage_release_dep((cy_as_device_handle)(h), \
(cy_as_media_type)(type))
@ -164,7 +164,7 @@ cy_an_storage_release_e_x(
cy_an_media_type *type,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_storage_release_e_x(h, type_p, cb, client) \
cy_as_storage_release_dep_EX((cy_as_device_handle)(h), \
(cy_as_media_type *)(type_p), \
@ -176,7 +176,7 @@ cy_an_storage_query_media(
cy_an_device_handle handle,
cy_an_media_type type,
uint32_t *count
) ;
);
#define cy_an_storage_query_media(handle, type, count) \
cy_as_storage_query_media((cy_as_device_handle)(handle), \
(cy_as_media_type)(type), (count), 0, 0)
@ -189,7 +189,7 @@ cy_an_storage_query_media_e_x(
uint32_t *count,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_storage_query_media_e_x(h, type, count, cb, client) \
cy_as_storage_query_media((cy_as_device_handle)(h), \
(cy_as_media_type)(type), (count), \
@ -202,7 +202,7 @@ cy_an_storage_query_device(
cy_an_media_type type,
uint32_t device,
cy_an_device_desc *desc_p
) ;
);
#define cy_an_storage_query_device(h, type, device, desc_p) \
cy_as_storage_query_device_dep((cy_as_device_handle)(h), \
(cy_as_media_type)(type), (device), (cy_as_device_desc *)(desc_p))
@ -214,7 +214,7 @@ cy_an_storage_query_device_e_x(
cy_an_storage_query_device_data *data,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_storage_query_device_e_x(h, data, cb, client) \
cy_as_storage_query_device_dep_EX((cy_as_device_handle)(h), \
(cy_as_storage_query_device_data_dep *)(data), \
@ -228,7 +228,7 @@ cy_an_storage_query_unit(
uint32_t device,
uint32_t unit,
cy_an_unit_desc *desc_p
) ;
);
#define cy_an_storage_query_unit(h, type, device, unit, desc_p) \
cy_as_storage_query_unit_dep((cy_as_device_handle)(h), \
(cy_as_media_type)(type), (device), \
@ -241,7 +241,7 @@ cy_an_storage_query_unit_e_x(
cy_an_storage_query_unit_data *data_p,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_storage_query_unit_e_x(h, data_p, cb, client) \
cy_as_storage_query_unit_dep_EX((cy_as_device_handle)(h), \
(cy_as_storage_query_unit_data_dep *)(data_p), \
@ -253,7 +253,7 @@ cy_an_storage_device_control(
cy_an_device_handle handle,
cy_bool card_detect_en,
cy_bool write_prot_en
) ;
);
#define cy_an_storage_device_control(handle, \
card_detect_en, write_prot_en) \
cy_as_storage_device_control_dep((cy_as_device_handle)(handle), \
@ -267,7 +267,7 @@ cy_an_storage_device_control_e_x(
cy_bool write_prot_en,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_storage_device_control_e_x(h, det_en, prot_en, cb, client) \
cy_as_storage_device_control_dep((cy_as_device_handle)(h), (det_en), \
(prot_en), (cy_as_function_callback)(cb), (client))
@ -282,7 +282,7 @@ cy_an_storage_read(
uint32_t block,
void *data_p,
uint16_t num_blocks
) ;
);
#define cy_an_storage_read(h, type, device, unit, block, data_p, nblks) \
cy_as_storage_read_dep((cy_as_device_handle)(h), \
(cy_as_media_type)(type), (device), (unit), \
@ -299,7 +299,7 @@ cy_an_storage_read_async(
void *data_p,
uint16_t num_blocks,
cy_an_storage_callback callback
) ;
);
#define cy_an_storage_read_async(h, type, device, unit, \
block, data_p, nblks, cb) \
cy_as_storage_read_async_dep((cy_as_device_handle)(h), \
@ -316,7 +316,7 @@ cy_an_storage_write(
uint32_t block,
void *data_p,
uint16_t num_blocks
) ;
);
#define cy_an_storage_write(h, type, device, unit, \
block, data_p, nblks) \
cy_as_storage_write_dep((cy_as_device_handle)(h), \
@ -334,7 +334,7 @@ cy_an_storage_write_async(
void *data_p,
uint16_t num_blocks,
cy_an_storage_callback callback
) ;
);
#define cy_an_storage_write_async(h, type, device, unit, \
block, data_p, nblks, cb) \
cy_as_storage_write_async_dep((cy_as_device_handle)(h), \
@ -345,7 +345,7 @@ cy_an_storage_write_async(
EXTERN cy_an_return_status_t
cy_an_storage_cancel_async(
cy_an_device_handle handle
) ;
);
#define cy_an_storage_cancel_async(h) \
cy_as_storage_cancel_async((cy_as_device_handle)(h))
@ -358,7 +358,7 @@ cy_an_storage_sd_register_read(
cy_an_sd_card_reg_type reg_type,
uint8_t read_len,
uint8_t *data_p
) ;
);
#define cy_an_storage_sd_register_read(h, type, device, \
reg_type, len, data_p) \
cy_as_storage_sd_register_read_dep((cy_as_device_handle)(h), \
@ -375,7 +375,7 @@ cy_an_storage_sd_register_read_e_x(
cy_an_storage_sd_reg_read_data *data_p,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_storage_sd_register_read_e_x(h, type, device, \
reg_type, data_p, cb, client) \
cy_as_storage_sd_register_read_dep_EX((cy_as_device_handle)(h), \
@ -392,7 +392,7 @@ cy_an_storage_create_p_partition(
uint32_t device,
uint32_t size,
cy_an_function_callback cb,
uint32_t client) ;
uint32_t client);
#define cy_an_storage_create_p_partition(h, media, dev, \
size, cb, client) \
cy_as_storage_create_p_partition_dep((cy_as_device_handle)(h), \
@ -406,7 +406,7 @@ cy_an_storage_remove_p_partition(
cy_an_media_type media,
uint32_t device,
cy_an_function_callback cb,
uint32_t client) ;
uint32_t client);
#define cy_an_storage_remove_p_partition\
(h, media, dev, cb, client) \
cy_as_storage_remove_p_partition_dep((cy_as_device_handle)(h), \

View File

@ -25,7 +25,7 @@
#define _INCLUDED_CYANTYPES_H_
#include "cyastypes.h"
typedef cy_as_end_point_number_t cy_an_end_point_number_t ;
typedef cy_as_return_status_t cy_an_return_status_t ;
typedef cy_as_bus_number_t cy_an_bus_number_t ;
typedef cy_as_end_point_number_t cy_an_end_point_number_t;
typedef cy_as_return_status_t cy_an_return_status_t;
typedef cy_as_bus_number_t cy_an_bus_number_t;
#endif

View File

@ -33,9 +33,9 @@
typedef cy_as_usb_inquiry_data_dep cy_an_usb_inquiry_data;
typedef cy_as_usb_unknown_command_data_dep \
cy_an_usb_unknown_command_data ;
typedef cy_as_usb_start_stop_data_dep cy_an_usb_start_stop_data ;
typedef cy_as_m_s_c_progress_data cy_an_m_s_c_progress_data ;
cy_an_usb_unknown_command_data;
typedef cy_as_usb_start_stop_data_dep cy_an_usb_start_stop_data;
typedef cy_as_m_s_c_progress_data cy_an_m_s_c_progress_data;
#define cy_an_usb_nand_enum cy_as_usb_nand_enum
#define cy_an_usb_sd_enum cy_as_usb_sd_enum
@ -50,28 +50,28 @@ typedef cy_as_usb_mass_storage_enum cy_an_usb_mass_storage_enum;
#define cy_an_usb_desc_h_s_configuration \
cy_as_usb_desc_h_s_configuration
#define cy_an_usb_desc_string cy_as_usb_desc_string
typedef cy_as_usb_desc_type cy_an_usb_desc_type ;
typedef cy_as_usb_desc_type cy_an_usb_desc_type;
#define cy_an_usb_in cy_as_usb_in
#define cy_an_usb_out cy_as_usb_out
#define cy_an_usb_in_out cy_as_usb_in_out
typedef cy_as_usb_end_point_dir cy_an_usb_end_point_dir ;
typedef cy_as_usb_end_point_dir cy_an_usb_end_point_dir;
#define cy_an_usb_control cy_as_usb_control
#define cy_an_usb_iso cy_as_usb_iso
#define cy_an_usb_bulk cy_as_usb_bulk
#define cy_an_usb_int cy_as_usb_int
typedef cy_as_usb_end_point_type cy_an_usb_end_point_type ;
typedef cy_as_usb_end_point_type cy_an_usb_end_point_type;
typedef cy_as_usb_enum_control_dep cy_an_usb_enum_control ;
typedef cy_as_usb_end_point_config cy_an_usb_end_point_config ;
typedef cy_as_usb_enum_control_dep cy_an_usb_enum_control;
typedef cy_as_usb_end_point_config cy_an_usb_end_point_config;
#define cy_an_usb_m_s_unit0 cy_as_usb_m_s_unit0
#define cy_an_usb_m_s_unit1 cy_as_usb_m_s_unit1
#define cy_an_usb_m_s_both cy_as_usb_m_s_both
typedef cy_as_usb_m_s_type_t cy_an_usb_m_s_type_t ;
typedef cy_as_usb_m_s_type_t cy_an_usb_m_s_type_t;
#define cy_an_event_usb_suspend cy_as_event_usb_suspend
#define cy_an_event_usb_resume cy_as_event_usb_resume
@ -87,7 +87,7 @@ typedef cy_as_usb_m_s_type_t cy_an_usb_m_s_type_t ;
#define cy_an_event_usb_m_s_c_progress cy_as_event_usb_m_s_c_progress
typedef cy_as_usb_event cy_an_usb_event;
typedef cy_as_usb_event_callback_dep cy_an_usb_event_callback ;
typedef cy_as_usb_event_callback_dep cy_an_usb_event_callback;
typedef cy_as_usb_io_callback cy_an_usb_io_callback;
typedef cy_as_usb_function_callback cy_an_usb_function_callback;
@ -98,7 +98,7 @@ typedef cy_as_usb_function_callback cy_an_usb_function_callback;
extern cy_an_return_status_t
cy_an_usb_start(
cy_an_device_handle handle
) ;
);
#define cy_an_usb_start(handle) \
cy_as_usb_start((cy_as_device_handle)(handle), 0, 0)
@ -108,7 +108,7 @@ cy_an_usb_start_e_x(
cy_an_device_handle handle,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_start_e_x(h, cb, client) \
cy_as_usb_start((cy_as_device_handle)(h), \
(cy_as_function_callback)(cb), (client))
@ -117,7 +117,7 @@ cy_an_usb_start_e_x(
extern cy_an_return_status_t
cy_an_usb_stop(
cy_an_device_handle handle
) ;
);
#define cy_an_usb_stop(handle) \
cy_as_usb_stop((cy_as_device_handle)(handle), 0, 0)
@ -127,7 +127,7 @@ cy_an_usb_stop_e_x(
cy_an_device_handle handle,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_stop_e_x(h, cb, client) \
cy_as_usb_stop((cy_as_device_handle)(h), \
(cy_as_function_callback)(cb), (client))
@ -137,7 +137,7 @@ EXTERN cy_an_return_status_t
cy_an_usb_register_callback(
cy_an_device_handle handle,
cy_an_usb_event_callback callback
) ;
);
#define cy_an_usb_register_callback(h, cb) \
cy_as_usb_register_callback_dep((cy_as_device_handle)(h), \
(cy_as_usb_event_callback_dep)(cb))
@ -146,7 +146,7 @@ cy_an_usb_register_callback(
EXTERN cy_an_return_status_t
cy_an_usb_connect(
cy_an_device_handle handle
) ;
);
#define cy_an_usb_connect(handle) \
cy_as_usb_connect((cy_as_device_handle)(handle), 0, 0)
@ -156,7 +156,7 @@ cy_an_usb_connect_e_x(
cy_an_device_handle handle,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_connect_e_x(h, cb, client) \
cy_as_usb_connect((cy_as_device_handle)(h), \
(cy_as_function_callback)(cb), (client))
@ -165,7 +165,7 @@ cy_an_usb_connect_e_x(
EXTERN cy_an_return_status_t
cy_an_usb_disconnect(
cy_an_device_handle handle
) ;
);
#define cy_an_usb_disconnect(handle) \
cy_as_usb_disconnect((cy_as_device_handle)(handle), 0, 0)
@ -175,7 +175,7 @@ cy_an_usb_disconnect_e_x(
cy_an_device_handle handle,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_disconnect_e_x(h, cb, client) \
cy_as_usb_disconnect((cy_as_device_handle)(h), \
(cy_as_function_callback)(cb), (client))
@ -185,7 +185,7 @@ EXTERN cy_an_return_status_t
cy_an_usb_set_enum_config(
cy_an_device_handle handle,
cy_an_usb_enum_control *config_p
) ;
);
#define cy_an_usb_set_enum_config(handle, config_p) \
cy_as_usb_set_enum_config_dep((cy_as_device_handle)(handle), \
(cy_as_usb_enum_control_dep *)(config_p), 0, 0)
@ -197,7 +197,7 @@ cy_an_usb_set_enum_config_e_x(
cy_an_usb_enum_control *config_p,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_set_enum_config_e_x(h, config_p, cb, client) \
cy_as_usb_set_enum_config_dep((cy_as_device_handle)(h), \
(cy_as_usb_enum_control_dep *)(config_p), \
@ -208,7 +208,7 @@ EXTERN cy_an_return_status_t
cy_an_usb_get_enum_config(
cy_an_device_handle handle,
cy_an_usb_enum_control *config_p
) ;
);
#define cy_an_usb_get_enum_config(handle, config_p) \
cy_as_usb_get_enum_config_dep((cy_as_device_handle)(handle), \
(cy_as_usb_enum_control_dep *)(config_p), 0, 0)
@ -220,7 +220,7 @@ cy_an_usb_get_enum_config_e_x(
cy_an_usb_enum_control *config_p,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_get_enum_config_e_x(h, config_p, cb, client) \
cy_as_usb_get_enum_config_dep((cy_as_device_handle)(h), \
(cy_as_usb_enum_control_dep *)(config_p), \
@ -234,7 +234,7 @@ cy_an_usb_set_descriptor(
uint8_t index,
void *desc_p,
uint16_t length
) ;
);
#define cy_an_usb_set_descriptor(handle, type, index, desc_p, length) \
cy_as_usb_set_descriptor((cy_as_device_handle)(handle), \
(cy_as_usb_desc_type)(type), (index), (desc_p), (length), 0, 0)
@ -249,7 +249,7 @@ cy_an_usb_set_descriptor_e_x(
uint16_t length,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_set_descriptor_e_x\
(h, type, index, desc_p, length, cb, client) \
cy_as_usb_set_descriptor((cy_as_device_handle)(h), \
@ -262,7 +262,7 @@ cy_an_usb_clear_descriptors(
cy_an_device_handle handle,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_clear_descriptors(h, cb, client) \
cy_as_usb_clear_descriptors((cy_as_device_handle)(h), \
(cy_as_function_callback)(cb), (client))
@ -275,12 +275,12 @@ cy_an_usb_get_descriptor(
uint8_t index,
void *desc_p,
uint32_t *length_p
) ;
);
#define cy_an_usb_get_descriptor(h, type, index, desc_p, length_p) \
cy_as_usb_get_descriptor_dep((cy_as_device_handle)(h), \
(cy_as_usb_desc_type)(type), (index), (desc_p), (length_p))
typedef cy_as_get_descriptor_data cy_an_get_descriptor_data ;
typedef cy_as_get_descriptor_data cy_an_get_descriptor_data;
/* Async version of get descriptor */
extern cy_an_return_status_t
@ -291,7 +291,7 @@ cy_an_usb_get_descriptor_e_x(
cy_an_get_descriptor_data *data,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_get_descriptor_e_x\
(h, type, index, data, cb, client) \
cy_as_usb_get_descriptor((cy_as_device_handle)(h), \
@ -303,7 +303,7 @@ EXTERN cy_an_return_status_t
cy_an_usb_set_physical_configuration(
cy_an_device_handle handle,
uint8_t config
) ;
);
#define cy_an_usb_set_physical_configuration(h, config) \
cy_as_usb_set_physical_configuration\
((cy_as_device_handle)(h), (config))
@ -313,7 +313,7 @@ cy_an_usb_set_end_point_config(
cy_an_device_handle handle,
cy_an_end_point_number_t ep,
cy_an_usb_end_point_config *config_p
) ;
);
#define cy_an_usb_set_end_point_config(h, ep, config_p) \
cy_as_usb_set_end_point_config((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep), \
@ -324,7 +324,7 @@ cy_an_usb_get_end_point_config(
cy_an_device_handle handle,
cy_an_end_point_number_t ep,
cy_an_usb_end_point_config *config_p
) ;
);
#define cy_an_usb_get_end_point_config(h, ep, config_p) \
cy_as_usb_get_end_point_config((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep), \
@ -334,7 +334,7 @@ cy_an_usb_get_end_point_config(
EXTERN cy_an_return_status_t
cy_an_usb_commit_config(
cy_an_device_handle handle
) ;
);
#define cy_an_usb_commit_config(handle) \
cy_as_usb_commit_config((cy_as_device_handle)(handle), 0, 0)
@ -344,7 +344,7 @@ cy_an_usb_commit_config_e_x(
cy_an_device_handle handle,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_commit_config_e_x(h, cb, client) \
cy_as_usb_commit_config((cy_as_device_handle)(h), \
(cy_as_function_callback)(cb), (client))
@ -357,7 +357,7 @@ cy_an_usb_read_data(
uint32_t dsize,
uint32_t *dataread,
void *data
) ;
);
#define cy_an_usb_read_data(h, ep, pkt, dsize, dataread, data_p) \
cy_as_usb_read_data((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep), (pkt), (dsize), \
@ -371,7 +371,7 @@ cy_an_usb_read_data_async(
uint32_t dsize,
void *data,
cy_an_usb_io_callback callback
) ;
);
#define cy_an_usb_read_data_async(h, ep, pkt, dsize, data_p, cb) \
cy_as_usb_read_data_async((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep), (pkt), (dsize), (data_p), \
@ -383,7 +383,7 @@ cy_an_usb_write_data(
cy_an_end_point_number_t ep,
uint32_t dsize,
void *data
) ;
);
#define cy_an_usb_write_data(h, ep, dsize, data_p) \
cy_as_usb_write_data((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep), (dsize), (data_p))
@ -396,7 +396,7 @@ cy_an_usb_write_data_async(
void *data,
cy_bool spacket,
cy_an_usb_io_callback callback
) ;
);
#define cy_an_usb_write_data_async(h, ep, dsize, data_p, spacket, cb) \
cy_as_usb_write_data_async((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep), (dsize), (data_p), (spacket), \
@ -406,7 +406,7 @@ EXTERN cy_an_return_status_t
cy_an_usb_cancel_async(
cy_an_device_handle handle,
cy_an_end_point_number_t ep
) ;
);
#define cy_an_usb_cancel_async(h, ep) \
cy_as_usb_cancel_async((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep))
@ -418,7 +418,7 @@ cy_an_usb_set_stall(
cy_an_end_point_number_t ep,
cy_an_usb_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_set_stall(h, ep, cb, client) \
cy_as_usb_set_stall_dep((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep), \
@ -431,7 +431,7 @@ cy_an_usb_set_stall_e_x(
cy_an_end_point_number_t ep,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_set_stall_e_x(h, ep, cb, client) \
cy_as_usb_set_stall((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep), \
@ -444,7 +444,7 @@ cy_an_usb_clear_stall(
cy_an_end_point_number_t ep,
cy_an_usb_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_clear_stall(h, ep, cb, client) \
cy_as_usb_clear_stall_dep((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep), \
@ -457,7 +457,7 @@ cy_an_usb_clear_stall_e_x(
cy_an_end_point_number_t ep,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_clear_stall_e_x(h, ep, cb, client) \
cy_as_usb_clear_stall((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep), \
@ -469,7 +469,7 @@ cy_an_usb_get_stall(
cy_an_device_handle handle,
cy_an_end_point_number_t ep,
cy_bool *stall_p
) ;
);
#define cy_an_usb_get_stall(handle, ep, stall_p) \
cy_as_usb_get_stall((cy_as_device_handle)(handle), \
(cy_as_end_point_number_t)(ep), (stall_p), 0, 0)
@ -482,7 +482,7 @@ cy_an_usb_get_stall_e_x(
cy_bool *stall_p,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_get_stall_e_x(h, ep, stall_p, cb, client) \
cy_as_usb_get_stall((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep), (stall_p), \
@ -495,7 +495,7 @@ cy_an_usb_set_nak(
cy_an_end_point_number_t ep,
cy_an_usb_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_set_nak(h, ep, cb, client) \
cy_as_usb_set_nak_dep((cy_as_device_handle)(h), \
@ -509,7 +509,7 @@ cy_an_usb_set_nak_e_x(
cy_an_end_point_number_t ep,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_set_nak_e_x(h, ep, cb, client) \
cy_as_usb_set_nak((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep), \
@ -522,7 +522,7 @@ cy_an_usb_clear_nak(
cy_an_end_point_number_t ep,
cy_an_usb_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_clear_nak(h, ep, cb, client) \
cy_as_usb_clear_nak_dep((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep), \
@ -535,7 +535,7 @@ cy_an_usb_clear_nak_e_x(
cy_an_end_point_number_t ep,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_clear_nak_e_x(h, ep, cb, client) \
cy_as_usb_clear_nak((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep), \
@ -547,7 +547,7 @@ cy_an_usb_get_nak(
cy_an_device_handle handle,
cy_an_end_point_number_t ep,
cy_bool *nak_p
) ;
);
#define cy_an_usb_get_nak(handle, ep, nak_p) \
cy_as_usb_get_nak((cy_as_device_handle)(handle), \
(cy_as_end_point_number_t)(ep), (nak_p), 0, 0)
@ -560,7 +560,7 @@ cy_an_usb_get_nak_e_x(
cy_bool *nak_p,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_get_nak_e_x(h, ep, nak_p, cb, client) \
cy_as_usb_get_nak((cy_as_device_handle)(h), \
(cy_as_end_point_number_t)(ep), (nak_p), \
@ -570,7 +570,7 @@ cy_an_usb_get_nak_e_x(
EXTERN cy_an_return_status_t
cy_an_usb_signal_remote_wakeup(
cy_an_device_handle handle
) ;
);
#define cy_an_usb_signal_remote_wakeup(handle) \
cy_as_usb_signal_remote_wakeup((cy_as_device_handle)(handle), 0, 0)
@ -580,7 +580,7 @@ cy_an_usb_signal_remote_wakeup_e_x(
cy_an_device_handle handle,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_signal_remote_wakeup_e_x(h, cb, client) \
cy_as_usb_signal_remote_wakeup((cy_as_device_handle)(h), \
(cy_as_function_callback)(cb), (client))
@ -593,7 +593,7 @@ cy_an_usb_set_m_s_report_threshold(
uint32_t rd_sectors,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_set_m_s_report_threshold\
(h, wr_cnt, rd_cnt, cb, client) \
cy_as_usb_set_m_s_report_threshold((cy_as_device_handle)(h), \
@ -608,7 +608,7 @@ cy_an_usb_select_m_s_partitions(
cy_an_usb_m_s_type_t type,
cy_an_function_callback cb,
uint32_t client
) ;
);
#define cy_an_usb_select_m_s_partitions(h, media, dev, type, cb, client) \
cy_as_usb_select_m_s_partitions_dep((cy_as_device_handle)(h), \
(cy_as_media_type)(media), (dev), \

View File

@ -147,7 +147,7 @@
* West Bridge Data Structures
****************************************/
typedef struct cy_as_device cy_as_device ;
typedef struct cy_as_device cy_as_device;
/* Summary
This type defines a callback function that will be called
@ -173,7 +173,7 @@ typedef void (*cy_as_dma_callback)(
uint32_t size,
/* The error code for this DMA xfer */
cy_as_return_status_t error
) ;
);
/* Summary
This structure defines a DMA request that is queued
@ -184,20 +184,20 @@ typedef void (*cy_as_dma_callback)(
*/
typedef struct cy_as_dma_queue_entry {
/* Pointer to memory buffer for this request */
void *buf_p ;
void *buf_p;
/* Size of the memory buffer for DMA operation */
uint32_t size ;
uint32_t size;
/* Offset into memory buffer for next DMA operation */
uint32_t offset ;
uint32_t offset;
/* If TRUE and IN request */
cy_bool packet ;
cy_bool packet;
/* If TRUE, this is a read request */
cy_bool readreq ;
cy_bool readreq;
/* Callback function for when DMA is complete */
cy_as_dma_callback cb ;
cy_as_dma_callback cb;
/* Pointer to next entry in queue */
struct cy_as_dma_queue_entry *next_p ;
} cy_as_dma_queue_entry ;
struct cy_as_dma_queue_entry *next_p;
} cy_as_dma_queue_entry;
/* Summary
This structure defines the endpoint data for a given
@ -208,21 +208,21 @@ typedef struct cy_as_dma_queue_entry {
*/
typedef struct cy_as_dma_end_point {
/* The endpoint number */
cy_as_end_point_number_t ep ;
cy_as_end_point_number_t ep;
/* The state of this endpoint */
uint8_t state ;
uint8_t state;
/* The maximum amount of data accepted in a packet by the hw */
uint16_t maxhwdata ;
uint16_t maxhwdata;
/* The maximum amount of data accepted by the HAL layer */
uint32_t maxhaldata ;
uint32_t maxhaldata;
/* The queue for DMA operations */
cy_as_dma_queue_entry *queue_p ;
cy_as_dma_queue_entry *queue_p;
/* The last entry in the DMA queue */
cy_as_dma_queue_entry *last_p ;
cy_as_dma_queue_entry *last_p;
/* This sleep channel is used to wait while the DMA queue
* drains for a given endpoint */
cy_as_hal_sleep_channel channel ;
} cy_as_dma_end_point ;
cy_as_hal_sleep_channel channel;
} cy_as_dma_end_point;
#define cy_as_end_point_number_is_usb(n) \
((n) != 2 && (n) != 4 && (n) != 6 && (n) != 8)
@ -274,16 +274,16 @@ typedef struct cy_as_dma_end_point {
typedef struct cy_as_ll_request_response {
/* The mbox[0] contents - see low level comm section of API doc */
uint16_t box0 ;
uint16_t box0;
/* The amount of data stored in this request/response in bytes */
uint16_t stored ;
uint16_t stored;
/* Length of this request in words */
uint16_t length ;
uint16_t length;
/* Additional status information about the request */
uint16_t flags ;
uint16_t flags;
/* Note: This is over indexed and contains the request/response data */
uint16_t data[1] ;
} cy_as_ll_request_response ;
uint16_t data[1];
} cy_as_ll_request_response;
/*
* The callback function for responses
@ -299,22 +299,22 @@ typedef void (*cy_as_response_callback)(
cy_as_ll_request_response *resp,
/* The status of the request */
cy_as_return_status_t status
) ;
);
typedef struct cy_as_ll_request_list_node {
/* The request to send */
cy_as_ll_request_response *rqt ;
cy_as_ll_request_response *rqt;
/* The associated response for the request */
cy_as_ll_request_response *resp ;
cy_as_ll_request_response *resp;
/* Length of the response */
uint16_t length ;
uint16_t length;
/* The callback to call when done */
cy_as_response_callback callback ;
cy_as_response_callback callback;
/* The state of the request */
uint8_t state ;
uint8_t state;
/* The next request in the list */
struct cy_as_ll_request_list_node *next ;
} cy_as_ll_request_list_node ;
struct cy_as_ll_request_list_node *next;
} cy_as_ll_request_list_node;
#define cy_as_request_get_node_state(node_p) \
((node_p)->state & CY_AS_REQUEST_LIST_STATE_MASK)
@ -336,88 +336,88 @@ typedef enum cy_as_c_b_node_type {
CYAS_USB_IO_CB,
CYAS_STORAGE_IO_CB,
CYAS_FUNC_CB
} cy_as_c_b_node_type ;
} cy_as_c_b_node_type;
typedef struct cy_as_func_c_b_node {
cy_as_c_b_node_type node_type ;
cy_as_function_callback cb_p ;
uint32_t client_data ;
cy_as_funct_c_b_type data_type ;
void *data ;
struct cy_as_func_c_b_node *next_p ;
cy_as_c_b_node_type node_type;
cy_as_function_callback cb_p;
uint32_t client_data;
cy_as_funct_c_b_type data_type;
void *data;
struct cy_as_func_c_b_node *next_p;
} cy_as_func_c_b_node;
extern cy_as_func_c_b_node*
cy_as_create_func_c_b_node_data(cy_as_function_callback
cb, uint32_t client, cy_as_funct_c_b_type type, void *data) ;
cb, uint32_t client, cy_as_funct_c_b_type type, void *data);
extern cy_as_func_c_b_node*
cy_as_create_func_c_b_node(cy_as_function_callback cb,
uint32_t client) ;
uint32_t client);
extern void
cy_as_destroy_func_c_b_node(cy_as_func_c_b_node *node) ;
cy_as_destroy_func_c_b_node(cy_as_func_c_b_node *node);
typedef struct cy_as_mtp_func_c_b_node {
cy_as_c_b_node_type type ;
cy_as_mtp_function_callback cb_p ;
cy_as_c_b_node_type type;
cy_as_mtp_function_callback cb_p;
uint32_t client_data;
struct cy_as_mtp_func_c_b_node *next_p ;
struct cy_as_mtp_func_c_b_node *next_p;
} cy_as_mtp_func_c_b_node;
extern cy_as_mtp_func_c_b_node*
cy_as_create_mtp_func_c_b_node(cy_as_mtp_function_callback cb,
uint32_t client) ;
uint32_t client);
extern void
cy_as_destroy_mtp_func_c_b_node(cy_as_mtp_func_c_b_node *node) ;
cy_as_destroy_mtp_func_c_b_node(cy_as_mtp_func_c_b_node *node);
typedef struct cy_as_usb_func_c_b_node {
cy_as_c_b_node_type type ;
cy_as_usb_function_callback cb_p ;
cy_as_c_b_node_type type;
cy_as_usb_function_callback cb_p;
uint32_t client_data;
struct cy_as_usb_func_c_b_node *next_p ;
struct cy_as_usb_func_c_b_node *next_p;
} cy_as_usb_func_c_b_node;
extern cy_as_usb_func_c_b_node*
cy_as_create_usb_func_c_b_node(cy_as_usb_function_callback cb,
uint32_t client) ;
uint32_t client);
extern void
cy_as_destroy_usb_func_c_b_node(cy_as_usb_func_c_b_node *node) ;
cy_as_destroy_usb_func_c_b_node(cy_as_usb_func_c_b_node *node);
typedef struct cy_as_usb_io_c_b_node {
cy_as_c_b_node_type type ;
cy_as_usb_io_callback cb_p ;
struct cy_as_usb_io_c_b_node *next_p ;
cy_as_c_b_node_type type;
cy_as_usb_io_callback cb_p;
struct cy_as_usb_io_c_b_node *next_p;
} cy_as_usb_io_c_b_node;
extern cy_as_usb_io_c_b_node*
cy_as_create_usb_io_c_b_node(cy_as_usb_io_callback cb) ;
cy_as_create_usb_io_c_b_node(cy_as_usb_io_callback cb);
extern void
cy_as_destroy_usb_io_c_b_node(cy_as_usb_io_c_b_node *node) ;
cy_as_destroy_usb_io_c_b_node(cy_as_usb_io_c_b_node *node);
typedef struct cy_as_storage_io_c_b_node {
cy_as_c_b_node_type type ;
cy_as_storage_callback cb_p ;
cy_as_c_b_node_type type;
cy_as_storage_callback cb_p;
/* The media for the currently outstanding async storage request */
cy_as_media_type media ;
cy_as_media_type media;
/* The device index for the currently outstanding async storage
* request */
uint32_t device_index ;
uint32_t device_index;
/* The unit index for the currently outstanding async storage
* request */
uint32_t unit ;
uint32_t unit;
/* The block address for the currently outstanding async storage
* request */
uint32_t block_addr ;
uint32_t block_addr;
/* The operation for the currently outstanding async storage
* request */
cy_as_oper_type oper ;
cy_as_ll_request_response *req_p ;
cy_as_ll_request_response *reply_p ;
struct cy_as_storage_io_c_b_node *next_p ;
cy_as_oper_type oper;
cy_as_ll_request_response *req_p;
cy_as_ll_request_response *reply_p;
struct cy_as_storage_io_c_b_node *next_p;
} cy_as_storage_io_c_b_node;
extern cy_as_storage_io_c_b_node*
@ -425,39 +425,39 @@ cy_as_create_storage_io_c_b_node(cy_as_storage_callback cb,
cy_as_media_type media, uint32_t device_index,
uint32_t unit, uint32_t block_addr, cy_as_oper_type oper,
cy_as_ll_request_response *req_p,
cy_as_ll_request_response *reply_p) ;
cy_as_ll_request_response *reply_p);
extern void
cy_as_destroy_storage_io_c_b_node(cy_as_storage_io_c_b_node *node) ;
cy_as_destroy_storage_io_c_b_node(cy_as_storage_io_c_b_node *node);
typedef struct cy_as_c_b_queue {
void *head_p;
void *tail_p;
uint32_t count ;
cy_as_c_b_node_type type ;
} cy_as_c_b_queue ;
uint32_t count;
cy_as_c_b_node_type type;
} cy_as_c_b_queue;
extern cy_as_c_b_queue *
cy_as_create_c_b_queue(cy_as_c_b_node_type type) ;
cy_as_create_c_b_queue(cy_as_c_b_node_type type);
extern void
cy_as_destroy_c_b_queue(cy_as_c_b_queue *queue) ;
cy_as_destroy_c_b_queue(cy_as_c_b_queue *queue);
/* Allocates a new CyAsCBNode */
extern void
cy_as_insert_c_b_node(cy_as_c_b_queue *queue_p, void *cbnode) ;
cy_as_insert_c_b_node(cy_as_c_b_queue *queue_p, void *cbnode);
/* Removes the first CyAsCBNode from the queue and frees it */
extern void
cy_as_remove_c_b_node(cy_as_c_b_queue *queue_p) ;
cy_as_remove_c_b_node(cy_as_c_b_queue *queue_p);
/* Remove the last CyAsCBNode from the queue and frees it */
extern void
cy_as_remove_c_b_tail_node(cy_as_c_b_queue *queue_p) ;
cy_as_remove_c_b_tail_node(cy_as_c_b_queue *queue_p);
/* Removes and frees all pending callbacks */
extern void
cy_as_clear_c_b_queue(cy_as_c_b_queue *queue_p) ;
cy_as_clear_c_b_queue(cy_as_c_b_queue *queue_p);
extern cy_as_return_status_t
cy_as_misc_send_request(cy_as_device *dev_p,
@ -469,10 +469,10 @@ cy_as_misc_send_request(cy_as_device *dev_p,
uint16_t req_type,
cy_as_ll_request_response *req_p,
cy_as_ll_request_response *reply_p,
cy_as_response_callback rcb) ;
cy_as_response_callback rcb);
extern void
cy_as_misc_cancel_ex_requests(cy_as_device *dev_p) ;
cy_as_misc_cancel_ex_requests(cy_as_device *dev_p);
/* Summary
Free all memory allocated by and zero all
@ -480,7 +480,7 @@ cy_as_misc_cancel_ex_requests(cy_as_device *dev_p) ;
*/
extern void
cy_as_usb_cleanup(
cy_as_device *dev_p) ;
cy_as_device *dev_p);
/* Summary
Free all memory allocated and zero all structures initialized
@ -488,7 +488,7 @@ cy_as_usb_cleanup(
*/
extern void
cy_as_storage_cleanup(
cy_as_device *dev_p) ;
cy_as_device *dev_p);
#endif
/* Summary
@ -503,28 +503,28 @@ cy_as_storage_cleanup(
*/
typedef struct cy_as_context {
/* The context number for this context */
uint8_t number ;
uint8_t number;
/* This sleep channel is used to sleep while waiting on a
* response from the west bridge device for a request. */
cy_as_hal_sleep_channel channel ;
cy_as_hal_sleep_channel channel;
/* The buffer for received requests */
cy_as_ll_request_response *req_p ;
cy_as_ll_request_response *req_p;
/* The length of the request being received */
uint16_t request_length ;
uint16_t request_length;
/* The callback for the next request received */
cy_as_response_callback request_callback ;
cy_as_response_callback request_callback;
/* A list of low level requests to go to the firmware */
cy_as_ll_request_list_node *request_queue_p ;
cy_as_ll_request_list_node *request_queue_p;
/* The list node in the request queue */
cy_as_ll_request_list_node *last_node_p ;
cy_as_ll_request_list_node *last_node_p;
/* Index upto which data is stored. */
uint16_t queue_index ;
uint16_t queue_index;
/* Index to the next request in the queue. */
uint16_t rqt_index ;
uint16_t rqt_index;
/* Queue of data stored */
uint16_t data_queue[128] ;
uint16_t data_queue[128];
} cy_as_context ;
} cy_as_context;
#define cy_as_context_is_waiting(ctxt) \
((ctxt)->state & CY_AS_CTXT_STATE_WAITING_RESPONSE)
@ -638,175 +638,175 @@ Macros to access the SDIO card properties
struct cy_as_device {
/* General stuff */
/* A signature to insure we have a valid handle */
uint32_t sig ;
uint32_t sig;
/* The ID of the silicon */
uint16_t silicon_id ;
uint16_t silicon_id;
/* Pointer to the next device */
struct cy_as_device *next_p ;
struct cy_as_device *next_p;
/* This is the client specific tag for this device */
cy_as_hal_device_tag tag ;
cy_as_hal_device_tag tag;
/* This contains various state information about the device */
uint32_t state ;
uint32_t state;
/* Flag indicating whether INT# pin is used for DRQ */
cy_bool use_int_drq ;
cy_bool use_int_drq;
/* DMA related */
/* The endpoint pointers associated with this device */
cy_as_dma_end_point *endp[16] ;
cy_as_dma_end_point *endp[16];
/* List of queue entries that can be used for xfers */
cy_as_dma_queue_entry *dma_freelist_p ;
cy_as_dma_queue_entry *dma_freelist_p;
/* Low level comm related */
/* The contexts available in this device */
cy_as_context *context[CY_RQT_CONTEXT_COUNT] ;
cy_as_context *context[CY_RQT_CONTEXT_COUNT];
/* The low level error returned from sending an async request */
cy_as_return_status_t ll_error ;
cy_as_return_status_t ll_error;
/* A request is currently being sent to West Bridge. */
cy_bool ll_sending_rqt ;
cy_bool ll_sending_rqt;
/* The current mailbox request should be aborted. */
cy_bool ll_abort_curr_rqt ;
cy_bool ll_abort_curr_rqt;
/* Indicates that the LL layer has queued mailbox data. */
cy_bool ll_queued_data ;
cy_bool ll_queued_data;
/* MISC API related */
/* Misc callback */
cy_as_misc_event_callback misc_event_cb ;
cy_as_misc_event_callback misc_event_cb;
/* Storage Related */
/* The reference count for the Storage API */
uint32_t storage_count ;
uint32_t storage_count;
/* Callback for storage events */
cy_as_storage_event_callback_dep storage_event_cb ;
cy_as_storage_event_callback_dep storage_event_cb;
/* V1.2+ callback for storage events */
cy_as_storage_event_callback storage_event_cb_ms ;
cy_as_storage_event_callback storage_event_cb_ms;
/* The error for a sleeping storage operation */
cy_as_return_status_t storage_error ;
cy_as_return_status_t storage_error;
/* Flag indicating that the storage stack is waiting for an operation */
cy_bool storage_wait ;
cy_bool storage_wait;
/* Request used for storage read/writes. */
cy_as_ll_request_response *storage_rw_req_p ;
cy_as_ll_request_response *storage_rw_req_p;
/* Response used for storage read/writes. */
cy_as_ll_request_response *storage_rw_resp_p ;
cy_as_ll_request_response *storage_rw_resp_p;
/* The storage callback */
cy_as_storage_callback_dep storage_cb ;
cy_as_storage_callback_dep storage_cb;
/* The V1.2+ storage callback */
cy_as_storage_callback storage_cb_ms ;
cy_as_storage_callback storage_cb_ms;
/* The bus index for the currently outstanding async storage request */
cy_as_bus_number_t storage_bus_index ;
cy_as_bus_number_t storage_bus_index;
/* The device index for the currently outstanding async storage
* request */
uint32_t storage_device_index ;
uint32_t storage_device_index;
/* The unit index for the currently outstanding async storage request */
uint32_t storage_unit ;
uint32_t storage_unit;
/* The block address for the currently outstanding async storage
* request */
uint32_t storage_block_addr ;
uint32_t storage_block_addr;
/* The operation for the currently outstanding async storage request */
cy_as_oper_type storage_oper ;
cy_as_oper_type storage_oper;
/* The endpoint used to read Storage data */
cy_as_end_point_number_t storage_read_endpoint ;
cy_as_end_point_number_t storage_read_endpoint;
/* The endpoint used to write endpoint data */
cy_as_end_point_number_t storage_write_endpoint ;
cy_as_end_point_number_t storage_write_endpoint;
cy_as_device_desc storage_device_info
[CY_AS_MAX_BUSES][CY_AS_MAX_STORAGE_DEVICES] ;
[CY_AS_MAX_BUSES][CY_AS_MAX_STORAGE_DEVICES];
/* The information on each device on each bus */
/* USB Related */
/* This conatins the endpoint async state */
uint16_t epasync ;
uint16_t epasync;
/* The reference count for the USB API */
uint32_t usb_count ;
uint32_t usb_count;
/* The physical endpoint configuration */
uint8_t usb_phy_config ;
uint8_t usb_phy_config;
/* The callbacks for async func calls */
cy_as_c_b_queue *usb_func_cbs ;
cy_as_c_b_queue *usb_func_cbs;
/* Endpoint configuration information */
cy_as_usb_end_point_config usb_config[16] ;
cy_as_usb_end_point_config usb_config[16];
/* The USB callback */
cy_as_usb_event_callback_dep usb_event_cb ;
cy_as_usb_event_callback_dep usb_event_cb;
/* The V1.2+ USB callback */
cy_as_usb_event_callback usb_event_cb_ms ;
cy_as_usb_event_callback usb_event_cb_ms;
/* The error for a sleeping usb operation */
cy_as_return_status_t usb_error ;
cy_as_return_status_t usb_error;
/* The USB callback for a pending storage operation */
cy_as_usb_io_callback usb_cb[16] ;
cy_as_usb_io_callback usb_cb[16];
/* The buffer pending from a USB operation */
void *usb_pending_buffer ;
void *usb_pending_buffer;
/* The size of the buffer pending from a USB operation */
uint32_t usb_pending_size ;
uint32_t usb_pending_size;
/* If true, send a short packet */
cy_bool usb_spacket[16] ;
cy_bool usb_spacket[16];
/* The amount of data actually xferred */
uint32_t usb_actual_cnt ;
uint32_t usb_actual_cnt;
/* EP1OUT and EP1IN config register contents */
uint8_t usb_ep1cfg[2] ;
uint8_t usb_ep1cfg[2];
/* LEP config register contents */
uint16_t usb_lepcfg[10] ;
uint16_t usb_lepcfg[10];
/* PEP config register contents */
uint16_t usb_pepcfg[4] ;
uint16_t usb_pepcfg[4];
/* Buffer for EP0 and EP1 data sent via mailboxes */
uint8_t *usb_ep_data ;
uint8_t *usb_ep_data;
/* Used to track how many ack requests are pending */
uint32_t usb_delay_ack_count ;
uint32_t usb_delay_ack_count;
/* Maximum transfer size for USB endpoints. */
uint32_t usb_max_tx_size ;
uint32_t usb_max_tx_size;
/* Request for sending EP0 data to West Bridge */
cy_as_ll_request_response *usb_ep0_dma_req ;
cy_as_ll_request_response *usb_ep0_dma_req;
/* Response for EP0 data sent to West Bridge */
cy_as_ll_request_response *usb_ep0_dma_resp ;
cy_as_ll_request_response *usb_ep0_dma_resp;
/* Request for sending EP1 data to West Bridge */
cy_as_ll_request_response *usb_ep1_dma_req ;
cy_as_ll_request_response *usb_ep1_dma_req;
/* Response for EP1 data sent to West Bridge */
cy_as_ll_request_response *usb_ep1_dma_resp ;
cy_as_ll_request_response *usb_ep1_dma_resp;
cy_as_ll_request_response *usb_ep0_dma_req_save ;
cy_as_ll_request_response *usb_ep0_dma_resp_save ;
cy_as_ll_request_response *usb_ep0_dma_req_save;
cy_as_ll_request_response *usb_ep0_dma_resp_save;
/* MTP Related */
/* The reference count for the MTP API */
uint32_t mtp_count ;
uint32_t mtp_count;
/* The MTP event callback supplied by the client */
cy_as_mtp_event_callback mtp_event_cb ;
cy_as_mtp_event_callback mtp_event_cb;
/* The current block table to be transfered */
cy_as_mtp_block_table *tp_blk_tbl ;
cy_as_mtp_block_table *tp_blk_tbl;
cy_as_c_b_queue *func_cbs_mtp ;
cy_as_c_b_queue *func_cbs_usb ;
cy_as_c_b_queue *func_cbs_stor ;
cy_as_c_b_queue *func_cbs_misc ;
cy_as_c_b_queue *func_cbs_res ;
cy_as_c_b_queue *func_cbs_mtp;
cy_as_c_b_queue *func_cbs_usb;
cy_as_c_b_queue *func_cbs_stor;
cy_as_c_b_queue *func_cbs_misc;
cy_as_c_b_queue *func_cbs_res;
/* The last USB event that was received */
cy_as_usb_event usb_last_event ;
cy_as_usb_event usb_last_event;
/* Types of storage media supported by the firmware */
uint8_t media_supported[CY_AS_MAX_BUSES] ;
uint8_t media_supported[CY_AS_MAX_BUSES];
/* SDIO card parameters*/
cy_as_sdio_device sdiocard[CY_AS_MAX_BUSES];
/* if true, MTP enabled Firmware. */
cy_bool is_mtp_firmware ;
cy_bool is_mtp_firmware;
/* if true, mailbox message has come already */
cy_bool is_mtp_data_pending ;
cy_bool is_mtp_data_pending;
/* True between the time an Init was called and
* the complete event is generated */
cy_bool mtp_turbo_active ;
cy_bool mtp_turbo_active;
/* mbox reported EP 2 data len */
uint16_t mtp_data_len ;
uint16_t mtp_data_len;
/* The error for mtp EP4 write operation */
cy_as_return_status_t mtp_error ;
cy_as_return_status_t mtp_error;
/* mtp send/get operation callback */
cy_as_function_callback mtp_cb ;
cy_as_function_callback mtp_cb;
/* mtp send/get operation client id */
uint32_t mtp_client ;
uint32_t mtp_client;
/* mtp operation type. To be used in callback */
cy_as_funct_c_b_type mtp_op ;
cy_as_funct_c_b_type mtp_op;
/* Firmware is running in P2S only mode. */
cy_bool is_storage_only_mode ;
cy_bool is_storage_only_mode;
/* Interrupt mask value during device standby. */
uint32_t stby_int_mask ;
} ;
uint32_t stby_int_mask;
};
#define cy_as_device_is_configured(dp) \
((dp)->state & CY_AS_DEVICE_STATE_CONFIGURED)
@ -1020,7 +1020,7 @@ struct cy_as_device {
((dp)->silicon_id == CY_AS_MEM_CM_WB_CFG_ID_HDID_ANTIOCH_VALUE)
#ifdef CY_AS_LOG_SUPPORT
extern void cy_as_log_debug_message(int value, const char *msg) ;
extern void cy_as_log_debug_message(int value, const char *msg);
#else
#define cy_as_log_debug_message(value, msg)
#endif
@ -1050,7 +1050,7 @@ extern void cy_as_log_debug_message(int value, const char *msg) ;
extern cy_as_device *
cy_as_device_find_from_tag(
cy_as_hal_device_tag tag
) ;
);
#include "cyas_cplus_end.h"

View File

@ -91,7 +91,7 @@ typedef enum cy_as_dma_direction {
cy_as_direction_in_out = 2,
/* Do no change the endpoint type */
cy_as_direction_dont_change = 3
} cy_as_dma_direction ;
} cy_as_dma_direction;
/*********************************
* West Bridge Functions
@ -120,7 +120,7 @@ extern cy_as_return_status_t
cy_as_dma_start(
/* The device to start */
cy_as_device *dev_p
) ;
);
/* Summary
Shutdown the DMA module
@ -142,7 +142,7 @@ extern cy_as_return_status_t
cy_as_dma_stop(
/* The device to stop */
cy_as_device *dev_p
) ;
);
/* Summary
This function cancels all outstanding DMA requests on a given endpoint
@ -172,7 +172,7 @@ cy_as_dma_cancel(
/* The endpoint to cancel */
cy_as_end_point_number_t ep,
cy_as_return_status_t err
) ;
);
/* Summary
This function enables a single endpoint for DMA operations
@ -201,7 +201,7 @@ cy_as_dma_enable_end_point(
cy_bool enable,
/* The direction of the endpoint */
cy_as_dma_direction dir
) ;
);
/* Summary
This function queue a DMA request for a given endpoint
@ -246,7 +246,7 @@ cy_as_dma_queue_request(
/* The callback to call when the DMA request is complete,
* either successfully or via an error */
cy_as_dma_callback cb
) ;
);
/* Summary
This function waits until all DMA requests on a given endpoint
@ -280,7 +280,7 @@ cy_as_dma_drain_queue(
/* If CyTrue, call kickstart to start the DMA process,
if cy_false, west bridge will start the DMA process */
cy_bool kickstart
) ;
);
/* Summary
Sets the maximum amount of data West Bridge can accept in a single
@ -306,7 +306,7 @@ cy_as_dma_set_max_dma_size(
cy_as_end_point_number_t ep,
/* The max size of this endpoint in bytes */
uint32_t size
) ;
);
/* Summary
This function starts the DMA process on a given channel.
@ -326,7 +326,7 @@ cy_as_dma_kick_start(
cy_as_device *dev_p,
/* The endpoint to change */
cy_as_end_point_number_t ep
) ;
);
/* Summary
This function receives endpoint data from a request.
@ -368,7 +368,7 @@ cy_as_dma_completed_callback(
uint32_t length,
/* Status of DMA operation. */
cy_as_return_status_t status
) ;
);
#include "cyas_cplus_end.h"

View File

@ -37,7 +37,7 @@ typedef void (*cy_as_hal_dma_complete_callback)(
cy_as_hal_device_tag tag,
cy_as_end_point_number_t ep,
uint32_t cnt,
cy_as_return_status_t ret) ;
cy_as_return_status_t ret);
typedef cy_as_hal_dma_complete_callback \
cy_an_hal_dma_complete_callback;

View File

@ -162,8 +162,8 @@
typedef struct cy_as_hal_sleep_channel {
/* This structure is filled in with OS specific information
to implementat a sleep channel */
int m_channel ;
} cy_as_hal_sleep_channel ;
int m_channel;
} cy_as_hal_sleep_channel;
/* Summary
This function is called to write a register value
@ -189,7 +189,7 @@ cy_as_hal_write_register(
uint16_t addr,
/* The value to write to the register */
uint16_t value
) ;
);
/* Summary
This function is called to read a register value
@ -213,7 +213,7 @@ cy_as_hal_read_register(
cy_as_hal_device_tag tag,
/* The address we are writing to */
uint16_t addr
) ;
);
/* Summary
This function initiates a DMA write operation to write
@ -247,7 +247,7 @@ cy_as_hal_dma_setup_write(
/* The maximum amount of data that the endpoint
* can accept as one packet */
uint16_t maxsize
) ;
);
/* Summary
This function initiates a DMA read operation from West Bridge
@ -280,7 +280,7 @@ cy_as_hal_dma_setup_read(
/* The maximum amount of data that the endpoint
* can provide in one DMA operation */
uint16_t maxsize
) ;
);
/* Summary
This function cancels a pending DMA request
@ -300,7 +300,7 @@ cy_as_hal_dma_cancel_request(
cy_as_hal_device_tag tag,
/* The endpoint we are reading from */
cy_as_end_point_number_t ep
) ;
);
/* Summary
This function registers a callback function to be called when
@ -324,7 +324,7 @@ cy_as_hal_dma_register_callback(
cy_as_hal_device_tag tag,
/* The callback to call when a request has completed */
cy_as_hal_dma_complete_callback cb
) ;
);
/* Summary
This function returns the maximum size of a DMA request that can
@ -348,7 +348,7 @@ cy_as_hal_dma_max_request_size(
cy_as_hal_device_tag tag,
/* The endpoint of interest */
cy_as_end_point_number_t ep
) ;
);
/* Summary
This function sets the WAKEUP pin to a specific state on the
@ -370,7 +370,7 @@ cy_as_hal_set_wakeup_pin(
cy_as_hal_device_tag tag,
/* The desired state of the wakeup pin */
cy_bool state
) ;
);
/* Summary
Synchronise the West Bridge device clocks to re-establish device
@ -392,7 +392,7 @@ EXTERN cy_bool
cy_as_hal_sync_device_clocks(
/* The tag to ID a specific West Bridge device */
cy_as_hal_device_tag tag,
) ;
);
/* Summary
Initialize West Bridge device registers that may have been
@ -418,7 +418,7 @@ cy_as_hal_init_dev_registers(
cy_as_hal_device_tag tag,
/* Indicates whether this is a wake-up from standby. */
cy_bool is_standby_wakeup
) ;
);
/* Summary
This function reads a set of P-port accessible device registers and
@ -447,7 +447,7 @@ EXTERN void
cy_as_hal_read_regs_before_standby(
/* The tag to ID a specific West Bridge device */
cy_as_hal_device_tag tag
) ;
);
/* Summary
This function restores the old values to a set of P-port
@ -470,7 +470,7 @@ EXTERN void
cy_as_hal_restore_regs_after_standby(
/* The tag to ID a specific West Bridge device */
cy_as_hal_device_tag tag
) ;
);
/*
* The functions below this comment are part of the HAL layer,
@ -497,7 +497,7 @@ EXTERN void *
cy_as_hal_alloc(
/* The size of the memory block to allocate */
uint32_t size
) ;
);
/* Summary
This function frees a previously allocated block of memory
@ -515,7 +515,7 @@ EXTERN void
cy_as_hal_free(
/* Pointer to a memory block to free */
void *ptr
) ;
);
/* Summary
This function is a malloc equivalent that can be used from an
@ -545,7 +545,7 @@ EXTERN void *
cy_as_hal_c_b_alloc(
/* The size of the memory block to allocate */
uint32_t size
) ;
);
/* Summary
This function frees the memory allocated through the CyAsHalCBAlloc
@ -567,7 +567,7 @@ EXTERN void
cy_as_hal_c_b_free(
/* Pointer to the memory block to be freed */
void *ptr
) ;
);
/* Summary
This function sets a block of memory to a specific value
@ -586,7 +586,7 @@ cy_as_mem_set(
uint8_t value,
/* The number of bytes to set */
uint32_t cnt
) ;
);
/* Summary
This function creates or initializes a sleep channel
@ -609,7 +609,7 @@ EXTERN cy_bool
cy_as_hal_create_sleep_channel(
/* Pointer to the sleep channel to create/initialize */
cy_as_hal_sleep_channel *chan
) ;
);
/* Summary
This function destroys an existing sleep channel
@ -631,7 +631,7 @@ EXTERN cy_bool
cy_as_hal_destroy_sleep_channel(
/* The sleep channel to destroy */
cy_as_hal_sleep_channel chan
) ;
);
/* Summary
This function causes the calling process or thread to sleep until
@ -655,7 +655,7 @@ cy_as_hal_sleep_on(
cy_as_hal_sleep_channel chan,
/* The maximum time to sleep in milli-seconds */
uint32_t ms
) ;
);
/* Summary
This function casues the process or thread sleeping on the given
@ -676,7 +676,7 @@ EXTERN cy_bool
cy_as_hal_wake(
/* The sleep channel to wake */
cy_as_hal_sleep_channel chan
) ;
);
/* Summary
This function disables interrupts, insuring that short bursts
@ -701,7 +701,7 @@ cy_as_hal_wake(
* CyAsHalEnableInterrupts
*/
EXTERN uint32_t
cy_as_hal_disable_interrupts() ;
cy_as_hal_disable_interrupts();
/* Summary
This function re-enables interrupts after a critical section of
@ -722,7 +722,7 @@ EXTERN void
cy_as_hal_enable_interrupts(
/* Value returned by the previous CyAsHalDisableInterrupts call. */
uint32_t value
) ;
);
/* Summary
This function sleeps for 150 ns.
@ -734,7 +734,7 @@ cy_as_hal_enable_interrupts(
*/
EXTERN void
cy_as_hal_sleep150(
) ;
);
/* Summary
This function sleeps for the given number of milliseconds
@ -745,7 +745,7 @@ cy_as_hal_sleep150(
EXTERN void
cy_as_hal_sleep(
uint32_t ms
) ;
);
/* Summary
This function asserts when the condition evaluates to zero
@ -761,7 +761,7 @@ EXTERN void
cy_as_hal_assert(
/* The condition to evaluate */
cy_bool cond
) ;
);
/* Summary
This function prints a message from the API to a human readable device
@ -779,7 +779,7 @@ cy_as_hal_print_message(
/* The message to print */
const char *fmt_p,
... /* Variable arguments */
) ;
);
/* Summary
This function reports whether the HAL implementation uses
@ -795,6 +795,6 @@ cy_as_hal_print_message(
*/
EXTERN cy_bool
cy_as_hal_is_polling(
void) ;
void);
#endif

View File

@ -58,7 +58,7 @@ cy_as_intr_start(
cy_as_device *dev_p,
/* If true, enable the DMA interrupt through the INT signal */
cy_bool dmaintr
) ;
);
/* Summary
Stop the interrupt manager module
@ -81,7 +81,7 @@ cy_as_return_status_t
cy_as_intr_stop(
/* Device bein stopped */
cy_as_device *dev_p
) ;
);
/* Summary
@ -97,7 +97,7 @@ cy_as_intr_stop(
void cy_as_intr_service_interrupt(
/* The USER supplied tag for this device */
cy_as_hal_device_tag tag
) ;
);
#include "cyas_cplus_end.h"

View File

@ -25,12 +25,12 @@
#include "cyasdevice.h"
extern cy_as_return_status_t
cy_as_usb_map_logical2_physical(cy_as_device *dev_p) ;
cy_as_usb_map_logical2_physical(cy_as_device *dev_p);
extern cy_as_return_status_t
cy_as_usb_setup_dma(cy_as_device *dev_p) ;
cy_as_usb_setup_dma(cy_as_device *dev_p);
extern cy_as_return_status_t
cy_as_usb_set_dma_sizes(cy_as_device *dev_p) ;
cy_as_usb_set_dma_sizes(cy_as_device *dev_p);
#endif

View File

@ -168,7 +168,7 @@ typedef enum cy_as_remove_request_result_t {
cy_as_remove_request_sucessful,
cy_as_remove_request_in_transit,
cy_as_remove_request_not_found
} cy_as_remove_request_result_t ;
} cy_as_remove_request_result_t;
/* Summary
Start the low level communications module
@ -178,12 +178,12 @@ typedef enum cy_as_remove_request_result_t {
cy_as_return_status_t
cy_as_ll_start(
cy_as_device *dev_p
) ;
);
cy_as_return_status_t
cy_as_ll_stop(
cy_as_device *dev_p
) ;
);
cy_as_ll_request_response *
@ -193,31 +193,31 @@ cy_as_ll_create_request(
uint8_t context,
/* Length of the request in 16 bit words */
uint16_t length
) ;
);
void
cy_as_ll_init_request(
cy_as_ll_request_response *req_p,
uint16_t code,
uint16_t context,
uint16_t length) ;
uint16_t length);
void
cy_as_ll_init_response(
cy_as_ll_request_response *req_p,
uint16_t length) ;
uint16_t length);
void
cy_as_ll_destroy_request(
cy_as_device *dev_p,
cy_as_ll_request_response *) ;
cy_as_ll_request_response *);
cy_as_ll_request_response *
cy_as_ll_create_response(
cy_as_device *dev_p,
/* Length of the request in 16 bit words */
uint16_t length
) ;
);
cy_as_remove_request_result_t
cy_as_ll_remove_request(
@ -225,15 +225,15 @@ cy_as_ll_remove_request(
cy_as_context *ctxt_p,
cy_as_ll_request_response *req_p,
cy_bool force
) ;
);
void
cy_as_ll_remove_all_requests(cy_as_device *dev_p,
cy_as_context *ctxt_p) ;
cy_as_context *ctxt_p);
void
cy_as_ll_destroy_response(
cy_as_device *dev_p,
cy_as_ll_request_response *) ;
cy_as_ll_request_response *);
cy_as_return_status_t
cy_as_ll_send_request(
@ -247,7 +247,7 @@ cy_as_ll_send_request(
cy_bool sync,
/* Callback to call when reply is received */
cy_as_response_callback cb
) ;
);
cy_as_return_status_t
cy_as_ll_send_request_wait_reply(
@ -257,7 +257,7 @@ cy_as_ll_send_request_wait_reply(
cy_as_ll_request_response *req,
/* Storage for a reply, must be sure it is of sufficient size */
cy_as_ll_request_response *resp
) ;
);
/* Summary
This function registers a callback function to be called when a
@ -273,7 +273,7 @@ cy_as_ll_register_request_callback(
cy_as_device *dev_p,
uint8_t context,
cy_as_response_callback cb
) ;
);
/* Summary
This function packs a set of bytes given by the data_p pointer
@ -289,7 +289,7 @@ cy_as_ll_request_response__pack(
uint32_t length,
/* The data to pack */
void *data_p
) ;
);
/* Summary
This function unpacks a set of bytes from a request/reply
@ -305,7 +305,7 @@ cy_as_ll_request_response__unpack(
uint32_t length,
/* The destination of the unpack operation */
void *data_p
) ;
);
/* Summary
This function sends a status response back to the West Bridge
@ -320,7 +320,7 @@ cy_as_ll_send_status_response(
/* The success/failure code to send */
uint16_t code,
/* Flag to clear wait on storage context */
uint8_t clear_storage) ;
uint8_t clear_storage);
/* Summary
This function sends a response back to the West Bridge device.
@ -344,7 +344,7 @@ cy_as_ll_send_data_response(
uint16_t length,
/* The data for the response */
void *data
) ;
);
/* Summary
This function removes any requests of the given type
@ -359,7 +359,7 @@ cy_as_ll_remove_ep_data_requests(
/* The West Bridge device */
cy_as_device *dev_p,
cy_as_end_point_number_t ep
) ;
);
#include "cyas_cplus_end.h"

View File

@ -47,7 +47,7 @@ typedef enum cy_as_media_type {
cy_as_media_sdio = 0x04,
cy_as_media_max_media_value = 0x05
} cy_as_media_type ;
} cy_as_media_type;
#include "cyas_cplus_end.h"

View File

@ -66,7 +66,7 @@
* CyAsMiscCreateDevice
* CyAsMiscDestroyDevice
*/
typedef void *cy_as_device_handle ;
typedef void *cy_as_device_handle;
/* Summary
This data type gives the mode for the DACK# signal
@ -74,7 +74,7 @@ typedef void *cy_as_device_handle ;
typedef enum cy_as_device_dack_mode {
cy_as_device_dack_ack, /* Operate in the ACK mode */
cy_as_device_dack_eob /* Operate in the EOB mode */
} cy_as_device_dack_mode ;
} cy_as_device_dack_mode;
/* Summary
This data structure gives the options for all hardware features.
@ -89,21 +89,21 @@ typedef enum cy_as_device_dack_mode {
*/
typedef struct cy_as_device_config {
/* If TRUE, the P port is running in SRAM mode. */
cy_bool srammode ;
cy_bool srammode;
/* If TRUE, the P port is synchronous, otherwise async */
cy_bool sync ;
cy_bool sync;
/* If TRUE, DMA req will be delivered via the interrupt signal */
cy_bool dmaintr ;
cy_bool dmaintr;
/* Mode for the DACK# signal */
cy_as_device_dack_mode dackmode ;
cy_as_device_dack_mode dackmode;
/* If TRUE, the DRQ line is active high, otherwise active low */
cy_bool drqpol ;
cy_bool drqpol;
/* If TRUE, the DACK line is active high, otherwise active low */
cy_bool dackpol ;
cy_bool dackpol;
/* If TRUE, the clock is connected to a crystal, otherwise it is
connected to a clock */
cy_bool crystal ;
} cy_as_device_config ;
cy_bool crystal;
} cy_as_device_config;
/* Summary
@ -174,7 +174,7 @@ typedef enum cy_as_misc_signal_polarity {
cy_as_misc_active_high,
cy_as_misc_active_low
} cy_as_misc_signal_polarity ;
} cy_as_misc_signal_polarity;
@ -303,7 +303,7 @@ typedef enum cy_as_funct_c_b_type {
CY_FUNCT_CB_MTP_STOP_STORAGE_ONLY,
CY_FUNCT_CB_NODATA = 0x40000000U,
CY_FUNCT_CB_DATA = 0x20000000U
} cy_as_funct_c_b_type ;
} cy_as_funct_c_b_type;
/* Summary
This type specifies the general West Bridge function callback.
@ -321,7 +321,7 @@ typedef void (*cy_as_function_callback)(
cy_as_return_status_t status,
uint32_t client,
cy_as_funct_c_b_type type,
void *data) ;
void *data);
/* Summary
This type specifies the general West Bridge event that has
@ -354,7 +354,7 @@ typedef enum cy_as_misc_event_type {
/* This event is sent when the firmware image downloaded
cannot run on the active west bridge device. */
cy_as_event_misc_device_mismatch
} cy_as_misc_event_type ;
} cy_as_misc_event_type;
/* Summary
This type is the type of a callback function that is called when a
@ -378,7 +378,7 @@ typedef void (*cy_as_misc_event_callback)(
cy_as_misc_event_type ev,
/* The data assocaited with the event being reported */
void *evdata
) ;
);
#ifndef __doxygen__
/* Summary
@ -447,7 +447,7 @@ typedef enum cy_as_low_speed_sd_freq {
CY_AS_SD_DEFAULT_FREQ = 0,
/* 24 MHz */
CY_AS_SD_RATED_FREQ
} cy_as_low_speed_sd_freq ;
} cy_as_low_speed_sd_freq;
/* Summary
This enum lists the set of clock frequencies that are supported
@ -465,7 +465,7 @@ typedef enum cy_as_low_speed_sd_freq {
typedef enum cy_as_high_speed_sd_freq {
CY_AS_HS_SD_FREQ_48, /* 48 MHz, default value */
CY_AS_HS_SD_FREQ_24 /* 24 MHz */
} cy_as_high_speed_sd_freq ;
} cy_as_high_speed_sd_freq;
/* Summary
Struct encapsulating all information returned by the
@ -490,7 +490,7 @@ typedef struct cy_as_get_firmware_version_data {
uint8_t media_type;
/* Return value to indicate the release or debug mode of firmware */
cy_bool is_debug_mode;
} cy_as_get_firmware_version_data ;
} cy_as_get_firmware_version_data;
/*****************************
@ -519,7 +519,7 @@ cy_as_misc_create_device(
cy_as_device_handle *handle_p,
/* The HAL specific tag for this device */
cy_as_hal_device_tag tag
) ;
);
/* Summary
This functions destroys a previously created West Bridge device.
@ -543,7 +543,7 @@ EXTERN cy_as_return_status_t
cy_as_misc_destroy_device(
/* Handle to the device to destroy */
cy_as_device_handle handle
) ;
);
/* Summary
This function initializes the hardware for basic communication with
@ -576,7 +576,7 @@ cy_as_misc_configure_device(
cy_as_device_handle handle,
/* Configuration information */
cy_as_device_config *config_p
) ;
);
/* Summary
This function returns non-zero if West Bridge is in standby and
@ -599,7 +599,7 @@ cy_as_misc_in_standby(
cy_as_device_handle handle,
/* Return value for standby state */
cy_bool *standby
) ;
);
/* Summary
This function downloads the firmware to West Bridge device.
@ -647,7 +647,7 @@ cy_as_misc_download_firmware(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
/* Summary
@ -683,7 +683,7 @@ cy_as_misc_get_firmware_version(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
#if !defined(__doxygen__)
@ -721,7 +721,7 @@ cy_as_misc_read_m_c_u_register(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
/* Summary
This function writes to an MCU accessible register on the West Bridge.
@ -762,7 +762,7 @@ cy_as_misc_write_m_c_u_register(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
#endif
@ -816,7 +816,7 @@ cy_as_misc_reset(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
/* Summary
This function acquires a given resource.
@ -864,7 +864,7 @@ cy_as_misc_acquire_resource(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
/* Summary
This function releases a given resource.
@ -898,7 +898,7 @@ cy_as_misc_release_resource(
cy_as_device_handle handle,
/* The resource to release */
cy_as_resource_type resource
) ;
);
#ifndef __doxygen__
/* Summary
@ -955,7 +955,7 @@ cy_as_misc_set_trace_level(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
#endif
/* Summary
@ -1015,7 +1015,7 @@ cy_as_misc_enter_standby_e_x_u(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
/* Summary
This function is provided for backwards compatibility.
@ -1032,7 +1032,7 @@ cy_as_misc_enter_standby(cy_as_device_handle handle,
cy_bool pin,
cy_as_function_callback cb,
uint32_t client
) ;
);
/* Summary
This function brings West Bridge out of sleep mode.
@ -1068,7 +1068,7 @@ cy_as_misc_leave_standby(
cy_as_device_handle handle,
/* The resource causing the wakeup */
cy_as_resource_type resource
) ;
);
/* Summary
This function registers a callback function to be called when an
@ -1091,7 +1091,7 @@ cy_as_misc_register_callback(
cy_as_device_handle handle,
/* The function to call */
cy_as_misc_event_callback callback
) ;
);
/* Summary
This function sets the logging level for log messages.
@ -1107,7 +1107,7 @@ EXTERN void
cy_as_misc_set_log_level(
/* Level to set, 0 is fewer messages, 255 is all */
uint8_t level
) ;
);
/* Summary
@ -1143,7 +1143,7 @@ cy_as_misc_storage_changed(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
/* Summary
This function instructs the West Bridge firmware to start/stop
@ -1181,7 +1181,7 @@ cy_as_misc_heart_beat_control(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
/* Summary
This function gets the current state of a GPIO pin on the
@ -1227,7 +1227,7 @@ cy_as_misc_get_gpio_value(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
/* Summary
This function updates the state of a GPIO pin on the West
@ -1273,7 +1273,7 @@ cy_as_misc_set_gpio_value(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
/* Summary
Set the West Bridge device in the low power suspend mode.
@ -1328,7 +1328,7 @@ cy_as_misc_enter_suspend(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
/* Summary
Wake up the West Bridge device from suspend mode.
@ -1371,7 +1371,7 @@ cy_as_misc_leave_suspend(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
/* Summary
Reserve first numzones zones of nand device for storing
@ -1400,7 +1400,7 @@ cy_as_misc_reserve_l_n_a_boot_area(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
/* Summary
Select the clock frequency to be used when talking to low
@ -1448,7 +1448,7 @@ cy_as_misc_set_low_speed_sd_freq(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
/* Summary
Select the clock frequency to be used when talking to high speed
@ -1493,7 +1493,7 @@ cy_as_misc_set_high_speed_sd_freq(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
/* Summary
Select the polarity of the SD_POW output driven by West Bridge.
@ -1539,7 +1539,7 @@ cy_as_misc_set_sd_power_polarity(
cy_as_function_callback cb,
/* Client data to be passed to the callback. */
uint32_t client
) ;
);
/* For supporting deprecated functions */
#include "cyasmisc_dep.h"

View File

@ -132,9 +132,9 @@
*/
typedef struct cy_as_mtp_block_table {
uint32_t start_blocks[CY_AS_MAX_BLOCK_TABLE_ENTRIES] ;
uint16_t num_blocks[CY_AS_MAX_BLOCK_TABLE_ENTRIES] ;
} cy_as_mtp_block_table ;
uint32_t start_blocks[CY_AS_MAX_BLOCK_TABLE_ENTRIES];
uint16_t num_blocks[CY_AS_MAX_BLOCK_TABLE_ENTRIES];
} cy_as_mtp_block_table;
/* Summary
This type specifies the type of MTP event that has occurred.
@ -178,7 +178,7 @@ typedef enum cy_as_mtp_event {
will result in an USB reset. this event has
no data */
cy_as_mtp_block_table_needed
} cy_as_mtp_event ;
} cy_as_mtp_event;
/* Summary
Data for the CyAsMTPSendObjectComplete event.
@ -202,10 +202,10 @@ typedef enum cy_as_mtp_event {
*/
typedef struct cy_as_mtp_send_object_complete_data {
cy_as_return_status_t status ;
uint32_t byte_count ;
uint32_t transaction_id ;
} cy_as_mtp_send_object_complete_data ;
cy_as_return_status_t status;
uint32_t byte_count;
uint32_t transaction_id;
} cy_as_mtp_send_object_complete_data;
/* Summary
Data for the CyAsMTPGetObjectComplete event.
@ -220,9 +220,9 @@ typedef struct cy_as_mtp_send_object_complete_data {
*/
typedef struct cy_as_mtp_get_object_complete_data {
cy_as_return_status_t status ;
uint32_t byte_count ;
} cy_as_mtp_get_object_complete_data ;
cy_as_return_status_t status;
uint32_t byte_count;
} cy_as_mtp_get_object_complete_data;
/* Summary
MTP Event callback.
@ -238,7 +238,7 @@ typedef void (*cy_as_mtp_event_callback)(
cy_as_device_handle handle,
cy_as_mtp_event evtype,
void *evdata
) ;
);
/* Summary
This is the callback function called after asynchronous API
@ -257,7 +257,7 @@ typedef void (*cy_as_mtp_function_callback)(
cy_as_return_status_t status,
/* A client supplied 32 bit tag */
uint32_t client
) ;
);
/**************************************
* MTP Functions
@ -310,7 +310,7 @@ cy_as_mtp_start(
cy_as_mtp_event_callback event_c_b,
cy_as_function_callback cb,
uint32_t client
) ;
);
/* Summary
@ -345,7 +345,7 @@ cy_as_mtp_stop(
cy_as_device_handle handle,
cy_as_function_callback cb,
uint32_t client
) ;
);
/* Summary
This function sets up a Turbo SendObject operation.
@ -397,7 +397,7 @@ cy_as_mtp_init_send_object(
uint32_t num_bytes,
cy_as_function_callback cb,
uint32_t client
) ;
);
/* Summary
This function cancels an ongoing MTP operation.
@ -433,7 +433,7 @@ cy_as_mtp_cancel_send_object(
cy_as_device_handle handle,
cy_as_function_callback cb,
uint32_t client
) ;
);
/* Summary
This function sets up a turbo GetObject operation.
@ -484,7 +484,7 @@ cy_as_mtp_init_get_object(
uint32_t transaction_id,
cy_as_function_callback cb,
uint32_t client
) ;
);
/* Summary
This function cancels an ongoing turbo GetObject
@ -518,7 +518,7 @@ cy_as_mtp_cancel_get_object(
cy_as_device_handle handle,
cy_as_function_callback cb,
uint32_t client
) ;
);
/* Summary
This function is used to transfer a BlockTable as part of
@ -560,7 +560,7 @@ cy_as_mtp_send_block_table(
cy_as_mtp_block_table *table,
cy_as_function_callback cb,
uint32_t client
) ;
);
/* Summary
This function is used to mark the start of a storage

View File

@ -300,7 +300,7 @@ typedef enum cy_as_storage_event {
* percieves an interrrupt from an SDIO card */
cy_as_sdio_interrupt
} cy_as_storage_event ;
} cy_as_storage_event;
/* Summary
This type gives the type of the operation in a storage
@ -322,7 +322,7 @@ typedef enum cy_as_oper_type {
cy_as_op_read,
/* A data write operation */
cy_as_op_write
} cy_as_oper_type ;
} cy_as_oper_type;
/* Summary
This data structure describes a specific type of media
@ -337,22 +337,22 @@ typedef enum cy_as_oper_type {
*/
typedef struct cy_as_device_desc {
/* Type of device */
cy_as_media_type type ;
cy_as_media_type type;
/* Is the device removable */
cy_bool removable ;
cy_bool removable;
/* Is the device writeable */
cy_bool writeable ;
cy_bool writeable;
/* Basic block size for device */
uint16_t block_size ;
uint16_t block_size;
/* Number of LUNs on the device */
uint32_t number_units ;
uint32_t number_units;
/* Is the device password locked */
cy_bool locked ;
cy_bool locked;
/* Size in bytes of an Erase Unit. Block erase operation
is only supported for SD storage, and the erase_unit_size
is invalid for all other kinds of storage. */
uint32_t erase_unit_size ;
} cy_as_device_desc ;
uint32_t erase_unit_size;
} cy_as_device_desc;
/* Summary
This data structure describes a specific unit on a
@ -368,14 +368,14 @@ typedef struct cy_as_device_desc {
*/
typedef struct cy_as_unit_desc {
/* Type of device */
cy_as_media_type type ;
cy_as_media_type type;
/* Basic block size for device */
uint16_t block_size ;
uint16_t block_size;
/* Physical start block for LUN */
uint32_t start_block ;
uint32_t start_block;
/* Number of blocks in the LUN */
uint32_t unit_size ;
} cy_as_unit_desc ;
uint32_t unit_size;
} cy_as_unit_desc;
/* Summary
This function type defines a callback to be called after an
@ -404,7 +404,7 @@ typedef void (*cy_as_storage_callback)(
cy_as_oper_type op,
/* The error status */
cy_as_return_status_t status
) ;
);
/* Summary
This function type defines a callback to be called in the
@ -436,7 +436,7 @@ typedef void (*cy_as_storage_event_callback)(
cy_as_storage_event evtype,
/* Event related data */
void *evdata
) ;
);
/* Summary
This function type defines a callback to be called after
@ -468,7 +468,7 @@ typedef void (*cy_as_sdio_callback)(
cy_as_oper_type op,
/* The status of the operation */
cy_as_return_status_t status
) ;
);
/* Summary
Enumeration of SD/MMC card registers that can be read
@ -486,7 +486,7 @@ typedef enum cy_as_sd_card_reg_type {
cy_as_sd_reg_OCR = 0,
cy_as_sd_reg_CID,
cy_as_sd_reg_CSD
} cy_as_sd_card_reg_type ;
} cy_as_sd_card_reg_type;
/* Summary
Struct encapsulating parameters and return values for a
@ -501,12 +501,12 @@ typedef enum cy_as_sd_card_reg_type {
*/
typedef struct cy_as_storage_query_device_data {
/* The bus with the device to query */
cy_as_bus_number_t bus ;
cy_as_bus_number_t bus;
/* The logical device number to query */
uint32_t device ;
uint32_t device;
/* The return value for the device descriptor */
cy_as_device_desc desc_p ;
} cy_as_storage_query_device_data ;
cy_as_device_desc desc_p;
} cy_as_storage_query_device_data;
/* Summary
@ -522,14 +522,14 @@ typedef struct cy_as_storage_query_device_data {
*/
typedef struct cy_as_storage_query_unit_data {
/* The bus with the device to query */
cy_as_bus_number_t bus ;
cy_as_bus_number_t bus;
/* The logical device number to query */
uint32_t device ;
uint32_t device;
/* The unit to query on the device */
uint32_t unit ;
uint32_t unit;
/* The return value for the unit descriptor */
cy_as_unit_desc desc_p ;
} cy_as_storage_query_unit_data ;
cy_as_unit_desc desc_p;
} cy_as_storage_query_unit_data;
/* Summary
Struct encapsulating the input parameter and return
@ -548,7 +548,7 @@ typedef struct cy_as_storage_sd_reg_read_data {
uint8_t *buf_p;
/* Length of data to be copied in bytes. */
uint8_t length;
} cy_as_storage_sd_reg_read_data ;
} cy_as_storage_sd_reg_read_data;
/* Summary
Controls which pins are used for card detection
@ -564,7 +564,7 @@ typedef struct cy_as_storage_sd_reg_read_data {
typedef enum cy_as_storage_card_detect {
cy_as_storage_detect_GPIO,
cy_as_storage_detect_SDAT_3
} cy_as_storage_card_detect ;
} cy_as_storage_card_detect;
#ifndef __doxygen__
#define cy_as_storage_detect_GPIO_0 cy_as_storage_detect_GPIO
@ -601,7 +601,7 @@ typedef struct cy_as_m_s_c_progress_data {
uint32_t wr_count;
/* Number of sectors read since the last event. */
uint32_t rd_count;
} cy_as_m_s_c_progress_data ;
} cy_as_m_s_c_progress_data;
/* Summary
Flag to set Direct Write operation to read back from the
@ -849,7 +849,7 @@ cy_as_storage_start(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
/* Summary
This function stops the West Bridge storage module.
@ -900,7 +900,7 @@ cy_as_storage_stop(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
/* Summary
This function is used to register a callback function
@ -947,7 +947,7 @@ cy_as_storage_register_callback(
cy_as_device_handle handle,
/* The callback function to call for async storage events */
cy_as_storage_event_callback callback
) ;
);
/* Summary
This function claims a given media type.
@ -1007,7 +1007,7 @@ cy_as_storage_claim(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
/* Summary
This function releases a given media type.
@ -1060,7 +1060,7 @@ cy_as_storage_release(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
/* Summary
This function information about the number of devices present
@ -1113,7 +1113,7 @@ cy_as_storage_query_bus(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
/* Summary
This function information about the number of devices
@ -1167,7 +1167,7 @@ cy_as_storage_query_media(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
/* Summary
This function returns information about a given device
@ -1224,7 +1224,7 @@ cy_as_storage_query_device(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
/* Summary
This function returns information about a given unit on a
@ -1276,7 +1276,7 @@ cy_as_storage_query_unit(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
/* Summary
This function enables/disables the handling of SD/MMC card
@ -1332,7 +1332,7 @@ cy_as_storage_device_control(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
/* Summary
This function reads one or more blocks of data from
@ -1407,7 +1407,7 @@ cy_as_storage_read(
void *data_p,
/* The number of blocks to be read */
uint16_t num_blocks
) ;
);
/* Summary
This function asynchronously reads one or more blocks of data
@ -1490,7 +1490,7 @@ cy_as_storage_read_async(
/* The function to call when the read is complete
or an error occurs */
cy_as_storage_callback callback
) ;
);
/* Summary
This function writes one or more blocks of data
@ -1564,7 +1564,7 @@ cy_as_storage_write(
void *data_p,
/* The number of blocks to be written */
uint16_t num_blocks
) ;
);
/* Summary
This function asynchronously writes one or more blocks
@ -1644,7 +1644,7 @@ cy_as_storage_write_async(
/* The function to call when the write is complete
or an error occurs */
cy_as_storage_callback callback
) ;
);
/* Summary
This function aborts any outstanding asynchronous operation
@ -1681,7 +1681,7 @@ EXTERN cy_as_return_status_t
cy_as_storage_cancel_async(
/* Handle to the device with outstanding async request */
cy_as_device_handle handle
) ;
);
/* Summary
This function is used to read the content of SD registers
@ -1732,7 +1732,7 @@ cy_as_storage_sd_register_read(
cy_as_function_callback cb,
/* Call context to send to the cb function. */
uint32_t client
) ;
);
/* Summary
Creates a partition starting at the given block and using the
@ -1892,7 +1892,7 @@ cy_as_storage_get_transfer_amount(
cy_as_function_callback cb,
/* Client context to pass to the callback */
uint32_t client
) ;
);
/* Summary
Performs a Sector Erase on an attached SD Card
@ -1949,7 +1949,7 @@ cy_as_storage_erase(
cy_as_function_callback cb,
/* Client context to pass to the callback */
uint32_t client
) ;
);
/* Summary
This function is used to read a Tuple from the SDIO CIS area.

View File

@ -43,7 +43,7 @@ typedef void (*cy_as_storage_callback_dep)(
cy_as_oper_type op,
/* The error status */
cy_as_return_status_t status
) ;
);
typedef void (*cy_as_storage_event_callback_dep)(
/* Handle to the device sending the event notification */
@ -54,27 +54,27 @@ typedef void (*cy_as_storage_event_callback_dep)(
cy_as_storage_event evtype,
/* Event related data */
void *evdata
) ;
);
typedef struct cy_as_storage_query_device_data_dep {
/* The type of media to query */
cy_as_media_type type ;
cy_as_media_type type;
/* The logical device number to query */
uint32_t device ;
uint32_t device;
/* The return value for the device descriptor */
cy_as_device_desc desc_p ;
} cy_as_storage_query_device_data_dep ;
cy_as_device_desc desc_p;
} cy_as_storage_query_device_data_dep;
typedef struct cy_as_storage_query_unit_data_dep {
/* The type of media to query */
cy_as_media_type type ;
cy_as_media_type type;
/* The logical device number to query */
uint32_t device ;
uint32_t device;
/* The unit to query on the device */
uint32_t unit ;
uint32_t unit;
/* The return value for the unit descriptor */
cy_as_unit_desc desc_p ;
} cy_as_storage_query_unit_data_dep ;
cy_as_unit_desc desc_p;
} cy_as_storage_query_unit_data_dep;
/************ FUNCTIONS *********************/
@ -85,7 +85,7 @@ cy_as_storage_register_callback_dep(
cy_as_device_handle handle,
/* The callback function to call for async storage events */
cy_as_storage_event_callback_dep callback
) ;
);
EXTERN cy_as_return_status_t
cy_as_storage_claim_dep(cy_as_device_handle handle,
@ -102,7 +102,7 @@ cy_as_storage_claim_dep_EX(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
EXTERN cy_as_return_status_t
cy_as_storage_release_dep(cy_as_device_handle handle,
@ -119,7 +119,7 @@ cy_as_storage_release_dep_EX(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
EXTERN cy_as_return_status_t
cy_as_storage_query_device_dep(
@ -139,7 +139,7 @@ cy_as_storage_query_device_dep_EX(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
EXTERN cy_as_return_status_t
cy_as_storage_query_unit_dep(
@ -153,7 +153,7 @@ cy_as_storage_query_unit_dep(
uint32_t unit,
/* The return value for the unit descriptor */
cy_as_unit_desc *unit_p
) ;
);
EXTERN cy_as_return_status_t
cy_as_storage_query_unit_dep_EX(
@ -165,7 +165,7 @@ cy_as_storage_query_unit_dep_EX(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
EXTERN cy_as_return_status_t
cy_as_storage_device_control_dep(
@ -179,7 +179,7 @@ cy_as_storage_device_control_dep(
cy_as_function_callback cb,
/* Client data to be passed to the callback */
uint32_t client
) ;
);
EXTERN cy_as_return_status_t
@ -198,7 +198,7 @@ cy_as_storage_read_dep(
void *data_p,
/* The number of blocks to be read */
uint16_t num_blocks
) ;
);
EXTERN cy_as_return_status_t
cy_as_storage_read_async_dep(
@ -219,7 +219,7 @@ cy_as_storage_read_async_dep(
/* The function to call when the read is complete
or an error occurs */
cy_as_storage_callback_dep callback
) ;
);
EXTERN cy_as_return_status_t
cy_as_storage_write_dep(
/* Handle to the device of interest */
@ -236,7 +236,7 @@ cy_as_storage_write_dep(
void *data_p,
/* The number of blocks to be written */
uint16_t num_blocks
) ;
);
EXTERN cy_as_return_status_t
cy_as_storage_write_async_dep(
@ -257,7 +257,7 @@ cy_as_storage_write_async_dep(
/* The function to call when the write is complete
or an error occurs */
cy_as_storage_callback_dep callback
) ;
);
EXTERN cy_as_return_status_t
cy_as_storage_sd_register_read_dep(
@ -285,7 +285,7 @@ cy_as_storage_sd_register_read_dep_EX(
cy_as_function_callback cb,
/* Call context to send to the cb function. */
uint32_t client
) ;
);
EXTERN cy_as_return_status_t
cy_as_storage_create_p_partition_dep(
@ -294,7 +294,7 @@ cy_as_storage_create_p_partition_dep(
uint32_t device,
uint32_t size,
cy_as_function_callback cb,
uint32_t client) ;
uint32_t client);
EXTERN cy_as_return_status_t
cy_as_storage_remove_p_partition_dep(
@ -302,7 +302,7 @@ cy_as_storage_remove_p_partition_dep(
cy_as_media_type media,
uint32_t device,
cy_as_function_callback cb,
uint32_t client) ;
uint32_t client);
#endif /*__doxygen*/

View File

@ -44,18 +44,18 @@ typedef void *LPVOID;
/* Summary
This type represents an endpoint number
*/
typedef uint8_t cy_as_end_point_number_t ;
typedef uint8_t cy_as_end_point_number_t;
/* Summary
This type is used to return status information from
an API call.
*/
typedef uint16_t cy_as_return_status_t ;
typedef uint16_t cy_as_return_status_t;
/* Summary
This type represents a bus number
*/
typedef uint32_t cy_as_bus_number_t ;
typedef uint32_t cy_as_bus_number_t;
/* Summary
All APIs provided with this release are marked extern

View File

@ -213,21 +213,21 @@
*/
typedef struct cy_as_usb_inquiry_data {
/* The bus for the event */
cy_as_bus_number_t bus ;
cy_as_bus_number_t bus;
/* The device the event */
uint32_t device ;
uint32_t device;
/* The EVPD bit from the SCSI INQUIRY request */
uint8_t evpd ;
uint8_t evpd;
/* The codepage in the inquiry request */
uint8_t codepage ;
uint8_t codepage;
/* This bool must be set to CyTrue indicate that the inquiry
data was changed */
cy_bool updated ;
cy_bool updated;
/* The length of the data */
uint16_t length ;
uint16_t length;
/* The inquiry data */
void *data ;
} cy_as_usb_inquiry_data ;
void *data;
} cy_as_usb_inquiry_data;
/* Summary
@ -260,23 +260,23 @@ typedef struct cy_as_usb_inquiry_data {
*/
typedef struct cy_as_usb_unknown_command_data {
/* The bus for the event */
cy_as_bus_number_t bus ;
cy_as_bus_number_t bus;
/* The device for the event */
uint32_t device ;
uint32_t device;
uint16_t reqlen ;
uint16_t reqlen;
/* The request */
void *request ;
void *request;
/* The returned status value for the command */
uint8_t status ;
uint8_t status;
/* If status is failed, the sense key */
uint8_t key ;
uint8_t key;
/* If status is failed, the additional sense code */
uint8_t asc ;
uint8_t asc;
/* If status if failed, the additional sense code qualifier */
uint8_t ascq ;
} cy_as_usb_unknown_command_data ;
uint8_t ascq;
} cy_as_usb_unknown_command_data;
/* Summary
@ -293,14 +293,14 @@ typedef struct cy_as_usb_unknown_command_data {
*/
typedef struct cy_as_usb_start_stop_data {
/* The bus for the event */
cy_as_bus_number_t bus ;
cy_as_bus_number_t bus;
/* The device for the event */
uint32_t device ;
uint32_t device;
/* CyTrue means start request, CyFalse means stop request */
cy_bool start ;
cy_bool start;
/* CyTrue means LoEj bit set, otherwise false */
cy_bool loej ;
} cy_as_usb_start_stop_data ;
cy_bool loej;
} cy_as_usb_start_stop_data;
/* Summary
This data type is used to indicate which mass storage devices
@ -317,7 +317,7 @@ typedef enum cy_as_usb_mass_storage_enum {
cy_as_usb_sd_enum = 0x02,
cy_as_usb_mmc_enum = 0x04,
cy_as_usb_ce_ata_enum = 0x08
} cy_as_usb_mass_storage_enum ;
} cy_as_usb_mass_storage_enum;
/* Summary
This data type specifies the type of descriptor to transfer
@ -349,7 +349,7 @@ typedef enum cy_as_usb_desc_type {
* See USB 2.0 specification Chapter 9 */
cy_as_usb_desc_h_s_configuration = 4,
cy_as_usb_desc_string = 5
} cy_as_usb_desc_type ;
} cy_as_usb_desc_type;
/* Summary
This type specifies the direction of an endpoint
@ -371,7 +371,7 @@ typedef enum cy_as_usb_end_point_dir {
cy_as_usb_out = 1,
/* The endpoint direction is IN/OUT (valid only for EP 0 & 1) */
cy_as_usb_in_out = 2
} cy_as_usb_end_point_dir ;
} cy_as_usb_end_point_dir;
/* Summary
This type specifies the type of an endpoint
@ -390,7 +390,7 @@ typedef enum cy_as_usb_end_point_type {
cy_as_usb_iso,
cy_as_usb_bulk,
cy_as_usb_int
} cy_as_usb_end_point_type ;
} cy_as_usb_end_point_type;
/* Summary
This type is a structure used to indicate the top level
@ -418,20 +418,20 @@ typedef struct cy_as_usb_enum_control {
* is false the P port controls enumeration. if the P port
* is controlling enumeration, traffic will be received via
* endpoint zero. */
cy_bool antioch_enumeration ;
cy_bool antioch_enumeration;
/* This is the interface # to use for the mass storage
* interface, if mass storage is enumerated. if mass
* storage is not enumerated this value should be zero. */
uint8_t mass_storage_interface ;
uint8_t mass_storage_interface;
/* This is the interface # to use for the MTP interface,
* if MTP is enumerated. if MTP is not enumerated
* this value should be zero. */
uint8_t mtp_interface ;
uint8_t mtp_interface;
/* If true, Inquiry, START/STOP, and unknown mass storage
* requests cause a callback to occur for handling by the
* baseband processor. */
cy_bool mass_storage_callbacks ;
} cy_as_usb_enum_control ;
cy_bool mass_storage_callbacks;
} cy_as_usb_enum_control;
/* Summary
@ -448,16 +448,16 @@ typedef struct cy_as_usb_enum_control {
*/
typedef struct cy_as_usb_end_point_config {
/* If true, this endpoint is enabled */
cy_bool enabled ;
cy_bool enabled;
/* The direction of this endpoint */
cy_as_usb_end_point_dir dir ;
cy_as_usb_end_point_dir dir;
/* The type of endpoint */
cy_as_usb_end_point_type type ;
cy_as_usb_end_point_type type;
/* The physical endpoint #, 1, 2, 3, 4 */
cy_as_end_point_number_t physical ;
cy_as_end_point_number_t physical;
/* The size of the endpoint in bytes */
uint16_t size ;
} cy_as_usb_end_point_config ;
uint16_t size;
} cy_as_usb_end_point_config;
/* Summary
List of partition enumeration combinations that can
@ -484,7 +484,7 @@ typedef enum cy_as_usb_m_s_type_t {
cy_as_usb_m_s_unit1,
/* Enumerate both units */
cy_as_usb_m_s_both
} cy_as_usb_m_s_type_t ;
} cy_as_usb_m_s_type_t;
/* Summary
This type specifies the type of USB event that has occurred
@ -574,7 +574,7 @@ typedef void (*cy_as_usb_event_callback)(
cy_as_usb_event ev,
/* The data assocaited with the event being reported */
void *evdata
) ;
);
/* Summary
@ -602,7 +602,7 @@ typedef void (*cy_as_usb_io_callback)(
void *buffer,
/* The error status of the operation */
cy_as_return_status_t status
) ;
);
/* Summary
This type is the callback function called after asynchronous
@ -621,7 +621,7 @@ typedef void (*cy_as_usb_function_callback)(
cy_as_return_status_t status,
/* A client supplied 32 bit tag */
uint32_t client
) ;
);
/********************************************
@ -668,7 +668,7 @@ cy_as_usb_start(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This function stops the USB stack
@ -713,7 +713,7 @@ cy_as_usb_stop(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This function registers a callback function to be called when an
@ -732,7 +732,7 @@ cy_as_usb_register_callback(
cy_as_device_handle handle,
/* The function to call */
cy_as_usb_event_callback callback
) ;
);
/* Summary
@ -772,7 +772,7 @@ cy_as_usb_connect(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This function disconnects the West Bridge device D+ and D-
@ -811,7 +811,7 @@ cy_as_usb_disconnect(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This function configures the USB stack
@ -848,7 +848,7 @@ cy_as_usb_set_enum_config(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This function retreives the current configuration of
@ -884,7 +884,7 @@ cy_as_usb_get_enum_config(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This function sets the USB descriptor
@ -942,7 +942,7 @@ cy_as_usb_set_descriptor(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This function clears all user descriptors stored
@ -985,7 +985,7 @@ cy_as_usb_clear_descriptors(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This structure contains the descriptor buffer to be
filled by CyAsUsbGetDescriptor API.
@ -1008,7 +1008,7 @@ typedef struct cy_as_get_descriptor_data {
* actually returned. */
uint32_t length;
} cy_as_get_descriptor_data ;
} cy_as_get_descriptor_data;
/* Summary
This function retreives a given descriptor from the
@ -1059,7 +1059,7 @@ cy_as_usb_get_descriptor(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This function sets the configuration of the physical
@ -1123,7 +1123,7 @@ cy_as_usb_set_physical_configuration(
cy_as_device_handle handle,
/* The physical endpoint configuration number */
uint8_t config
) ;
);
/* Summary
This function sets the hardware configuration for a given endpoint
@ -1166,7 +1166,7 @@ cy_as_usb_set_end_point_config(
cy_as_end_point_number_t ep,
/* The configuration information for the endpoint */
cy_as_usb_end_point_config *config_p
) ;
);
/* Summary
This function retreives the hardware configuration for
@ -1205,7 +1205,7 @@ cy_as_usb_get_end_point_config(
/* The return value containing the endpoint config
* information */
cy_as_usb_end_point_config *config_p
) ;
);
/* Summary
This function commits the configuration information that
@ -1251,7 +1251,7 @@ cy_as_usb_commit_config(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This function reads data from a USB endpoint.
@ -1294,7 +1294,7 @@ cy_as_usb_read_data(
uint32_t *dataread,
/* The buffer to hold the data read */
void *data
) ;
);
/* Summary
This function reads data from a USB endpoint
@ -1337,7 +1337,7 @@ cy_as_usb_read_data_async(
void *data,
/* The callback function to call when the data is read */
cy_as_usb_io_callback callback
) ;
);
/* Summary
This function writes data to a USB endpoint
@ -1377,7 +1377,7 @@ cy_as_usb_write_data(
uint32_t dsize,
/* The data buffer */
void *data
) ;
);
/* Summary
This function writes data to a USB endpoint
@ -1421,7 +1421,7 @@ cy_as_usb_write_data_async(
cy_bool spacket,
/* The callback to call when the data is written */
cy_as_usb_io_callback callback
) ;
);
/* Summary
This function aborts an outstanding asynchronous
@ -1453,7 +1453,7 @@ cy_as_usb_cancel_async(
cy_as_device_handle handle,
/* The endpoint of interest */
cy_as_end_point_number_t ep
) ;
);
/* Summary
This function sets a stall condition on a given endpoint
@ -1495,7 +1495,7 @@ cy_as_usb_set_stall(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This function clears a stall condition on a given endpoint
@ -1538,7 +1538,7 @@ cy_as_usb_clear_stall(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
@ -1580,7 +1580,7 @@ cy_as_usb_get_stall(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This function sets a NAK condition on a given endpoint
@ -1622,7 +1622,7 @@ cy_as_usb_set_nak(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This function clears a NAK condition on a given endpoint
@ -1664,7 +1664,7 @@ cy_as_usb_clear_nak(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This function returns the NAK status for a given endpoint
@ -1703,7 +1703,7 @@ cy_as_usb_get_nak(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This function triggers a USB remote wakeup from the Processor
@ -1736,7 +1736,7 @@ cy_as_usb_signal_remote_wakeup(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
This function sets the threshold levels for mass storage progress
@ -1784,7 +1784,7 @@ cy_as_usb_set_m_s_report_threshold(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
/* Summary
Specify which of the partitions on a partitioned mass storage
@ -1846,13 +1846,13 @@ cy_as_usb_select_m_s_partitions(
);
extern cy_as_media_type
cy_as_storage_get_media_from_address(uint16_t v) ;
cy_as_storage_get_media_from_address(uint16_t v);
extern cy_as_bus_number_t
cy_as_storage_get_bus_from_address(uint16_t v) ;
cy_as_storage_get_bus_from_address(uint16_t v);
extern uint32_t
cy_as_storage_get_device_from_address(uint16_t v) ;
cy_as_storage_get_device_from_address(uint16_t v);
/* For supporting deprecated functions */
#include "cyasusb_dep.h"

View File

@ -37,66 +37,66 @@
typedef struct cy_as_usb_inquiry_data_dep {
/* The media for the event */
cy_as_media_type media ;
cy_as_media_type media;
/* The EVPD bit from the SCSI INQUIRY request */
uint8_t evpd ;
uint8_t evpd;
/* The codepage in the inquiry request */
uint8_t codepage ;
uint8_t codepage;
/* This bool must be set to CyTrue indicate
* that the inquiry data was changed */
cy_bool updated ;
cy_bool updated;
/* The length of the data */
uint16_t length ;
uint16_t length;
/* The inquiry data */
void *data ;
} cy_as_usb_inquiry_data_dep ;
void *data;
} cy_as_usb_inquiry_data_dep;
typedef struct cy_as_usb_unknown_command_data_dep {
/* The media for the event */
cy_as_media_type media ;
cy_as_media_type media;
/* The length of the requst (should be 16 bytes) */
uint16_t reqlen ;
uint16_t reqlen;
/* The request */
void *request ;
void *request;
/* The returned status value for the command */
uint8_t status ;
uint8_t status;
/* If status is failed, the sense key */
uint8_t key ;
uint8_t key;
/* If status is failed, the additional sense code */
uint8_t asc ;
uint8_t asc;
/* If status if failed, the additional sense code qualifier */
uint8_t ascq ;
} cy_as_usb_unknown_command_data_dep ;
uint8_t ascq;
} cy_as_usb_unknown_command_data_dep;
typedef struct cy_as_usb_start_stop_data_dep {
/* The media type for the event */
cy_as_media_type media ;
cy_as_media_type media;
/* CyTrue means start request, CyFalse means stop request */
cy_bool start ;
cy_bool start;
/* CyTrue means LoEj bit set, otherwise false */
cy_bool loej ;
} cy_as_usb_start_stop_data_dep ;
cy_bool loej;
} cy_as_usb_start_stop_data_dep;
typedef struct cy_as_usb_enum_control_dep {
/* The bits in this member determine which mass storage devices
are enumerated. see cy_as_usb_mass_storage_enum for more details. */
uint8_t enum_mass_storage ;
uint8_t enum_mass_storage;
/* If true, West Bridge will control enumeration. If this is false the
pport controls enumeration. if the P port is controlling
enumeration, traffic will be received via endpoint zero. */
cy_bool antioch_enumeration ;
cy_bool antioch_enumeration;
/* This is the interface # to use for the mass storage interface,
if mass storage is enumerated. if mass storage is not enumerated
this value should be zero. */
uint8_t mass_storage_interface ;
uint8_t mass_storage_interface;
/* If true, Inquiry, START/STOP, and unknown mass storage
requests cause a callback to occur for handling by the
baseband processor. */
cy_bool mass_storage_callbacks ;
} cy_as_usb_enum_control_dep ;
cy_bool mass_storage_callbacks;
} cy_as_usb_enum_control_dep;
typedef void (*cy_as_usb_event_callback_dep)(
@ -106,7 +106,7 @@ typedef void (*cy_as_usb_event_callback_dep)(
cy_as_usb_event ev,
/* The data assocaited with the event being reported */
void *evdata
) ;
);
@ -117,7 +117,7 @@ cy_as_usb_register_callback_dep(
cy_as_device_handle handle,
/* The function to call */
cy_as_usb_event_callback_dep callback
) ;
);
extern cy_as_return_status_t
@ -130,7 +130,7 @@ cy_as_usb_set_enum_config_dep(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
extern cy_as_return_status_t
@ -143,7 +143,7 @@ cy_as_usb_get_enum_config_dep(
cy_as_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
extern cy_as_return_status_t
cy_as_usb_get_descriptor_dep(
@ -159,7 +159,7 @@ cy_as_usb_get_descriptor_dep(
points to a uint32_t that contains the length of the buffer. after
the call, this value contains the amount of data actually returned. */
uint32_t *length_p
) ;
);
extern cy_as_return_status_t
cy_as_usb_set_stall_dep(
@ -171,7 +171,7 @@ cy_as_usb_set_stall_dep(
cy_as_usb_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
EXTERN cy_as_return_status_t
cy_as_usb_clear_stall_dep(
@ -183,7 +183,7 @@ cy_as_usb_clear_stall_dep(
cy_as_usb_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
EXTERN cy_as_return_status_t
cy_as_usb_set_nak_dep(
@ -195,7 +195,7 @@ cy_as_usb_set_nak_dep(
cy_as_usb_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
EXTERN cy_as_return_status_t
cy_as_usb_clear_nak_dep(
@ -207,7 +207,7 @@ cy_as_usb_clear_nak_dep(
cy_as_usb_function_callback cb,
/* Client supplied data */
uint32_t client
) ;
);
EXTERN cy_as_return_status_t
cy_as_usb_select_m_s_partitions_dep(
@ -217,7 +217,7 @@ cy_as_usb_select_m_s_partitions_dep(
cy_as_usb_m_s_type_t type,
cy_as_function_callback cb,
uint32_t client
) ;
);
#endif /*__doxygen*/