PCIe driver: Add function to count PCIe completed descriptors
This commit is contained in:
@@ -125,6 +125,7 @@ void jfjoch_load_int_pkt_gen(struct jfjoch_drvdata *drvdata, char* output);
|
||||
void jfjoch_save_int_pkt_gen(struct jfjoch_drvdata *drvdata, const char* input);
|
||||
int jfjoch_load_calibration(struct jfjoch_drvdata *drvdata, struct ActionConfig *config);
|
||||
int jfjoch_run_frame_gen(struct jfjoch_drvdata *drvdata, struct FrameGeneratorConfig *config);
|
||||
u32 jfjoch_get_c2h_descriptors(struct jfjoch_drvdata *drvdata);
|
||||
|
||||
u64 jfjoch_read_mac_addr(struct jfjoch_drvdata *drvdata);
|
||||
|
||||
|
||||
@@ -350,4 +350,8 @@ int jfjoch_run_frame_gen(struct jfjoch_drvdata *drvdata, struct FrameGeneratorCo
|
||||
iowrite32(config->debug, drvdata->bar0 + ADDR_FRAME_GEN_DEBUG);
|
||||
iowrite32(0x1, drvdata->bar0 + ADDR_FRAME_GEN_CTRL);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
u32 jfjoch_get_c2h_descriptors(struct jfjoch_drvdata *drvdata) {
|
||||
return ioread32(drvdata->bar0 + PCIE_OFFSET + (1<<12) + 0x48);
|
||||
}
|
||||
|
||||
@@ -127,6 +127,10 @@ long jfjoch_cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) {
|
||||
}
|
||||
vfree(tmp);
|
||||
return 0;
|
||||
case IOCTL_JFJOCH_C2H_DMA_DESC:
|
||||
exchange[0] = jfjoch_get_c2h_descriptors(drvdata);
|
||||
if (copy_to_user((char *) arg, exchange, sizeof(u32)) != 0)
|
||||
return -EFAULT;
|
||||
default:
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
||||
@@ -36,5 +36,6 @@
|
||||
#define IOCTL_JFJOCH_GET_INT_PKT _IOR(IOCTL_JFJOCH_MAGIC, 20, char *)
|
||||
#define IOCTL_JFJOCH_LOAD_CALIB _IOW(IOCTL_JFJOCH_MAGIC, 21, struct ActionConfig)
|
||||
#define IOCTL_JFJOCH_RUN_FRAME_GEN _IOW(IOCTL_JFJOCH_MAGIC, 22, struct FrameGeneratorConfig)
|
||||
#define IOCTL_JFJOCH_C2H_DMA_DESC _IOR(IOCTL_JFJOCH_MAGIC, 23, uint32_t)
|
||||
|
||||
#endif //JUNGFRAUJOCH_JFJOCH_IOCTL_H
|
||||
|
||||
Reference in New Issue
Block a user