Commit 5b42cae8 authored by Donald Haase's avatar Donald Haase
Browse files

Updated to work with new dynamic Maple internals.

parent 949c00ee
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
/* Local copy of the returned buffer for maple stuff */ /* Local copy of the returned buffer for maple stuff */
unsigned char recv_buff[MAPLE_BUFF_SIZE] __attribute__ ((aligned (32))); 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; maple_response_t *resp;
...@@ -39,12 +39,8 @@ static void vbl_allinfo_callback(maple_frame_t * frm) ...@@ -39,12 +39,8 @@ static void vbl_allinfo_callback(maple_frame_t * frm)
} }
/* Send a ALLINFO command for the given port/unit */ /* 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 */ /* Reserve access; if we don't get it, forget about it */
if (maple_frame_lock(&dev->frame) < 0) return; if (maple_frame_lock(&dev->frame) < 0) return;
...@@ -52,8 +48,8 @@ static void vbl_send_allinfo(int p, int u) ...@@ -52,8 +48,8 @@ static void vbl_send_allinfo(int p, int u)
maple_frame_init(&dev->frame); maple_frame_init(&dev->frame);
dev->frame.cmd = MAPLE_COMMAND_ALLINFO; dev->frame.cmd = MAPLE_COMMAND_ALLINFO;
dev->frame.length = 0; dev->frame.length = 0;
dev->frame.dst_port = p; dev->frame.dst_port = dev->port;
dev->frame.dst_unit = u; dev->frame.dst_unit = dev->unit;
dev->frame.callback = vbl_allinfo_callback; dev->frame.callback = vbl_allinfo_callback;
maple_queue_frame(&dev->frame); maple_queue_frame(&dev->frame);
} }
...@@ -97,7 +93,7 @@ void print_device_allinfo(maple_device_t *dev, int extra) ...@@ -97,7 +93,7 @@ void print_device_allinfo(maple_device_t *dev, int extra)
memset(recv_buff, 0, MAPLE_BUFF_SIZE); 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); 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); timer_spin_sleep(750);
size = (resp->data_len * 4); size = (resp->data_len * 4);
...@@ -124,11 +120,13 @@ void print_device_allinfo(maple_device_t *dev, int extra) ...@@ -124,11 +120,13 @@ void print_device_allinfo(maple_device_t *dev, int extra)
*/ */
void print_all_device_allinfo(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); 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); printf("That's all the devices attached.\n"); fflush(stdout);
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment