diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-13 21:23:44 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-13 21:23:44 -0400 |
commit | dd4efa44ebf2a8a0e5edf60a53eadec981b4b10a (patch) | |
tree | dd6e750c3e7228abb1f922de240b86d7d12d14bf /Documentation | |
parent | 1a04392bd6439876b1552793389cbb5be356ea54 (diff) | |
parent | 046d20b73960b7a2474b6d5e920d54c3fd7c23fe (diff) |
Merge branch 'master'
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/connector/connector.txt | 44 | ||||
-rw-r--r-- | Documentation/dell_rbu.txt | 38 |
2 files changed, 72 insertions, 10 deletions
diff --git a/Documentation/connector/connector.txt b/Documentation/connector/connector.txt index 54a0a14bfbe3..57a314b14cf8 100644 --- a/Documentation/connector/connector.txt +++ b/Documentation/connector/connector.txt | |||
@@ -131,3 +131,47 @@ Netlink itself is not reliable protocol, that means that messages can | |||
131 | be lost due to memory pressure or process' receiving queue overflowed, | 131 | be lost due to memory pressure or process' receiving queue overflowed, |
132 | so caller is warned must be prepared. That is why struct cn_msg [main | 132 | so caller is warned must be prepared. That is why struct cn_msg [main |
133 | connector's message header] contains u32 seq and u32 ack fields. | 133 | connector's message header] contains u32 seq and u32 ack fields. |
134 | |||
135 | /*****************************************/ | ||
136 | Userspace usage. | ||
137 | /*****************************************/ | ||
138 | 2.6.14 has a new netlink socket implementation, which by default does not | ||
139 | allow to send data to netlink groups other than 1. | ||
140 | So, if to use netlink socket (for example using connector) | ||
141 | with different group number userspace application must subscribe to | ||
142 | that group. It can be achieved by following pseudocode: | ||
143 | |||
144 | s = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR); | ||
145 | |||
146 | l_local.nl_family = AF_NETLINK; | ||
147 | l_local.nl_groups = 12345; | ||
148 | l_local.nl_pid = 0; | ||
149 | |||
150 | if (bind(s, (struct sockaddr *)&l_local, sizeof(struct sockaddr_nl)) == -1) { | ||
151 | perror("bind"); | ||
152 | close(s); | ||
153 | return -1; | ||
154 | } | ||
155 | |||
156 | { | ||
157 | int on = l_local.nl_groups; | ||
158 | setsockopt(s, 270, 1, &on, sizeof(on)); | ||
159 | } | ||
160 | |||
161 | Where 270 above is SOL_NETLINK, and 1 is a NETLINK_ADD_MEMBERSHIP socket | ||
162 | option. To drop multicast subscription one should call above socket option | ||
163 | with NETLINK_DROP_MEMBERSHIP parameter which is defined as 0. | ||
164 | |||
165 | 2.6.14 netlink code only allows to select a group which is less or equal to | ||
166 | the maximum group number, which is used at netlink_kernel_create() time. | ||
167 | In case of connector it is CN_NETLINK_USERS + 0xf, so if you want to use | ||
168 | group number 12345, you must increment CN_NETLINK_USERS to that number. | ||
169 | Additional 0xf numbers are allocated to be used by non-in-kernel users. | ||
170 | |||
171 | Due to this limitation, group 0xffffffff does not work now, so one can | ||
172 | not use add/remove connector's group notifications, but as far as I know, | ||
173 | only cn_test.c test module used it. | ||
174 | |||
175 | Some work in netlink area is still being done, so things can be changed in | ||
176 | 2.6.15 timeframe, if it will happen, documentation will be updated for that | ||
177 | kernel. | ||
diff --git a/Documentation/dell_rbu.txt b/Documentation/dell_rbu.txt index 95d7f62e4dbc..941343a7a265 100644 --- a/Documentation/dell_rbu.txt +++ b/Documentation/dell_rbu.txt | |||
@@ -35,6 +35,7 @@ The driver load creates the following directories under the /sys file system. | |||
35 | /sys/class/firmware/dell_rbu/data | 35 | /sys/class/firmware/dell_rbu/data |
36 | /sys/devices/platform/dell_rbu/image_type | 36 | /sys/devices/platform/dell_rbu/image_type |
37 | /sys/devices/platform/dell_rbu/data | 37 | /sys/devices/platform/dell_rbu/data |
38 | /sys/devices/platform/dell_rbu/packet_size | ||
38 | 39 | ||
39 | The driver supports two types of update mechanism; monolithic and packetized. | 40 | The driver supports two types of update mechanism; monolithic and packetized. |
40 | These update mechanism depends upon the BIOS currently running on the system. | 41 | These update mechanism depends upon the BIOS currently running on the system. |
@@ -47,8 +48,26 @@ By default the driver uses monolithic memory for the update type. This can be | |||
47 | changed to packets during the driver load time by specifying the load | 48 | changed to packets during the driver load time by specifying the load |
48 | parameter image_type=packet. This can also be changed later as below | 49 | parameter image_type=packet. This can also be changed later as below |
49 | echo packet > /sys/devices/platform/dell_rbu/image_type | 50 | echo packet > /sys/devices/platform/dell_rbu/image_type |
50 | Also echoing either mono ,packet or init in to image_type will free up the | 51 | |
51 | memory allocated by the driver. | 52 | In packet update mode the packet size has to be given before any packets can |
53 | be downloaded. It is done as below | ||
54 | echo XXXX > /sys/devices/platform/dell_rbu/packet_size | ||
55 | In the packet update mechanism, the user neesd to create a new file having | ||
56 | packets of data arranged back to back. It can be done as follows | ||
57 | The user creates packets header, gets the chunk of the BIOS image and | ||
58 | placs it next to the packetheader; now, the packetheader + BIOS image chunk | ||
59 | added to geather should match the specified packet_size. This makes one | ||
60 | packet, the user needs to create more such packets out of the entire BIOS | ||
61 | image file and then arrange all these packets back to back in to one single | ||
62 | file. | ||
63 | This file is then copied to /sys/class/firmware/dell_rbu/data. | ||
64 | Once this file gets to the driver, the driver extracts packet_size data from | ||
65 | the file and spreads it accross the physical memory in contiguous packet_sized | ||
66 | space. | ||
67 | This method makes sure that all the packets get to the driver in a single operation. | ||
68 | |||
69 | In monolithic update the user simply get the BIOS image (.hdr file) and copies | ||
70 | to the data file as is without any change to the BIOS image itself. | ||
52 | 71 | ||
53 | Do the steps below to download the BIOS image. | 72 | Do the steps below to download the BIOS image. |
54 | 1) echo 1 > /sys/class/firmware/dell_rbu/loading | 73 | 1) echo 1 > /sys/class/firmware/dell_rbu/loading |
@@ -58,7 +77,10 @@ Do the steps below to download the BIOS image. | |||
58 | The /sys/class/firmware/dell_rbu/ entries will remain till the following is | 77 | The /sys/class/firmware/dell_rbu/ entries will remain till the following is |
59 | done. | 78 | done. |
60 | echo -1 > /sys/class/firmware/dell_rbu/loading. | 79 | echo -1 > /sys/class/firmware/dell_rbu/loading. |
61 | Until this step is completed the drivr cannot be unloaded. | 80 | Until this step is completed the driver cannot be unloaded. |
81 | Also echoing either mono ,packet or init in to image_type will free up the | ||
82 | memory allocated by the driver. | ||
83 | |||
62 | If an user by accident executes steps 1 and 3 above without executing step 2; | 84 | If an user by accident executes steps 1 and 3 above without executing step 2; |
63 | it will make the /sys/class/firmware/dell_rbu/ entries to disappear. | 85 | it will make the /sys/class/firmware/dell_rbu/ entries to disappear. |
64 | The entries can be recreated by doing the following | 86 | The entries can be recreated by doing the following |
@@ -66,15 +88,11 @@ echo init > /sys/devices/platform/dell_rbu/image_type | |||
66 | NOTE: echoing init in image_type does not change it original value. | 88 | NOTE: echoing init in image_type does not change it original value. |
67 | 89 | ||
68 | Also the driver provides /sys/devices/platform/dell_rbu/data readonly file to | 90 | Also the driver provides /sys/devices/platform/dell_rbu/data readonly file to |
69 | read back the image downloaded. This is useful in case of packet update | 91 | read back the image downloaded. |
70 | mechanism where the above steps 1,2,3 will repeated for every packet. | ||
71 | By reading the /sys/devices/platform/dell_rbu/data file all packet data | ||
72 | downloaded can be verified in a single file. | ||
73 | The packets are arranged in this file one after the other in a FIFO order. | ||
74 | 92 | ||
75 | NOTE: | 93 | NOTE: |
76 | This driver requires a patch for firmware_class.c which has the addition | 94 | This driver requires a patch for firmware_class.c which has the modified |
77 | of request_firmware_nowait_nohotplug function to wortk | 95 | request_firmware_nowait function. |
78 | Also after updating the BIOS image an user mdoe application neeeds to execute | 96 | Also after updating the BIOS image an user mdoe application neeeds to execute |
79 | code which message the BIOS update request to the BIOS. So on the next reboot | 97 | code which message the BIOS update request to the BIOS. So on the next reboot |
80 | the BIOS knows about the new image downloaded and it updates it self. | 98 | the BIOS knows about the new image downloaded and it updates it self. |