- #ifdef ENABLE_CARD_template
- if (!strcmp(candevices_p[card]->hwname,"template")) {
- template_register(candevices_p[card]->hwspecops);
- }
- #endif
- #ifdef ENABLE_CARD_pip
- if (!strcmp(candevices_p[card]->hwname,"pip5")) {
- pip5_register(candevices_p[card]->hwspecops);
- }
- else if (!strcmp(candevices_p[card]->hwname,"pip6")) {
- pip6_register(candevices_p[card]->hwspecops);
- }
- #endif
- #ifdef ENABLE_CARD_smartcan
- if (!strcmp(candevices_p[card]->hwname,"smartcan")) {
- smartcan_register(candevices_p[card]->hwspecops);
- }
- #endif
- #ifdef ENABLE_CARD_nsi
- if (!strcmp(candevices_p[card]->hwname,"nsican")) {
- nsi_register(candevices_p[card]->hwspecops);
- }
- #endif
- #ifdef ENABLE_CARD_cc_can104
- if (!strcmp(candevices_p[card]->hwname,"cc104")) {
- cc104_register(candevices_p[card]->hwspecops);
- }
- #endif
- #ifdef ENABLE_CARD_aim104
- if (!strcmp(candevices_p[card]->hwname,"aim104")) {
- aim104_register(candevices_p[card]->hwspecops);
- }
- #endif
- #ifdef ENABLE_CARD_pc_i03
- if (!strcmp(candevices_p[card]->hwname,"pc-i03")) {
- pci03_register(candevices_p[card]->hwspecops);
- }
- #endif
- #ifdef ENABLE_CARD_pcm3680
- if (!strcmp(candevices_p[card]->hwname,"pcm3680")) {
- pcm3680_register(candevices_p[card]->hwspecops);
- }
- #endif
- #ifdef ENABLE_CARD_pccan
- if (!strcmp(candevices_p[card]->hwname,"pccan-f") |
- !strcmp(candevices_p[card]->hwname,"pccan-s") ) {
- pccanf_register(candevices_p[card]->hwspecops);
- }
- if (!strcmp(candevices_p[card]->hwname,"pccan-d")) {
- pccand_register(candevices_p[card]->hwspecops);
- }
- if (!strcmp(candevices_p[card]->hwname,"pccan-q")) {
- pccanq_register(candevices_p[card]->hwspecops);
- }
- #endif
- #ifdef ENABLE_CARD_m437
- if (!strcmp(candevices_p[card]->hwname,"m437")) {
- m437_register(candevices_p[card]->hwspecops);
- }
- #endif
- #ifdef ENABLE_CARD_pcccan
- if (!strcmp(candevices_p[card]->hwname,"pcccan")) {
- pcccan_register(candevices_p[card]->hwspecops);
- }
- #endif
- #ifdef ENABLE_CARD_ssv
- if (!strcmp(candevices_p[card]->hwname,"ssv")) {
- ssv_register(candevices_p[card]->hwspecops);
- }
- #endif
- #ifdef ENABLE_CARD_bfadcan
- if (!strcmp(candevices_p[card]->hwname,"bfadcan")) {
- bfadcan_register(candevices_p[card]->hwspecops);
- }
- #endif
- #ifdef ENABLE_CARD_pikronisa
- if (!strcmp(candevices_p[card]->hwname,"pikronisa")) {
- pikronisa_register(candevices_p[card]->hwspecops);
- }
- #endif
+ struct canque_ends_t *qends;
+ struct msgobj_t *obj;
+ int ret;
+
+ obj=(struct msgobj_t *)can_checked_malloc(sizeof(struct msgobj_t));
+ hostchip->msgobj[objnr]=obj;
+ if (obj == NULL)
+ return -ENOMEM;
+
+ memset(obj, 0, sizeof(struct msgobj_t));
+ obj->minor=-1;
+
+ atomic_set(&obj->obj_used,0);
+ INIT_LIST_HEAD(&obj->obj_users);
+ init_timer(&obj->tx_timeout);
+
+ qends = (struct canque_ends_t *)can_checked_malloc(sizeof(struct canque_ends_t));
+ if(qends == NULL) return -ENOMEM;
+ memset(qends, 0, sizeof(struct canque_ends_t));
+ obj->hostchip=hostchip;
+ obj->object=objnr+1;
+ obj->qends=qends;
+ obj->tx_qedge=NULL;
+ obj->tx_slot=NULL;
+ obj->obj_flags = 0x0;
+
+ ret=canqueue_ends_init_chip(qends, hostchip, obj);
+ if(ret<0) return ret;
+
+ ret=candev->hwspecops->init_obj_data(hostchip,objnr);
+ if(ret<0) return ret;
+