#define DVB_CA_SLOTSTATE_WAITFR 6
#define DVB_CA_SLOTSTATE_LINKINIT 7
-
/* Information on a CA slot */
struct dvb_ca_slot {
/* current state of the CAM */
static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot,
u8 *ebuf, int ecount);
-
/**
* Safely find needle in haystack.
*
return NULL;
}
-
-
/* ************************************************************************** */
/* EN50221 physical interface functions */
-
/**
* dvb_ca_en50221_check_camstatus - Check CAM status.
*/
return cam_changed;
}
-
/**
* dvb_ca_en50221_wait_if_status - Wait for flags to become set on the STATUS
* register on a CAM interface, checking for errors and timeout.
return -ETIMEDOUT;
}
-
/**
* dvb_ca_en50221_link_init - Initialise the link layer connection to a CAM.
*
return 0;
}
-
/**
* dvb_ca_en50221_parse_attributes - Parse attribute memory of a CAM module,
* extracting Config register, and checking it is a DVB CAM module.
u16 manfid = 0;
u16 devid = 0;
-
/* CISTPL_DEVICE_0A */
status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tuple_type,
&tuple_length, tuple);
if (tuple_type != 0x1D)
return -EINVAL;
-
-
/* CISTPL_DEVICE_0C */
status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tuple_type,
&tuple_length, tuple);
if (tuple_type != 0x1C)
return -EINVAL;
-
-
/* CISTPL_VERS_1 */
status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tuple_type,
&tuple_length, tuple);
if (tuple_type != 0x15)
return -EINVAL;
-
-
/* CISTPL_MANFID */
status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tuple_type,
&tuple_length, tuple);
manfid = (tuple[1] << 8) | tuple[0];
devid = (tuple[3] << 8) | tuple[2];
-
-
/* CISTPL_CONFIG */
status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tuple_type,
&tuple_length, tuple);
return 0;
}
-
/**
* dvb_ca_en50221_set_configoption - Set CAM's configoption correctly.
*
return 0;
}
-
/**
* dvb_ca_en50221_read_data - This function talks to an EN50221 CAM control
* interface. It reads a buffer of data from the CAM. The data can either
return status;
}
-
/**
* dvb_ca_en50221_write_data - This function talks to an EN50221 CAM control
* interface. It writes a buffer of data to a CAM.
dprintk("%s\n", __func__);
-
/* sanity check */
if (bytes_write > sl->link_buf_size)
return -EINVAL;
return status;
}
-
-
/* ************************************************************************** */
/* EN50221 higher level functions */
-
/**
* dvb_ca_en50221_slot_shutdown - A CAM has been removed => shut it down.
*
return 0;
}
-
/**
* dvb_ca_en50221_camchange_irq - A CAMCHANGE IRQ has occurred.
*
}
EXPORT_SYMBOL(dvb_ca_en50221_camchange_irq);
-
/**
* dvb_ca_en50221_camready_irq - A CAMREADY IRQ has occurred.
*
}
EXPORT_SYMBOL(dvb_ca_en50221_camready_irq);
-
/**
* dvb_ca_en50221_frda_irq - An FR or DA IRQ has occurred.
*
}
EXPORT_SYMBOL(dvb_ca_en50221_frda_irq);
-
/* ************************************************************************** */
/* EN50221 thread functions */
return 0;
}
-
-
/* ************************************************************************** */
/* EN50221 IO interface functions */
return err;
}
-
/**
* Wrapper for ioctl implementation.
*
return dvb_usercopy(file, cmd, arg, dvb_ca_en50221_io_do_ioctl);
}
-
/**
* Implementation of write() syscall.
*
return status;
}
-
/**
* Condition for waking up in dvb_ca_en50221_io_read_condition
*/
return found;
}
-
/**
* Implementation of read() syscall.
*
return status;
}
-
/**
* Implementation of file open syscall.
*
return 0;
}
-
/**
* Implementation of file close syscall.
*
return err;
}
-
/**
* Implementation of poll() syscall.
*
return mask;
}
-
static const struct file_operations dvb_ca_fops = {
.owner = THIS_MODULE,
.read = dvb_ca_en50221_io_read,
/* ************************************************************************** */
/* Initialisation/shutdown functions */
-
/**
* Initialise a new DVB CA EN50221 interface device.
*
}
EXPORT_SYMBOL(dvb_ca_en50221_init);
-
/**
* Release a DVB CA EN50221 interface device.
*