dburg -> RE: Badly Need Help for Packet Writing Steps (7/23/2003 12:53:38 AM)
|
>...with a simplest 8051 Microcontroller with a limited memory of 4-8K. That is the Challenge. Yep, I think challenge is the good word. :-D But nothing impossible so far. >Please see there that I am not getting that Page number 0x05 and 0x32 i.e. Length at Bytes 0 and 1 postion but at different like 7th or 8th ? Is it Okay or a Problem? Yes, this is (nearly, see later) okay but you must understand why you get the start of the mode page there and not at bytes 0/1. It is because the logical unit does not just returns the mode pages, but a mode parameter header of 8 bytes followed by (an) optional block descriptor(s). The mode parameter header is of 8 bytes and the 2 last bytes contain the size of optional block descriptors (in bytes). Now, in your precise case there seems to be an error because you have only 6 of the 8 bytes of the mode parameter header (0001 0000 0000). This seems to be the last bytes of the mode parameter header, meaning that there is no block descriptor, and that after these 6 bytes begins the first returned mode page (3205... with an invert endian than your host). I recommend to search what happen with the 2 missing bytes of the mode parameter header, this is not normal. But, this is a non-blocking issue. Now that you know where your mode page starts, you can modify it, *taking in account that it does not begin at byte 0!* >Then I explicitly set that 0 and 1st byte to Page Num 0x05 and Length 0x32? Is it Okay? 3 times not okay: - Not okay because you must not move the position of the beginning of the mode page. - Not okay because you must zero the 6 first bytes of the mode parameter header (that is, everything but the count of block descriptor(s) bytes). If they were block descriptors, you would have to zero the 5 first bytes of these. Fortunately there are none of them in this particular case. - Not okay because you forget the endian difference between you (the host) and your device (the logical unit). You must write "32 05" instead of "05 32" That should clarify a bit your problem, although I confirm that reading and setting the mode pages of a device is not the easiest thing on earth.
|
|
|
|