Loading MapleTest.c +9 −11 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ /* Local copy of the returned buffer for maple stuff */ unsigned char recv_buff[MAPLE_BUFF_SIZE] __attribute__ ((aligned (32))); static void vbl_allinfo_callback(maple_frame_t * frm) static void vbl_allinfo_callback(struct maple_state_str *, maple_frame_t * frm) { maple_response_t *resp; Loading @@ -39,12 +39,8 @@ static void vbl_allinfo_callback(maple_frame_t * frm) } /* Send a ALLINFO command for the given port/unit */ static void vbl_send_allinfo(int p, int u) static void vbl_send_allinfo(maple_device_t * dev) { maple_device_t * dev; dev = &maple_state.ports[p].units[u]; /* Reserve access; if we don't get it, forget about it */ if (maple_frame_lock(&dev->frame) < 0) return; Loading @@ -52,8 +48,8 @@ static void vbl_send_allinfo(int p, int u) maple_frame_init(&dev->frame); dev->frame.cmd = MAPLE_COMMAND_ALLINFO; dev->frame.length = 0; dev->frame.dst_port = p; dev->frame.dst_unit = u; dev->frame.dst_port = dev->port; dev->frame.dst_unit = dev->unit; dev->frame.callback = vbl_allinfo_callback; maple_queue_frame(&dev->frame); } Loading Loading @@ -97,7 +93,7 @@ void print_device_allinfo(maple_device_t *dev, int extra) memset(recv_buff, 0, MAPLE_BUFF_SIZE); printf("Trying to get the allinfo for device %c%c:\n", 'A'+(dev->port), '0'+(dev->unit)); fflush(stdout); vbl_send_allinfo((dev->port), (dev->unit)); vbl_send_allinfo(dev); timer_spin_sleep(750); size = (resp->data_len * 4); Loading @@ -124,11 +120,13 @@ void print_device_allinfo(maple_device_t *dev, int extra) */ void print_all_device_allinfo(int extra) { int i = 0, num = maple_enum_count(); int i = 0, j = 0, num = maple_enum_count(); printf("Going to print info on all [%d] devices found: \n", num); fflush(stdout); for(;i<num;i++) print_device_allinfo(maple_enum_type(i, 0xffffffff), extra); for(;i < MAPLE_PORT_COUNT; i++) for(;j < MAPLE_UNIT_COUNT; j++) print_device_allinfo(maple_enum_dev(i, j), extra); printf("That's all the devices attached.\n"); fflush(stdout); } Loading
MapleTest.c +9 −11 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ /* Local copy of the returned buffer for maple stuff */ unsigned char recv_buff[MAPLE_BUFF_SIZE] __attribute__ ((aligned (32))); static void vbl_allinfo_callback(maple_frame_t * frm) static void vbl_allinfo_callback(struct maple_state_str *, maple_frame_t * frm) { maple_response_t *resp; Loading @@ -39,12 +39,8 @@ static void vbl_allinfo_callback(maple_frame_t * frm) } /* Send a ALLINFO command for the given port/unit */ static void vbl_send_allinfo(int p, int u) static void vbl_send_allinfo(maple_device_t * dev) { maple_device_t * dev; dev = &maple_state.ports[p].units[u]; /* Reserve access; if we don't get it, forget about it */ if (maple_frame_lock(&dev->frame) < 0) return; Loading @@ -52,8 +48,8 @@ static void vbl_send_allinfo(int p, int u) maple_frame_init(&dev->frame); dev->frame.cmd = MAPLE_COMMAND_ALLINFO; dev->frame.length = 0; dev->frame.dst_port = p; dev->frame.dst_unit = u; dev->frame.dst_port = dev->port; dev->frame.dst_unit = dev->unit; dev->frame.callback = vbl_allinfo_callback; maple_queue_frame(&dev->frame); } Loading Loading @@ -97,7 +93,7 @@ void print_device_allinfo(maple_device_t *dev, int extra) memset(recv_buff, 0, MAPLE_BUFF_SIZE); printf("Trying to get the allinfo for device %c%c:\n", 'A'+(dev->port), '0'+(dev->unit)); fflush(stdout); vbl_send_allinfo((dev->port), (dev->unit)); vbl_send_allinfo(dev); timer_spin_sleep(750); size = (resp->data_len * 4); Loading @@ -124,11 +120,13 @@ void print_device_allinfo(maple_device_t *dev, int extra) */ void print_all_device_allinfo(int extra) { int i = 0, num = maple_enum_count(); int i = 0, j = 0, num = maple_enum_count(); printf("Going to print info on all [%d] devices found: \n", num); fflush(stdout); for(;i<num;i++) print_device_allinfo(maple_enum_type(i, 0xffffffff), extra); for(;i < MAPLE_PORT_COUNT; i++) for(;j < MAPLE_UNIT_COUNT; j++) print_device_allinfo(maple_enum_dev(i, j), extra); printf("That's all the devices attached.\n"); fflush(stdout); }