本文整理汇总了C++中DEV_FUNC函数的典型用法代码示例。如果您正苦于以下问题:C++ DEV_FUNC函数的具体用法?C++ DEV_FUNC怎么用?C++ DEV_FUNC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DEV_FUNC函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pciio_endian_set
/*
* Specify endianness constraints. The driver tells us what the device
* does and how it would like to see things in memory. We reply with
* how things will actually appear in memory.
*/
pciio_endian_t
pciio_endian_set(devfs_handle_t dev,
pciio_endian_t device_end,
pciio_endian_t desired_end)
{
ASSERT((device_end == PCIDMA_ENDIAN_BIG) || (device_end == PCIDMA_ENDIAN_LITTLE));
ASSERT((desired_end == PCIDMA_ENDIAN_BIG) || (desired_end == PCIDMA_ENDIAN_LITTLE));
#if DEBUG
#if defined(SUPPORT_PRINTING_V_FORMAT)
PRINT_ALERT("%v: pciio_endian_set is going away.\n"
"\tplease use PCIIO_BYTE_STREAM or PCIIO_WORD_VALUES in your\n"
"\tpciio_dmamap_alloc and pciio_dmatrans calls instead.\n",
dev);
#else
PRINT_ALERT("0x%x: pciio_endian_set is going away.\n"
"\tplease use PCIIO_BYTE_STREAM or PCIIO_WORD_VALUES in your\n"
"\tpciio_dmamap_alloc and pciio_dmatrans calls instead.\n",
dev);
#endif
#endif
return DEV_FUNC(dev, endian_set)
(dev, device_end, desired_end);
}
示例2: pciio_error_devenable
int
pciio_error_devenable(devfs_handle_t pconn_vhdl, int error_code)
{
return DEV_FUNC(pconn_vhdl, error_devenable)
(pconn_vhdl, error_code);
/* no cleanup specific to this layer. */
}
示例3: rkusb_get_symbol
static int rkusb_get_symbol( struct rkusb_dev *dev )
{
switch ( DEV_FUNC(dev) ) {
case FUNC_GSYM_KERNEL:
return rkusb_get_kernel_symbols( dev );
case FUNC_GSYM_GETTASKS:
return rksub_get_sym_tasks( dev );
case FUNC_GSYM_GETTASKVM:
return rkusb_get_task_mm( dev );
case FUNC_GSYM_PROFILE:
{
char * buf = __rkusb_rwbuffer_start(dev);
PROFILE_INFO pe;
pe.size = sizeof( pe );
pe.npc = profile_check( buf );
pe.buf = (unsigned long)buf;
pe.now = ktime_to_ns( ktime_get() );
rk28printk("%s::profile n=%ld\n" , __func__ , pe.npc );
rkusb_normal_data_xfer_onetime( dev , &pe );
return 0;
}
default:
break;
}
return RKUSB_CB_FAILD;
}
示例4: vflash_block_isbad
static int vflash_block_isbad(int partition, int offset)
{
ItcRpcMsg req;
int ret;
// Construct a request message
memset((void *)&req, 0, sizeof(req));
req.dev_func = DEV_FUNC(REMOTE_FLASH_DEVICE_ID, REMOTE_BLOCK_ISBAD, partition, 0);
req.xid = read_c0_count();
req.u0 = 0;
req.u1 = offset;
#if DEBUG_DQM_IO
printk("%s partition %d offset %08x\n", __func__, partition, offset);
#endif
ret = do_rpc_io(&req);
#if 0
if(ret == 1)
{
printk("Bad Block at %08x\n", (unsigned int)offset);
}
#endif
return ret;
}
示例5: pciio_config_get
/*
* Read value of configuration register
*/
uint64_t
pciio_config_get(devfs_handle_t dev,
unsigned reg,
unsigned size)
{
uint64_t value = 0;
unsigned shift = 0;
/* handle accesses that cross words here,
* since that's common code between all
* possible providers.
*/
while (size > 0) {
unsigned biw = 4 - (reg&3);
if (biw > size)
biw = size;
value |= DEV_FUNC(dev, config_get)
(dev, reg, biw) << shift;
shift += 8*biw;
reg += biw;
size -= biw;
}
return value;
}
示例6: xtalk_intr_alloc_nothd
/*
* Allocate resources required for an interrupt as specified in dev_desc.
* Unconditionally setup resources to be non-threaded.
* Return resource handle in intr_hdl.
*/
xtalk_intr_t
xtalk_intr_alloc_nothd(vertex_hdl_t dev, /* which Crosstalk device */
device_desc_t dev_desc, /* device descriptor */
vertex_hdl_t owner_dev) /* owner of this interrupt */
{
return (xtalk_intr_t) DEV_FUNC(dev, intr_alloc_nothd)
(dev, dev_desc, owner_dev);
}
示例7: pciio_error_extract
/* =====================================================================
* GENERIC PCI SUPPORT FUNCTIONS
*/
pciio_slot_t
pciio_error_extract(devfs_handle_t dev,
pciio_space_t *space,
iopaddr_t *offset)
{
ASSERT(dev != NODEV);
return DEV_FUNC(dev,error_extract)(dev,space,offset);
}
示例8: rkusb_read_log
static int rkusb_read_log( struct rkusb_dev *dev )
{
switch ( DEV_FUNC(dev) ) {
case FUNC_LOG_GETLUNS: /* first int:luns , next int:sizeof log_buffer */
{
int num_size[2];
check_xtranfs_len( 8 );
num_size[0] = dev->luns;
num_size[1] = sizeof(struct log_buffer );
rkusb_normal_data_xfer_onetime( dev , num_size );
}
return 0;
case FUNC_LOG_GETSTRUCT: /* report all log info */
{
// check_xtranfs_len( sizeof dev->log ); sizeof dev->log may change.
if( !check_log_valid( dev ) )
break;
rkusb_normal_data_xfer_onetime( dev , dev->log );
}
return 0;
case FUNC_LOG_INIT:
{
int i = DEV_LUN( dev );
#if (LOG_NUM>2)
static int rkusb_shell_initlog( struct log_buffer *p );
if( i == LUN_SHELL ) {
if( rkusb_shell_initlog( &dev->log[i] ) ) {
return RKUSB_CB_FAILD_CSW;
}
}
#endif
dev->log[i].getlog(&dev->log[i].va_start , &dev->log[i].offset , &dev->log[i].total_len);
}
return RKUSB_CB_OK_CSW;
case FUNC_LOG_UNINIT:
{
if( DEV_LUN(dev) == LUN_SHELL ){
dev->log[DEV_LUN(dev)].property &= ~LOG_PROT_MAYWRITE;
}
}
return RKUSB_CB_OK_CSW;
case FUNC_LOG_OFFLEN: /* read new log info , first int=start offset , next int=len */
{
int offset_len[2];
if( !check_log_valid( dev ) )
break;
check_xtranfs_len( 8 );
dev->log[DEV_LUN(dev)].getlog_start_length( &dev->log[DEV_LUN(dev)].offset , &dev->log[DEV_LUN(dev)].len );
offset_len[0] = dev->log[DEV_LUN(dev)].offset;
offset_len[1] = dev->log[DEV_LUN(dev)].len;
rkusb_normal_data_xfer_onetime( dev , offset_len );
}
return 0;
default:
break;
}
return -1;
}
示例9: pciio_piospace_free
void
pciio_piospace_free(devfs_handle_t dev, /* Device freeing space */
pciio_space_t space, /* Type of space */
iopaddr_t pciaddr, /* starting address */
size_t byte_count)
{ /* Range of address */
DEV_FUNC(dev, piospace_free)
(dev, space, pciaddr, byte_count);
}
示例10: pciio_priority_set
/*
* Specify PCI arbitration priority.
*/
pciio_priority_t
pciio_priority_set(devfs_handle_t dev,
pciio_priority_t device_prio)
{
ASSERT((device_prio == PCI_PRIO_HIGH) || (device_prio == PCI_PRIO_LOW));
return DEV_FUNC(dev, priority_set)
(dev, device_prio);
}
示例11: pciio_intr_alloc
/*
* Allocate resources required for an interrupt as specified in intr_desc.
* Return resource handle in intr_hdl.
*/
pciio_intr_t
pciio_intr_alloc(devfs_handle_t dev, /* which Crosstalk device */
device_desc_t dev_desc, /* device descriptor */
pciio_intr_line_t lines, /* INTR line(s) to attach */
devfs_handle_t owner_dev)
{ /* owner of this interrupt */
return (pciio_intr_t) DEV_FUNC(dev, intr_alloc)
(dev, dev_desc, lines, owner_dev);
}
示例12: pciio_priority_set
/*
* Specify PCI arbitration priority.
*/
pciio_priority_t
pciio_priority_set(vertex_hdl_t dev,
pciio_priority_t device_prio)
{
ASSERT((device_prio == PCI_PRIO_HIGH) || (device_prio == PCI_PRIO_LOW));
return DEV_FUNC(dev, priority_set)
(dev, device_prio);
}
示例13: vflash_read_buf
/*******************************************************************
* vflash_read_buf:
* create a request message and send it via do_rpc_io
* do_rpc_io waits for response or timeout
******************************************************************/
static int vflash_read_buf(int partition, int offset,
u_char *buffer, int numbytes)
{
ItcRpcMsg req;
u_char *vmallocated_buf = NULL;
int ret, is_buf_vmallocated;
#if defined(CONFIG_MTD_BRCMNAND)
uint8 * ecc_buf;
uint8 * data_buf;
#endif
/* VMallocated (mmu translated) memory can't be used by the eCos CPU */
is_buf_vmallocated = KSEGX(buffer) == KSEG2;
if (is_buf_vmallocated)
{
vmallocated_buf = buffer;
buffer = kmalloc(numbytes, GFP_KERNEL);
if (!buffer)
return -EINVAL;
}
// Construct a request message
memset((void *)&req, 0, sizeof(req));
req.dev_func = DEV_FUNC(REMOTE_FLASH_DEVICE_ID, REMOTE_READ, partition, numbytes);
req.xid = read_c0_count();
req.u0 = (uint32)buffer;
req.u1 = offset;
#if !defined(CONFIG_MTD_BRCMNAND)
bcm_cache_inv((uint32)buffer, (uint32)numbytes);
#else
data_buf = (uint8 *)(((BufArray *)buffer)->data_buf);
if(data_buf) {
bcm_cache_inv((uint32)data_buf, (uint32)numbytes);
}
ecc_buf = (uint8 *)(((BufArray *)buffer)->ecc_stat_buf);
if(ecc_buf) {
bcm_cache_inv((uint32)ecc_buf, (uint32)ecc_stat_buf_len);
}
bcm_cache_wback_inv((uint32)buffer, (uint32)sizeof(BufArray));
#endif
#if DEBUG_DQM_IO
printk("%s partition %d offset %08x buffer %p size %d\n",
__func__, partition, offset, buffer, numbytes);
#endif
ret = do_rpc_io(&req);
if (is_buf_vmallocated)
{
memcpy(vmallocated_buf, buffer, numbytes);
kfree(buffer);
}
return ret;
}
示例14: pciio_dmamap_alloc
pciio_dmamap_t
pciio_dmamap_alloc(devfs_handle_t dev, /* set up mappings for this device */
device_desc_t dev_desc, /* device descriptor */
size_t byte_count_max, /* max size of a mapping */
unsigned flags)
{ /* defined in dma.h */
return (pciio_dmamap_t) DEV_FUNC(dev, dmamap_alloc)
(dev, dev_desc, byte_count_max, flags);
}
示例15: pciio_dmatrans_list
alenlist_t
pciio_dmatrans_list(devfs_handle_t dev, /* translate for this device */
device_desc_t dev_desc, /* device descriptor */
alenlist_t palenlist, /* system address/length list */
unsigned flags)
{ /* defined in dma.h */
return DEV_FUNC(dev, dmatrans_list)
(dev, dev_desc, palenlist, flags);
}