void __user *arg = (void __user *)ioctl_arg; 
static int dst_ca_ioctl(struct inode *inode, struct file *file, unsigned int cmd, void *arg){	struct dvb_device* dvbdev = (struct dvb_device*) file->private_data;	struct dst_state* state = (struct dst_state*) dvbdev->priv;	struct ca_slot_info *p_ca_slot_info;	struct ca_caps *p_ca_caps;	struct ca_msg *p_ca_message;	if ((p_ca_message = (struct ca_msg *) kmalloc(sizeof (struct ca_msg), GFP_KERNEL)) == NULL) {		dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure");		return -ENOMEM;	}	if ((p_ca_slot_info = (struct ca_slot_info *) kmalloc(sizeof (struct ca_slot_info), GFP_KERNEL)) == NULL) {		dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure");		return -ENOMEM;	}	if ((p_ca_caps = (struct ca_caps *) kmalloc(sizeof (struct ca_caps), GFP_KERNEL)) == NULL) {		dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure");		return -ENOMEM;	}	/*	We have now only the standard ioctl's, the driver is upposed to handle internals.	*/	switch (cmd) {	case CA_SEND_MSG:		dprintk(verbose, DST_CA_INFO, 1, " Sending message");		if ((ca_send_message(state, p_ca_message, arg)) < 0) {			dprintk(verbose, DST_CA_ERROR, 1, " -->CA_SEND_MSG Failed !");			return -1;		}		break;	case CA_GET_MSG:		dprintk(verbose, DST_CA_INFO, 1, " Getting message");		if ((ca_get_message(state, p_ca_message, arg)) < 0) {			dprintk(verbose, DST_CA_ERROR, 1, " -->CA_GET_MSG Failed !");			return -1;		}		dprintk(verbose, DST_CA_INFO, 1, " -->CA_GET_MSG Success !");		break;	case CA_RESET:		dprintk(verbose, DST_CA_ERROR, 1, " Resetting DST");		dst_error_bailout(state);		msleep(4000);		break;	case CA_GET_SLOT_INFO:		dprintk(verbose, DST_CA_INFO, 1, " Getting Slot info");		if ((ca_get_slot_info(state, p_ca_slot_info, arg)) < 0) {			dprintk(verbose, DST_CA_ERROR, 1, " -->CA_GET_SLOT_INFO Failed !");			return -1;		}		dprintk(verbose, DST_CA_INFO, 1, " -->CA_GET_SLOT_INFO Success !");		break;	case CA_GET_CAP:		dprintk(verbose, DST_CA_INFO, 1, " Getting Slot capabilities");		if ((ca_get_slot_caps(state, p_ca_caps, arg)) < 0) {			dprintk(verbose, DST_CA_ERROR, 1, " -->CA_GET_CAP Failed !");			return -1;		}		dprintk(verbose, DST_CA_INFO, 1, " -->CA_GET_CAP Success !");		break;	case CA_GET_DESCR_INFO:		dprintk(verbose, DST_CA_INFO, 1, " Getting descrambler description");		if ((ca_get_slot_descr(state, p_ca_message, arg)) < 0) {			dprintk(verbose, DST_CA_ERROR, 1, " -->CA_GET_DESCR_INFO Failed !");			return -1;		}		dprintk(verbose, DST_CA_INFO, 1, " -->CA_GET_DESCR_INFO Success !");		break;	case CA_SET_DESCR:		dprintk(verbose, DST_CA_INFO, 1, " Setting descrambler");		if ((ca_set_slot_descr()) < 0) {			dprintk(verbose, DST_CA_ERROR, 1, " -->CA_SET_DESCR Failed !");			return -1;		}		dprintk(verbose, DST_CA_INFO, 1, " -->CA_SET_DESCR Success !");		break;	case CA_SET_PID:		dprintk(verbose, DST_CA_INFO, 1, " Setting PID");		if ((ca_set_pid()) < 0) {			dprintk(verbose, DST_CA_ERROR, 1, " -->CA_SET_PID Failed !");			return -1;		}		dprintk(verbose, DST_CA_INFO, 1, " -->CA_SET_PID Success !");	default:		return -EOPNOTSUPP;	};	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/174f80dfcba45677f12ba57479d03750dd9cad7b/dst_ca.c/clean/drivers/media/dvb/bt8xx/dst_ca.c