Example #1
0
static void hycapi_release_internal(struct capi_ctr *ctrl, __u16 appl)
{
	hycapictrl_info *cinfo = (hycapictrl_info *)(ctrl->driverdata);
	hysdn_card *card = cinfo->card;
	struct sk_buff *skb;
	__u16 len;
	__u8 _command = 0xa1, _subcommand = 0x80;
	__u16 MessageNumber = 0x0000;

	capilib_release_appl(&cinfo->ncci_head, appl);

#ifdef HYCAPI_PRINTFNAMES
	printk(KERN_NOTICE "hycapi_release_appl\n");
#endif
	len = CAPI_MSG_BASELEN;
	if (!(skb = alloc_skb(len, GFP_ATOMIC))) {
		printk(KERN_ERR "HYSDN card%d: memory squeeze in hycapi_register_appl\n",
		       card->myid);
		return;
	}
	memcpy(skb_put(skb, sizeof(__u16)), &len, sizeof(__u16));
	memcpy(skb_put(skb, sizeof(__u16)), &appl, sizeof(__u16));
	memcpy(skb_put(skb, sizeof(__u8)), &_command, sizeof(_command));
	memcpy(skb_put(skb, sizeof(__u8)), &_subcommand, sizeof(_subcommand));
	memcpy(skb_put(skb, sizeof(__u16)), &MessageNumber, sizeof(__u16));
	hycapi_send_message(ctrl, skb);
	hycapi_applications[appl - 1].ctrl_mask &= ~(1 << (ctrl->cnr - 1));
}
Example #2
0
static void 
hycapi_register_internal(struct capi_ctr *ctrl, __u16 appl,
			 capi_register_params *rp)
{
	char ExtFeatureDefaults[] = "49  /0/0/0/0,*/1,*/2,*/3,*/4,*/5,*/6,*/7,*/8,*/9,*";
	hycapictrl_info *cinfo = (hycapictrl_info *)(ctrl->driverdata);
	hysdn_card *card = cinfo->card;
	struct sk_buff *skb;
	__u16 len;
	__u8 _command = 0xa0, _subcommand = 0x80;
	__u16 MessageNumber = 0x0000;
	__u16 MessageBufferSize = 0;
	int slen = strlen(ExtFeatureDefaults);
#ifdef HYCAPI_PRINTFNAMES
#ifdef CONFIG_DEBUG_PRINTK
	printk(KERN_NOTICE "hycapi_register_appl\n"); 
#else
	;
#endif
#endif
	MessageBufferSize = rp->level3cnt * rp->datablkcnt * rp->datablklen; 

	len = CAPI_MSG_BASELEN + 8 + slen + 1;
	if (!(skb = alloc_skb(len, GFP_ATOMIC))) {
		printk(KERN_ERR "HYSDN card%d: memory squeeze in hycapi_register_appl\n",
		       card->myid);
		return;
	}
	memcpy(skb_put(skb,sizeof(__u16)), &len, sizeof(__u16));
	memcpy(skb_put(skb,sizeof(__u16)), &appl, sizeof(__u16));
	memcpy(skb_put(skb,sizeof(__u8)), &_command, sizeof(_command));
	memcpy(skb_put(skb,sizeof(__u8)), &_subcommand, sizeof(_subcommand));
	memcpy(skb_put(skb,sizeof(__u16)), &MessageNumber, sizeof(__u16));
	memcpy(skb_put(skb,sizeof(__u16)), &MessageBufferSize, sizeof(__u16)); 
	memcpy(skb_put(skb,sizeof(__u16)), &(rp->level3cnt), sizeof(__u16));
	memcpy(skb_put(skb,sizeof(__u16)), &(rp->datablkcnt), sizeof(__u16));
	memcpy(skb_put(skb,sizeof(__u16)), &(rp->datablklen), sizeof(__u16));
	memcpy(skb_put(skb,slen), ExtFeatureDefaults, slen);
	hycapi_applications[appl-1].ctrl_mask |= (1 << (ctrl->cnr-1));    
	hycapi_send_message(ctrl, skb);    
}