<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://bugs.maemo.com/skins/common/feed.css?207"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Wl1251-cal - Revision history</title>
		<link>http://bugs.maemo.com/index.php?title=Wl1251-cal&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.15.5-7</generator>
		<lastBuildDate>Sat, 18 Apr 2026 10:40:09 GMT</lastBuildDate>
		<item>
			<title>jonwil at 18:19, 30 January 2011</title>
			<link>http://bugs.maemo.com/index.php?title=Wl1251-cal&amp;diff=41520&amp;oldid=prev</link>
			<guid>http://bugs.maemo.com/index.php?title=Wl1251-cal&amp;diff=41520&amp;oldid=prev</guid>
			<description>&lt;p&gt;&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 18:19, 30 January 2011&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;rough pseudocode for what wl1251-cal seems to be doing:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;rough pseudocode for what wl1251-cal seems to be doing:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;wl1251str *handle = libwl1251_init(&amp;quot;wlan0&amp;quot;,0);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;wl1251str *handle = libwl1251_init(&amp;quot;wlan0&amp;quot;,0);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 41:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 42:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;libwl1251_nvs_push simply loads the nvs data to the card.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;libwl1251_nvs_push simply loads the nvs data to the card.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;not sure whether anything special is done by libwl1251_init&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;not sure whether anything special is done by libwl1251_init&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff generator: internal 2026-04-18 10:40:09 --&gt;
&lt;/table&gt;</description>
			<pubDate>Sun, 30 Jan 2011 18:19:24 GMT</pubDate>			<dc:creator>jonwil</dc:creator>			<comments>http://bugs.maemo.com/Talk:Wl1251-cal</comments>		</item>
		<item>
			<title>jonwil:&amp;#32;New page: rough pseudocode for what wl1251-cal seems to be doing: wl1251str *handle = libwl1251_init(&quot;wlan0&quot;,0); send dbus message &quot;com.nokia.phone.net&quot; &quot;/com/nokia/phone/net&quot; &quot;Phone.Net&quot; &quot;get_regis...</title>
			<link>http://bugs.maemo.com/index.php?title=Wl1251-cal&amp;diff=41519&amp;oldid=prev</link>
			<guid>http://bugs.maemo.com/index.php?title=Wl1251-cal&amp;diff=41519&amp;oldid=prev</guid>
			<description>&lt;p&gt;New page: rough pseudocode for what wl1251-cal seems to be doing: wl1251str *handle = libwl1251_init(&amp;quot;wlan0&amp;quot;,0); send dbus message &amp;quot;com.nokia.phone.net&amp;quot; &amp;quot;/com/nokia/phone/net&amp;quot; &amp;quot;Phone.Net&amp;quot; &amp;quot;get_regis...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;rough pseudocode for what wl1251-cal seems to be doing:&lt;br /&gt;
wl1251str *handle = libwl1251_init(&amp;quot;wlan0&amp;quot;,0);&lt;br /&gt;
send dbus message &amp;quot;com.nokia.phone.net&amp;quot; &amp;quot;/com/nokia/phone/net&amp;quot; &amp;quot;Phone.Net&amp;quot; &amp;quot;get_registration_status&amp;quot;&lt;br /&gt;
set country code to uint32 argument 5 of dbus message&lt;br /&gt;
&lt;br /&gt;
wlan-tx-cost3_0 cal data is the nvs data&lt;br /&gt;
default nvs data is in /lib/firmware/wl1251-nvs.bin&lt;br /&gt;
&lt;br /&gt;
flag in r9 controls special change to nvs data.&lt;br /&gt;
If there is a dbus error/problem or if country code is 0, r9 is set to 2&lt;br /&gt;
&lt;br /&gt;
if country code is obtained then it checks for FCC country (302, 310, 311, 316, 312, 313, 314, 315, 332, 466, 724, 722, 334, 732) and if so, sets r9 to 2 else it sets r9 to 1&lt;br /&gt;
&lt;br /&gt;
If r9 is not set to 1, nvs data is changed as follows:&lt;br /&gt;
nvsdata[151] = 2&lt;br /&gt;
nvsdata[154] = 9&lt;br /&gt;
nvsdata[179] = 2&lt;br /&gt;
nvsdata[17C] = 9&lt;br /&gt;
&lt;br /&gt;
nvs data is sent via &lt;br /&gt;
libwl1251_nvs_push(handle,nvsdata+4,0x2F0) //return value &amp;lt;= 0 indicates error)&lt;br /&gt;
&lt;br /&gt;
after nvs stuff this is done&lt;br /&gt;
dbus message is sent &amp;quot;com.nokia.SystemInfo&amp;quot; &amp;quot;/com/nokia/SystemInfo&amp;quot; &amp;quot;com.nokia.SystemInfo&amp;quot; &amp;quot;GetConfigValue&amp;quot; with argument passed in &amp;quot;/certs/npc/esn/wlan_id&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Also able to read wlan mac address from cal by reading wlan-mac&lt;br /&gt;
Then it uses SIOCSIFHWADDR ioctl to set MAC address.&lt;br /&gt;
&lt;br /&gt;
next, if r9 is 1, set r10 to &amp;quot;EU&amp;quot; else set r10 to &amp;quot;US&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Then its calling nl functions and sending a command (via genlmsg_put) with message 27. &amp;quot;nl80211&amp;quot; is passed to genl_ctrl_search_by_name and then genl_family_get_id to obtain family ID.&lt;br /&gt;
Flags, seq, hdrlen and version parameters for genlmsg_put are all zero.&lt;br /&gt;
pid comes from getpid.&lt;br /&gt;
Its calling nla_put(33,3,r10) before it sends the message&lt;br /&gt;
Its registering some callbacks via nl_cb_err and nl_cb_set&lt;br /&gt;
It then appears to loop around with a nl_recvmsgs call in the middle waiting for a callback to trip.&lt;br /&gt;
none of the 3 handlers seem to be doing anything specifically fancy.&lt;br /&gt;
&lt;br /&gt;
After the nl_recvmsgs loop finishes, the function ends.&lt;br /&gt;
&lt;br /&gt;
libwl1251_nvs_push simply loads the nvs data to the card.&lt;br /&gt;
not sure whether anything special is done by libwl1251_init&lt;/div&gt;</description>
			<pubDate>Sun, 30 Jan 2011 18:19:00 GMT</pubDate>			<dc:creator>jonwil</dc:creator>			<comments>http://bugs.maemo.com/Talk:Wl1251-cal</comments>		</item>
	</channel>
</rss>