本文整理汇总了C++中IX25DEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ IX25DEBUG函数的具体用法?C++ IX25DEBUG怎么用?C++ IX25DEBUG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IX25DEBUG函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: isdn_x25iface_disconn_ind
/* a disconnect is indicated by lower layer
*/
static int isdn_x25iface_disconn_ind(struct concap_proto *cprot)
{
struct sk_buff *skb;
enum wan_states *state_p
= &( ( (ix25_pdata_t*) (cprot->proto_data) ) -> state);
IX25DEBUG( "isdn_x25iface_disconn_ind %s \n", MY_DEVNAME(cprot -> net_dev) );
if( *state_p == WAN_UNCONFIGURED ){
printk(KERN_WARNING
"isdn_x25iface_disconn_ind while unconfigured\n");
return -1;
}
if(! cprot -> net_dev) return -1;
*state_p = WAN_DISCONNECTED;
skb = dev_alloc_skb(1);
if( skb ){
*( skb_put(skb, 1) ) = 0x02;
skb->protocol = x25_type_trans(skb, cprot->net_dev);
netif_rx(skb);
return 0;
} else {
printk(KERN_WARNING "isdn_x25iface_disconn_ind:"
" out of memory\n");
return -1;
}
}
开发者ID:robacklin,项目名称:ts7800,代码行数:27,代码来源:isdn_x25iface.c
示例2: isdn_x25iface_proto_restart
/* (re-)initialize the data structures for x25iface encapsulation
*/
static int isdn_x25iface_proto_restart(struct concap_proto *cprot,
struct net_device *ndev,
struct concap_device_ops *dops)
{
ix25_pdata_t * pda = cprot -> proto_data ;
ulong flags;
IX25DEBUG( "isdn_x25iface_proto_restart %s \n", MY_DEVNAME(ndev) );
if ( pdata_is_bad( pda ) ) return -1;
if( !( dops && dops -> data_req && dops -> connect_req
&& dops -> disconn_req ) ){
printk( KERN_WARNING "isdn_x25iface_restart: required dops"
" missing\n" );
isdn_x25iface_proto_close(cprot);
return -1;
}
spin_lock_irqsave(&cprot->lock, flags);
cprot -> net_dev = ndev;
cprot -> pops = &ix25_pops;
cprot -> dops = dops;
pda -> state = WAN_DISCONNECTED;
spin_unlock_irqrestore(&cprot->lock, flags);
return 0;
}
开发者ID:robacklin,项目名称:ts7800,代码行数:28,代码来源:isdn_x25iface.c
示例3: isdn_x25iface_proto_del
/* Delete the x25iface encapsulation protocol instance
*/
static void isdn_x25iface_proto_del(struct concap_proto *cprot){
ix25_pdata_t * tmp;
IX25DEBUG( "isdn_x25iface_proto_del \n" );
if( ! cprot ){
printk( KERN_ERR "isdn_x25iface_proto_del: "
"concap_proto pointer is NULL\n" );
return;
}
tmp = cprot -> proto_data;
if( tmp == NULL ){
printk( KERN_ERR "isdn_x25iface_proto_del: inconsistent "
"proto_data pointer (maybe already deleted?)\n");
return;
}
/* close if the protocol is still open */
if( cprot -> dops ) isdn_x25iface_proto_close(cprot);
/* freeing the storage should be sufficient now. But some additional
settings might help to catch wild pointer bugs */
tmp -> magic = 0;
cprot -> proto_data = NULL;
kfree( tmp );
return;
}
开发者ID:robacklin,项目名称:ts7800,代码行数:28,代码来源:isdn_x25iface.c
示例4: isdn_x25iface_connect_ind
/* a connection set up is indicated by lower layer
*/
int isdn_x25iface_connect_ind(struct concap_proto *cprot)
{
struct sk_buff * skb = dev_alloc_skb(1);
enum wan_states *state_p
= &( ( (ix25_pdata_t*) (cprot->proto_data) ) -> state);
IX25DEBUG( "isdn_x25iface_connect_ind %s \n"
, MY_DEVNAME(cprot->net_dev) );
if( *state_p == WAN_UNCONFIGURED ){
printk(KERN_WARNING
"isdn_x25iface_connect_ind while unconfigured %s\n"
, MY_DEVNAME(cprot->net_dev) );
return -1;
}
*state_p = WAN_CONNECTED;
if( skb ){
*( skb_put(skb, 1) ) = 0x01;
skb -> mac.raw = skb -> data;
skb -> dev = cprot -> net_dev;
skb -> protocol = htons(ETH_P_X25);
skb -> pkt_type = PACKET_HOST;
netif_rx(skb);
return 0;
} else {
printk(KERN_WARNING "isdn_x25iface_connect_ind: "
" out of memory -- disconnecting\n");
cprot -> dops -> disconn_req(cprot);
return -1;
}
}
开发者ID:earthGavinLee,项目名称:hg556a_source,代码行数:31,代码来源:isdn_x25iface.c
示例5: isdn_concap_dl_disconn_req
static int
isdn_concap_dl_disconn_req(struct concap_proto *concap)
{
IX25DEBUG( "isdn_concap_dl_disconn_req: %s \n", concap -> net_dev -> name);
isdn_net_hangup( concap -> net_dev );
return 0;
}
开发者ID:xricson,项目名称:knoppix,代码行数:8,代码来源:isdn_concap.c
示例6: isdn_x25iface_xmit
static int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb)
{
unsigned char firstbyte = skb->data[0];
enum wan_states *state = &((ix25_pdata_t *)cprot->proto_data)->state;
int ret = 0;
IX25DEBUG("isdn_x25iface_xmit: %s first=%x state=%d\n",
MY_DEVNAME(cprot->net_dev), firstbyte, *state);
switch (firstbyte) {
case X25_IFACE_DATA:
if (*state == WAN_CONNECTED) {
skb_pull(skb, 1);
cprot->net_dev->trans_start = jiffies;
ret = (cprot->dops->data_req(cprot, skb));
if (ret) skb_push(skb, 1);
return ret;
}
illegal_state_warn(*state, firstbyte);
break;
case X25_IFACE_CONNECT:
if (*state == WAN_DISCONNECTED) {
*state = WAN_CONNECTING;
ret = cprot->dops->connect_req(cprot);
if (ret) {
isdn_x25iface_disconn_ind(cprot);
}
} else {
illegal_state_warn(*state, firstbyte);
}
break;
case X25_IFACE_DISCONNECT:
switch (*state) {
case WAN_DISCONNECTED:
printk(KERN_WARNING "isdn_x25iface_xmit: disconnect "
" requested while disconnected\n");
isdn_x25iface_disconn_ind(cprot);
break;
case WAN_CONNECTING:
case WAN_CONNECTED:
*state = WAN_DISCONNECTED;
cprot->dops->disconn_req(cprot);
break;
default:
illegal_state_warn(*state, firstbyte);
}
break;
case X25_IFACE_PARAMS:
printk(KERN_WARNING "isdn_x25iface_xmit: setting of lapb"
" options not yet supported\n");
break;
default:
printk(KERN_WARNING "isdn_x25iface_xmit: frame with illegal"
" first byte %x ignored:\n", firstbyte);
}
dev_kfree_skb(skb);
return 0;
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:57,代码来源:isdn_x25iface.c
示例7: kmalloc
struct concap_proto *isdn_x25iface_proto_new(void)
{
ix25_pdata_t *tmp = kmalloc(sizeof(ix25_pdata_t), GFP_KERNEL);
IX25DEBUG("isdn_x25iface_proto_new\n");
if (tmp) {
tmp->magic = ISDN_X25IFACE_MAGIC;
tmp->state = WAN_UNCONFIGURED;
spin_lock_init(&tmp->priv.lock);
tmp->priv.dops = NULL;
tmp->priv.net_dev = NULL;
tmp->priv.pops = &ix25_pops;
tmp->priv.flags = 0;
tmp->priv.proto_data = tmp;
return (&(tmp->priv));
}
return NULL;
};
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:17,代码来源:isdn_x25iface.c
示例8: isdn_x25iface_proto_new
/* create a new x25 interface protocol instance
*/
struct concap_proto * isdn_x25iface_proto_new()
{
ix25_pdata_t * tmp = kmalloc(sizeof(ix25_pdata_t),GFP_KERNEL);
IX25DEBUG("isdn_x25iface_proto_new\n");
if( tmp ){
tmp -> magic = ISDN_X25IFACE_MAGIC;
tmp -> state = WAN_UNCONFIGURED;
/* private data space used to hold the concap_proto data.
Only to be accessed via the returned pointer */
tmp -> priv.dops = NULL;
tmp -> priv.net_dev = NULL;
tmp -> priv.pops = &ix25_pops;
tmp -> priv.flags = 0;
tmp -> priv.proto_data = tmp;
return( &(tmp -> priv) );
}
return NULL;
};
开发者ID:cilynx,项目名称:dd-wrt,代码行数:20,代码来源:isdn_x25iface.c
示例9: isdn_x25iface_receive
/* deliver a dl_data frame received from i4l HL driver to the network layer
*/
int isdn_x25iface_receive(struct concap_proto *cprot, struct sk_buff *skb)
{
IX25DEBUG( "isdn_x25iface_receive %s \n", MY_DEVNAME(cprot->net_dev) );
if ( ( (ix25_pdata_t*) (cprot->proto_data) )
-> state == WAN_CONNECTED ){
skb -> dev = cprot -> net_dev;
skb -> protocol = htons(ETH_P_X25);
skb -> pkt_type = PACKET_HOST;
if( skb_push(skb, 1)){
skb -> data[0]=0x00;
skb -> mac.raw = skb -> data;
netif_rx(skb);
return 0;
}
}
printk(KERN_WARNING "isdn_x25iface_receive %s: not connected, skb dropped\n", MY_DEVNAME(cprot->net_dev) );
dev_kfree_skb(skb);
return -1;
}
开发者ID:cilynx,项目名称:dd-wrt,代码行数:21,代码来源:isdn_x25iface.c
示例10: isdn_x25iface_proto_del
static void isdn_x25iface_proto_del(struct concap_proto *cprot) {
ix25_pdata_t *tmp;
IX25DEBUG("isdn_x25iface_proto_del \n");
if (!cprot) {
printk(KERN_ERR "isdn_x25iface_proto_del: "
"concap_proto pointer is NULL\n");
return;
}
tmp = cprot->proto_data;
if (tmp == NULL) {
printk(KERN_ERR "isdn_x25iface_proto_del: inconsistent "
"proto_data pointer (maybe already deleted?)\n");
return;
}
if (cprot->dops) isdn_x25iface_proto_close(cprot);
tmp->magic = 0;
cprot->proto_data = NULL;
kfree(tmp);
return;
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:24,代码来源:isdn_x25iface.c
注:本文中的IX25DEBUG函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论