- packet=hpsb_make_writepacket(ne->host, ne->nodeid,
- COMMAND_REGISTER,
- (quadlet_t*)CmdFrm,
- CmdFrm->length);
- hpsb_set_packet_complete_task(packet,
- (void (*)(void*))avc_free_packet,
- packet);
- hpsb_node_fill_packet(ne, packet);
-
- if (hpsb_send_packet(packet) < 0) {
- avc_free_packet(packet);
- atomic_set(&firesat->avc_reply_received, 1);
- printk("%s: send failed!\n",__func__);
- return -EIO;
- }
-
- if(RspFrm) {
- // AV/C specs say that answers should be send within
- // 150 ms so let's time out after 200 ms
- if(avc_down_timeout(&firesat->avc_reply_received,
- HZ / 5)) {
- printk("%s: timeout waiting for avc response\n",
- __func__);
+ while (packet_ok == 0 && num_tries < 6) {
+ num_tries++;
+ packet_ok = 1;
+ packet = hpsb_make_writepacket(ne->host, ne->nodeid,
+ COMMAND_REGISTER,
+ (quadlet_t*)CmdFrm,
+ CmdFrm->length);
+ hpsb_set_packet_complete_task(packet,
+ (void (*)(void*))avc_free_packet,
+ packet);
+ hpsb_node_fill_packet(ne, packet);
+
+ if (hpsb_send_packet(packet) < 0) {
+ avc_free_packet(packet);