传真a8的启动流程
来源:互联网 发布:王者荣耀 女娲 知乎 编辑:程序博客网 时间:2024/05/29 18:21
apps/c318/device.h
struct t38_param
typedef struct t38_param{/**0 = No T.38 packet loss concealment (default) \n1 = Packet loss concealment enabled, bad lines in page replaced by white lines \n2 = Packet loss concealment enabled, bad lines in page replaced by last good line */int loss_conceal;/*0 = No speed limit (default) 1 = 2400 bps limit 2 = 4800 bps limit 3 = 7200 bps limit 4 = 9600 bps limit 5 = 12000 bps limit 6 = 14400 bps limit */int speed;/* 0 = Redundancy (default), 1 = FEC */int err_method;/* Number of FEC packets to send in UDPTL Range 0 (default) to 3 */int numFEC;/* Number of IFP used to generate a FEC packet Range 0 (default) to 4 */int numIFPs;/* fax data redundacy 0 - 3 ; Default- 0 */int data_redundancy;/* 0 - 7 ; Default- 3 */int t30_redundancy;/* dir: 1 -- 318 ==> outer; 2 -- outer ==> 318; 3 -- 318 <==> outer */int dir;}t38_param_t;int device_channel_t38cfg(int dev, int ch_no, t38_param_t *param);int device_channel_t38enble(int dev, int ch_no, int enable);
apps/c318/device.c
device_channel_t38cfg
int device_channel_t38cfg(int dev, int ch_no, t38_param_t *param){struct device_operation *ops = device_ops[dev];if(dev <= DEV_TYPE_UNKOWN || dev >= DEV_TYPE_MAX){printf("error dev dev %d\n", dev);return -1;}return ops->ch_t38cfg(ch_no, param);}
device_channel_t38enble
int device_channel_t38enble(int dev, int ch_no, int enable){struct device_operation *ops = device_ops[dev];if(dev <= DEV_TYPE_UNKOWN || dev >= DEV_TYPE_MAX){printf("error dev dev %d\n", dev);return -1;}return ops->ch_t38en(ch_no, enable);}
device_register
void device_register(int dev, struct device_operation *ops){ if(dev <= DEV_TYPE_UNKOWN || dev >= DEV_TYPE_MAX){ printf("error dev dev %d\n", dev); return; } device_ops[dev] = ops;}
device_soc318.c
comcerto_ops
static struct device_operation comcerto_ops ={.dev_init = comcerto_device_init,.dev_exit = comcerto_device_exit,.dev_cfg = comcerto_device_cfg,.dev_raw = comcerto_device_raw,.ch_init = comcerto_channel_init,.ch_exit = comcerto_channel_exit,.ch_stat = comcerto_channel_stat,.ch_shutdown = comcerto_channel_shutdown,.ch_ioctl = comcerto_channel_ioctl,.ch_t38cfg = comcerto_channel_t38cfg,.ch_t38en = comcerto_channel_t38en,.ch_link = comcerto_channel_link,.ch_loopback = comcerto_channel_loopback,};
comcerto_register
static void __attribute__((constructor)) comcerto_register(void){device_register(DEV_TYPE_SOC318, &comcerto_ops);}
comcerto_channel_t38cfg
static int comcerto_channel_t38cfg(int ch_no, t38_param_t *param){ unsigned int *pdata = (unsigned int*)BUF_TO_PARAM(); *pdata++ = htonl(ch_no); *pdata++ = htonl(param->loss_conceal); *pdata++ = htonl(param->speed); *pdata++ = htonl(param->err_method); *pdata++ = htonl(param->numFEC); *pdata++ = htonl(param->numIFPs); *pdata++ = htonl(param->data_redundancy); *pdata++ = htonl(param->t30_redundancy); *pdata++ = htonl(param->dir); return comcerto_contact(CMD_CHANNEL_T38CFG, sizeof(*pdata) * 9);}
comcerto_channel_t38en
static int comcerto_channel_t38en(int ch_no, int enable){ unsigned int *pstat = (unsigned int*)BUF_TO_PARAM(); *pstat++ = htonl(ch_no); *pstat++ = enable; return comcerto_contact(CMD_CHANNEL_T38EN, sizeof(*pstat) * 2);}
comcerto_contact
static int comcerto_contact(uint32_t cmd, int len){#if 0 struct timeval start, stop; int diff; gettimeofday(&start);#endif com_cmd = cmd; com_buf_len = comcerto_init_head(cmd, com_buf, len); comcerto_lock_wait();#if 0 gettimeofday(&stop); diff = stop.tv_sec - start.tv_sec; diff *= 1000000; diff += stop.tv_usec - start.tv_usec; printf("time diff %dus\n", diff);#endif return com_ret;}
comcerto_init_head
static int comcerto_init_head(int cmd, void *buf, int len){ struct head *head = (struct head *)buf; head->magic = htonl(CMD_MAGIC); head->version = htonl(CMD_VERSION); head->cmd = htonl(cmd); head->seq = htonl(cmd_seq++); head->len = htonl(len); return len + sizeof(*head);}
comcerto_lock_wait
static void comcerto_lock_wait(void){ write(comcerto_pipe[1], "w", 1); sem_wait(&sem_notify);}
comcerto_lock_init
static int comcerto_lock_init(void){ if(pipe(comcerto_pipe)){ return -1; } sem_init(&sem_notify, 0, 0); return 0; }
0 0
- 传真a8的启动流程
- 传真发送的318配置和启动的流程
- 【学习总结】ARM cotex-a8 下 u-boot启动流程
- 传真通讯技术的革新:IP传真
- 华清远见ARM A8 Uboot流程
- Eclipse的启动流程
- RHEL5的启动流程
- Linux的启动流程
- 系统的启动流程
- redboot的启动流程
- Activity的启动流程
- Android 的启动流程
- Linux的启动流程
- linux的启动流程
- android启动的流程
- WINDOWS的启动流程
- WINDOWS的启动流程
- Android 的启动流程
- 使用eclipse插件mybatis generator来生成文件代码
- 解决Android Studio 的 Alt 快捷键和Mac自带的Alt转换功能冲突
- Android 自定义的CheckBox
- Linux线程同步(条件变量和信号量)
- 运维人员应该掌握哪些常用技术
- 传真a8的启动流程
- 关于mysql上万条数据同时插入时的性能优化
- Laravel如何与App通信(针对get与post)
- C# Datatable排序重新排序
- 值得推荐的C/C++框架和库
- 优化UITableViewCell高度计算的那些事
- CCFlow新版本的自由流程、自定义流程功能说明
- iOS UITableView 修改 分区表头的样式和颜色
- 利用ApachePOI输出Excel文件