<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://maemo.octonezd.me/index.php?action=history&amp;feed=atom&amp;title=Wl1251-cal</id>
	<title>Wl1251-cal - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://maemo.octonezd.me/index.php?action=history&amp;feed=atom&amp;title=Wl1251-cal"/>
	<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=Wl1251-cal&amp;action=history"/>
	<updated>2026-04-22T07:26:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Wl1251-cal&amp;diff=43507&amp;oldid=prev</id>
		<title>imported_&gt;jonwil at 18:19, 30 January 2011</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=Wl1251-cal&amp;diff=43507&amp;oldid=prev"/>
		<updated>2011-01-30T18:19:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&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; id=&quot;mw-diff-left-l1&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; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;rough pseudocode for what wl1251-cal seems to be doing:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;wl1251str *handle = libwl1251_init(&amp;quot;wlan0&amp;quot;,0);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&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; id=&quot;mw-diff-left-l41&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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;not sure whether anything special is done by libwl1251_init&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&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; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;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;/table&gt;</summary>
		<author><name>imported_&gt;jonwil</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Wl1251-cal&amp;diff=43508&amp;oldid=prev</id>
		<title>imported_&gt;jonwil: 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 rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=Wl1251-cal&amp;diff=43508&amp;oldid=prev"/>
		<updated>2011-01-30T18:19:00Z</updated>

		<summary type="html">&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;</summary>
		<author><name>imported_&gt;jonwil</name></author>
	</entry>
</feed>