Index: moto_ui/frmconfig_base.ui
===================================================================
--- moto_ui/frmconfig_base.ui	(revision 88)
+++ moto_ui/frmconfig_base.ui	(working copy)
@@ -9,7 +9,7 @@
             <x>0</x>
             <y>0</y>
             <width>620</width>
-            <height>524</height>
+            <height>547</height>
         </rect>
     </property>
     <property name="caption">
@@ -33,7 +33,7 @@
         </property>
         <widget class="QLayoutWidget">
             <property name="name">
-                <cstring>layout4</cstring>
+                <cstring>layout14</cstring>
             </property>
             <hbox>
                 <property name="name">
@@ -86,250 +86,344 @@
                         <attribute name="id">
                             <number>0</number>
                         </attribute>
-                        <vbox>
+                        <grid>
                             <property name="name">
                                 <cstring>unnamed</cstring>
                             </property>
-                            <widget class="QGroupBox">
+                            <widget class="QLayoutWidget" row="0" column="0">
                                 <property name="name">
-                                    <cstring>groupBox1</cstring>
+                                    <cstring>layout13</cstring>
                                 </property>
-                                <property name="title">
-                                    <string>Device Configuration</string>
-                                </property>
                                 <vbox>
                                     <property name="name">
                                         <cstring>unnamed</cstring>
                                     </property>
-                                    <widget class="QLayoutWidget">
+                                    <widget class="QGroupBox">
                                         <property name="name">
-                                            <cstring>layout5</cstring>
+                                            <cstring>groupBox1</cstring>
                                         </property>
+                                        <property name="title">
+                                            <string>Device Configuration</string>
+                                        </property>
                                         <grid>
                                             <property name="name">
                                                 <cstring>unnamed</cstring>
                                             </property>
-                                            <widget class="QLabel" row="3" column="0">
+                                            <widget class="QLayoutWidget" row="0" column="0">
                                                 <property name="name">
-                                                    <cstring>textLabel4_2</cstring>
+                                                    <cstring>layout12</cstring>
                                                 </property>
-                                                <property name="text">
-                                                    <string>P2K Vendor ID:</string>
-                                                </property>
+                                                <vbox>
+                                                    <property name="name">
+                                                        <cstring>unnamed</cstring>
+                                                    </property>
+                                                    <widget class="QLayoutWidget">
+                                                        <property name="name">
+                                                            <cstring>layout11</cstring>
+                                                        </property>
+                                                        <hbox>
+                                                            <property name="name">
+                                                                <cstring>unnamed</cstring>
+                                                            </property>
+                                                            <widget class="QLayoutWidget">
+                                                                <property name="name">
+                                                                    <cstring>layout9</cstring>
+                                                                </property>
+                                                                <vbox>
+                                                                    <property name="name">
+                                                                        <cstring>unnamed</cstring>
+                                                                    </property>
+                                                                    <widget class="QLabel">
+                                                                        <property name="name">
+                                                                            <cstring>textLabel1</cstring>
+                                                                        </property>
+                                                                        <property name="text">
+                                                                            <string>ACM Device:</string>
+                                                                        </property>
+                                                                    </widget>
+                                                                    <widget class="QLabel">
+                                                                        <property name="name">
+                                                                            <cstring>textLabel3</cstring>
+                                                                        </property>
+                                                                        <property name="text">
+                                                                            <string>AT Vendor ID:</string>
+                                                                        </property>
+                                                                    </widget>
+                                                                    <widget class="QLabel">
+                                                                        <property name="name">
+                                                                            <cstring>textLabel4</cstring>
+                                                                        </property>
+                                                                        <property name="text">
+                                                                            <string>AT Product ID:</string>
+                                                                        </property>
+                                                                    </widget>
+                                                                    <widget class="QLabel">
+                                                                        <property name="name">
+                                                                            <cstring>textLabel4_2</cstring>
+                                                                        </property>
+                                                                        <property name="text">
+                                                                            <string>P2K Vendor ID:</string>
+                                                                        </property>
+                                                                    </widget>
+                                                                    <widget class="QLabel">
+                                                                        <property name="name">
+                                                                            <cstring>textLabel4_3</cstring>
+                                                                        </property>
+                                                                        <property name="text">
+                                                                            <string>P2K Product ID:</string>
+                                                                            <comment>P2K Product ID:</comment>
+                                                                        </property>
+                                                                    </widget>
+                                                                    <widget class="QLabel">
+                                                                        <property name="name">
+                                                                            <cstring>textLabel4_3_3</cstring>
+                                                                        </property>
+                                                                        <property name="text">
+                                                                            <string>TFC Vendor ID:</string>
+                                                                            <comment>P2K Product ID:</comment>
+                                                                        </property>
+                                                                    </widget>
+                                                                    <widget class="QLabel">
+                                                                        <property name="name">
+                                                                            <cstring>textLabel4_3_2</cstring>
+                                                                        </property>
+                                                                        <property name="text">
+                                                                            <string>TFC Product ID:</string>
+                                                                            <comment>P2K Product ID:</comment>
+                                                                        </property>
+                                                                    </widget>
+                                                                </vbox>
+                                                            </widget>
+                                                            <widget class="QLayoutWidget">
+                                                                <property name="name">
+                                                                    <cstring>layout10</cstring>
+                                                                </property>
+                                                                <vbox>
+                                                                    <property name="name">
+                                                                        <cstring>unnamed</cstring>
+                                                                    </property>
+                                                                    <widget class="QLineEdit">
+                                                                        <property name="name">
+                                                                            <cstring>txtACMdev</cstring>
+                                                                        </property>
+                                                                    </widget>
+                                                                    <widget class="QLineEdit">
+                                                                        <property name="name">
+                                                                            <cstring>txtATvendor</cstring>
+                                                                        </property>
+                                                                    </widget>
+                                                                    <widget class="QLineEdit">
+                                                                        <property name="name">
+                                                                            <cstring>txtATproduct</cstring>
+                                                                        </property>
+                                                                    </widget>
+                                                                    <widget class="QLineEdit">
+                                                                        <property name="name">
+                                                                            <cstring>txtP2Kvendor</cstring>
+                                                                        </property>
+                                                                    </widget>
+                                                                    <widget class="QLineEdit">
+                                                                        <property name="name">
+                                                                            <cstring>txtP2Kproduct</cstring>
+                                                                        </property>
+                                                                    </widget>
+                                                                    <widget class="QLineEdit">
+                                                                        <property name="name">
+                                                                            <cstring>txtTFCvendor</cstring>
+                                                                        </property>
+                                                                    </widget>
+                                                                    <widget class="QLineEdit">
+                                                                        <property name="name">
+                                                                            <cstring>txtTFCproduct</cstring>
+                                                                        </property>
+                                                                    </widget>
+                                                                </vbox>
+                                                            </widget>
+                                                        </hbox>
+                                                    </widget>
+                                                    <widget class="QCheckBox">
+                                                        <property name="name">
+                                                            <cstring>chkDetachDriver</cstring>
+                                                        </property>
+                                                        <property name="text">
+                                                            <string>Detach &amp;kernel driver</string>
+                                                        </property>
+                                                        <property name="accel">
+                                                            <string>Alt+K</string>
+                                                        </property>
+                                                    </widget>
+                                                    <widget class="QLayoutWidget">
+                                                        <property name="name">
+                                                            <cstring>layout5</cstring>
+                                                        </property>
+                                                        <hbox>
+                                                            <property name="name">
+                                                                <cstring>unnamed</cstring>
+                                                            </property>
+                                                            <widget class="QCheckBox">
+                                                                <property name="name">
+                                                                    <cstring>chkAutoConnect</cstring>
+                                                                </property>
+                                                                <property name="text">
+                                                                    <string>Auto Connect to device</string>
+                                                                </property>
+                                                            </widget>
+                                                            <spacer>
+                                                                <property name="name">
+                                                                    <cstring>spacer3</cstring>
+                                                                </property>
+                                                                <property name="orientation">
+                                                                    <enum>Horizontal</enum>
+                                                                </property>
+                                                                <property name="sizeType">
+                                                                    <enum>Expanding</enum>
+                                                                </property>
+                                                                <property name="sizeHint">
+                                                                    <size>
+                                                                        <width>121</width>
+                                                                        <height>21</height>
+                                                                    </size>
+                                                                </property>
+                                                            </spacer>
+							    <widget class="QLayoutWidget">
+							      <property name="name">
+								<cstring>layout_switches</cstring>
+							      </property>
+							      <hbox>
+								<widget class="QPushButton">
+								  <property name="name">
+                                                                    <cstring>btnSwitchToP2K</cstring>
+								  </property>
+								  <property name="text">
+								    <string>Switch ACM To P2K</string>
+								  </property>
+								</widget>
+								<widget class="QPushButton">
+								  <property name="name">
+								    <cstring>btnSwitchToP2KfromTFC</cstring>
+								  </property>
+								  <property name="text">
+								    <string>Switch TFC To P2K</string>
+								  </property>
+								</widget>
+							      </hbox>
+							    </widget>
+                                                        </hbox>
+                                                    </widget>
+                                                </vbox>
                                             </widget>
-                                            <widget class="QLineEdit" row="3" column="1">
-                                                <property name="name">
-                                                    <cstring>txtP2Kvendor</cstring>
-                                                </property>
-                                            </widget>
-                                            <widget class="QLabel" row="2" column="0">
-                                                <property name="name">
-                                                    <cstring>textLabel4</cstring>
-                                                </property>
-                                                <property name="text">
-                                                    <string>AT Product ID:</string>
-                                                </property>
-                                            </widget>
-                                            <widget class="QLabel" row="0" column="0">
-                                                <property name="name">
-                                                    <cstring>textLabel1</cstring>
-                                                </property>
-                                                <property name="text">
-                                                    <string>ACM Device:</string>
-                                                </property>
-                                            </widget>
-                                            <widget class="QLabel" row="1" column="0">
-                                                <property name="name">
-                                                    <cstring>textLabel3</cstring>
-                                                </property>
-                                                <property name="text">
-                                                    <string>AT Vendor ID:</string>
-                                                </property>
-                                            </widget>
-                                            <widget class="QLabel" row="4" column="0">
-                                                <property name="name">
-                                                    <cstring>textLabel4_3</cstring>
-                                                </property>
-                                                <property name="text">
-                                                    <string>P2K Product ID:</string>
-                                                    <comment>P2K Product ID:</comment>
-                                                </property>
-                                            </widget>
-                                            <widget class="QLineEdit" row="1" column="1">
-                                                <property name="name">
-                                                    <cstring>txtATvendor</cstring>
-                                                </property>
-                                            </widget>
-                                            <widget class="QLineEdit" row="4" column="1">
-                                                <property name="name">
-                                                    <cstring>txtP2Kproduct</cstring>
-                                                </property>
-                                            </widget>
-                                            <widget class="QLineEdit" row="0" column="1">
-                                                <property name="name">
-                                                    <cstring>txtACMdev</cstring>
-                                                </property>
-                                            </widget>
-                                            <widget class="QLineEdit" row="2" column="1">
-                                                <property name="name">
-                                                    <cstring>txtATproduct</cstring>
-                                                </property>
-                                            </widget>
                                         </grid>
                                     </widget>
-                                    <widget class="QCheckBox">
+                                    <widget class="QGroupBox">
                                         <property name="name">
-                                            <cstring>chkDetachDriver</cstring>
+                                            <cstring>groupBox2</cstring>
                                         </property>
-                                        <property name="text">
-                                            <string>Detach kernel driver</string>
+                                        <property name="title">
+                                            <string>USB View</string>
                                         </property>
-                                    </widget>
-                                    <widget class="QLayoutWidget">
-                                        <property name="name">
-                                            <cstring>layout5</cstring>
-                                        </property>
-                                        <hbox>
+                                        <vbox>
                                             <property name="name">
                                                 <cstring>unnamed</cstring>
                                             </property>
-                                            <widget class="QCheckBox">
+                                            <widget class="QListView">
+                                                <column>
+                                                    <property name="text">
+                                                        <string>Vendor ID</string>
+                                                    </property>
+                                                    <property name="clickable">
+                                                        <bool>false</bool>
+                                                    </property>
+                                                    <property name="resizable">
+                                                        <bool>true</bool>
+                                                    </property>
+                                                </column>
+                                                <column>
+                                                    <property name="text">
+                                                        <string>Product ID</string>
+                                                    </property>
+                                                    <property name="clickable">
+                                                        <bool>true</bool>
+                                                    </property>
+                                                    <property name="resizable">
+                                                        <bool>true</bool>
+                                                    </property>
+                                                </column>
+                                                <column>
+                                                    <property name="text">
+                                                        <string>Manufacturer</string>
+                                                    </property>
+                                                    <property name="clickable">
+                                                        <bool>true</bool>
+                                                    </property>
+                                                    <property name="resizable">
+                                                        <bool>true</bool>
+                                                    </property>
+                                                </column>
+                                                <column>
+                                                    <property name="text">
+                                                        <string>Product</string>
+                                                    </property>
+                                                    <property name="clickable">
+                                                        <bool>true</bool>
+                                                    </property>
+                                                    <property name="resizable">
+                                                        <bool>true</bool>
+                                                    </property>
+                                                </column>
                                                 <property name="name">
-                                                    <cstring>chkAutoConnect</cstring>
+                                                    <cstring>lstDevices</cstring>
                                                 </property>
-                                                <property name="text">
-                                                    <string>Auto Connect to device</string>
+                                                <property name="allColumnsShowFocus">
+                                                    <bool>true</bool>
                                                 </property>
                                             </widget>
-                                            <spacer>
+                                            <widget class="QLayoutWidget">
                                                 <property name="name">
-                                                    <cstring>spacer3</cstring>
+                                                    <cstring>layout8</cstring>
                                                 </property>
-                                                <property name="orientation">
-                                                    <enum>Horizontal</enum>
-                                                </property>
-                                                <property name="sizeType">
-                                                    <enum>Expanding</enum>
-                                                </property>
-                                                <property name="sizeHint">
-                                                    <size>
-                                                        <width>121</width>
-                                                        <height>21</height>
-                                                    </size>
-                                                </property>
-                                            </spacer>
-                                            <widget class="QPushButton">
-                                                <property name="name">
-                                                    <cstring>btnSwitchToP2K</cstring>
-                                                </property>
-                                                <property name="text">
-                                                    <string>Switch To P2K</string>
-                                                </property>
+                                                <hbox>
+                                                    <property name="name">
+                                                        <cstring>unnamed</cstring>
+                                                    </property>
+                                                    <widget class="QPushButton">
+                                                        <property name="name">
+                                                            <cstring>btnUpdateList</cstring>
+                                                        </property>
+                                                        <property name="text">
+                                                            <string>Update List</string>
+                                                        </property>
+                                                    </widget>
+                                                    <widget class="QPushButton">
+                                                        <property name="name">
+                                                            <cstring>btnSetAT</cstring>
+                                                        </property>
+                                                        <property name="text">
+                                                            <string>Set As AT Device</string>
+                                                        </property>
+                                                    </widget>
+                                                    <widget class="QPushButton">
+                                                        <property name="name">
+                                                            <cstring>btnSetP2K</cstring>
+                                                        </property>
+                                                        <property name="text">
+                                                            <string>Set As P&amp;2k Device</string>
+                                                        </property>
+                                                    </widget>
+                                                    <widget class="QPushButton">
+                                                        <property name="name">
+                                                            <cstring>btnSetTFC</cstring>
+                                                        </property>
+                                                        <property name="text">
+                                                            <string>Set As &amp;TFC Device</string>
+                                                        </property>
+                                                    </widget>
+                                                </hbox>
                                             </widget>
-                                        </hbox>
+                                        </vbox>
                                     </widget>
                                 </vbox>
                             </widget>
-                            <widget class="QGroupBox">
-                                <property name="name">
-                                    <cstring>groupBox2</cstring>
-                                </property>
-                                <property name="title">
-                                    <string>USB View</string>
-                                </property>
-                                <vbox>
-                                    <property name="name">
-                                        <cstring>unnamed</cstring>
-                                    </property>
-                                    <widget class="QListView">
-                                        <column>
-                                            <property name="text">
-                                                <string>Vendor ID</string>
-                                            </property>
-                                            <property name="clickable">
-                                                <bool>false</bool>
-                                            </property>
-                                            <property name="resizable">
-                                                <bool>true</bool>
-                                            </property>
-                                        </column>
-                                        <column>
-                                            <property name="text">
-                                                <string>Product ID</string>
-                                            </property>
-                                            <property name="clickable">
-                                                <bool>true</bool>
-                                            </property>
-                                            <property name="resizable">
-                                                <bool>true</bool>
-                                            </property>
-                                        </column>
-                                        <column>
-                                            <property name="text">
-                                                <string>Manufacturer</string>
-                                            </property>
-                                            <property name="clickable">
-                                                <bool>true</bool>
-                                            </property>
-                                            <property name="resizable">
-                                                <bool>true</bool>
-                                            </property>
-                                        </column>
-                                        <column>
-                                            <property name="text">
-                                                <string>Product</string>
-                                            </property>
-                                            <property name="clickable">
-                                                <bool>true</bool>
-                                            </property>
-                                            <property name="resizable">
-                                                <bool>true</bool>
-                                            </property>
-                                        </column>
-                                        <property name="name">
-                                            <cstring>lstDevices</cstring>
-                                        </property>
-                                        <property name="allColumnsShowFocus">
-                                            <bool>true</bool>
-                                        </property>
-                                    </widget>
-                                    <widget class="QLayoutWidget">
-                                        <property name="name">
-                                            <cstring>layout8</cstring>
-                                        </property>
-                                        <hbox>
-                                            <property name="name">
-                                                <cstring>unnamed</cstring>
-                                            </property>
-                                            <widget class="QPushButton">
-                                                <property name="name">
-                                                    <cstring>btnUpdateList</cstring>
-                                                </property>
-                                                <property name="text">
-                                                    <string>Update List</string>
-                                                </property>
-                                            </widget>
-                                            <widget class="QPushButton">
-                                                <property name="name">
-                                                    <cstring>btnSetAT</cstring>
-                                                </property>
-                                                <property name="text">
-                                                    <string>Set As AT Device</string>
-                                                </property>
-                                            </widget>
-                                            <widget class="QPushButton">
-                                                <property name="name">
-                                                    <cstring>btnSetP2K</cstring>
-                                                </property>
-                                                <property name="text">
-                                                    <string>Set As P2k Device</string>
-                                                </property>
-                                            </widget>
-                                        </hbox>
-                                    </widget>
-                                </vbox>
-                            </widget>
-                        </vbox>
+                        </grid>
                     </widget>
                     <widget class="QWidget">
                         <property name="name">
@@ -426,10 +520,10 @@
                         <bool>false</bool>
                     </property>
                     <property name="text">
-                        <string>&amp;Help</string>
+                        <string>He&amp;lp</string>
                     </property>
                     <property name="accel">
-                        <string>F1</string>
+                        <string>Alt+L</string>
                     </property>
                     <property name="autoDefault">
                         <bool>true</bool>
@@ -474,10 +568,10 @@
                         <cstring>buttonCancel</cstring>
                     </property>
                     <property name="text">
-                        <string>&amp;Cancel</string>
+                        <string>C&amp;ancel</string>
                     </property>
                     <property name="accel">
-                        <string></string>
+                        <string>Alt+A</string>
                     </property>
                     <property name="autoDefault">
                         <bool>true</bool>
@@ -525,17 +619,31 @@
         <slot>doactSetP2K()</slot>
     </connection>
     <connection>
+        <sender>btnSetTFC</sender>
+        <signal>clicked()</signal>
+        <receiver>frmConfig_base</receiver>
+        <slot>doactSetTFC()</slot>
+    </connection>
+    <connection>
         <sender>btnSwitchToP2K</sender>
         <signal>clicked()</signal>
         <receiver>frmConfig_base</receiver>
         <slot>doactSwitchToP2K()</slot>
     </connection>
+    <connection>
+        <sender>btnSwitchToP2KfromTFC</sender>
+        <signal>clicked()</signal>
+        <receiver>frmConfig_base</receiver>
+        <slot>doactSwitchToP2KfromTFC()</slot>
+    </connection>
 </connections>
 <slots>
     <slot access="private">doactUpdateList()</slot>
     <slot access="private">doactSetAT()</slot>
     <slot access="private">doactSetP2K()</slot>
+    <slot access="private">doactSetTFC()</slot>
     <slot>doactSwitchToP2K()</slot>
+    <slot>doactSwitchToP2KfromTFC()</slot>
 </slots>
 <pixmapinproject/>
 <layoutdefaults spacing="6" margin="11"/>
Index: moto_ui/phoneman.cpp
===================================================================
--- moto_ui/phoneman.cpp	(revision 88)
+++ moto_ui/phoneman.cpp	(working copy)
@@ -54,6 +54,11 @@
 	proc->setP2kconfig(vendor,product);
 }
 
+void PhoneMan::setTFCconfig (unsigned int vendor, unsigned int product)
+{
+	proc->setTFCconfig(vendor,product);
+}
+
 void PhoneMan::setDevice(char * cmd)
 {
 	proc->setDevice(cmd);
@@ -197,6 +202,11 @@
 	proc->drv_switchP2K(st);
 }
 
+void PhoneMan::switchToP2KfromTFC(struct usb_device *dev)
+{
+	proc->drv_switchP2KfromTFC(dev);
+}
+
 int PhoneMan::getDevList(devInfo * lst, int cnt)
 {
 	return proc->phGetDevList(lst, cnt);
Index: moto_ui/appconfig.cpp
===================================================================
--- moto_ui/appconfig.cpp	(revision 88)
+++ moto_ui/appconfig.cpp	(working copy)
@@ -42,6 +42,8 @@
 	cfgATproduct=cfg.readEntry("/moto4lin/device/cfgATproduct","4902").toUInt(0,16);
 	cfgP2Kvendor=cfg.readEntry("/moto4lin/device/cfgP2Kvendor","22b8").toUInt(0,16);
 	cfgP2Kproduct=cfg.readEntry("/moto4lin/device/cfgP2Kproduct","4901").toUInt(0,16);
+	cfgTFCvendor=cfg.readEntry("/moto4lin/device/cfgTFCvendor","22b8").toUInt(0,16);
+	cfgTFCproduct=cfg.readEntry("/moto4lin/device/cfgTFCproduct","4810").toUInt(0,16);
 	cfgAutoConnect=cfg.readNumEntry("/moto4lin/device/cfgAutoConnect",0);
 #ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP
 	cfgDetachDriver=cfg.readNumEntry("/moto4lin/device/cfgDetachDriver",0);
@@ -62,6 +64,8 @@
 	cfg.writeEntry(QString("/moto4lin/device/cfgATproduct"), QString("%1").arg(cfgATproduct,0,16));
 	cfg.writeEntry(QString("/moto4lin/device/cfgP2Kvendor"), QString("%1").arg(cfgP2Kvendor,0,16));
 	cfg.writeEntry(QString("/moto4lin/device/cfgP2Kproduct"), QString("%1").arg(cfgP2Kproduct,0,16));
+	cfg.writeEntry(QString("/moto4lin/device/cfgTFCvendor"), QString("%1").arg(cfgTFCvendor,0,16));
+	cfg.writeEntry(QString("/moto4lin/device/cfgTFCproduct"), QString("%1").arg(cfgTFCproduct,0,16));
 	cfg.writeEntry(QString("/moto4lin/device/cfgAutoConnect"), cfgAutoConnect);
 #ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP
 	cfg.writeEntry(QString("/moto4lin/device/cfgDetachDriver"), cfgDetachDriver);
Index: moto_ui/frmconfig.cpp
===================================================================
--- moto_ui/frmconfig.cpp	(revision 88)
+++ moto_ui/frmconfig.cpp	(working copy)
@@ -22,6 +22,7 @@
 #include <qstring.h>
 #include <qlineedit.h>
 #include <qcheckbox.h>
+#include <qmessagebox.h>
 #include <usb.h>
  
 #include "frmconfig.h"
@@ -66,6 +67,32 @@
 	phone->switchToP2K(dv);
 }
 
+void frmConfig::doactSwitchToP2KfromTFC()
+{
+  unsigned int vendor = txtTFCvendor->text().toUInt(0,16);
+  unsigned int product = txtTFCproduct->text().toUInt(0,16);
+  struct usb_bus *busses;
+
+  usb_init();
+  usb_find_busses();
+  usb_find_devices();
+
+  busses = usb_get_busses();
+
+  struct usb_bus *bus;
+  for (bus = busses; bus; bus = bus->next) {
+    struct usb_device *dev;
+
+    for (dev = bus->devices; dev; dev = dev->next) {
+      if (dev->descriptor.idVendor == vendor && dev->descriptor.idProduct == product) {
+	phone->switchToP2KfromTFC(dev);
+	return;
+      }
+    }
+  }
+  QMessageBox::critical(this, QObject::tr("Device not found"), QObject::tr("No device found with this TFC IDs on the available USB buses."));
+}
+
 void frmConfig::doactSetAT()
 {
 	QListViewItem * itm = lstDevices->selectedItem();
@@ -81,3 +108,11 @@
 	txtP2Kvendor->setText(itm->text(0));
 	txtP2Kproduct->setText(itm->text(1));
 }
+
+void frmConfig::doactSetTFC()
+{
+	QListViewItem * itm = lstDevices->selectedItem();
+	if (itm == NULL) return;
+	txtTFCvendor->setText(itm->text(0));
+	txtTFCproduct->setText(itm->text(1));
+}
Index: moto_ui/phoneman.h
===================================================================
--- moto_ui/phoneman.h	(revision 88)
+++ moto_ui/phoneman.h	(working copy)
@@ -29,8 +29,8 @@
 
 #include <qobject.h>
 #include <qptrlist.h>
+#include <usb.h>
 
-
 #include "p2kproc.h"
 #include "custmsg.h"
 
@@ -52,6 +52,7 @@
 	
 	void customEvent(QCustomEvent *);	
 	void switchToP2K(char * st);
+	void switchToP2KfromTFC(struct usb_device *dev);
 	void openPhone();
 	void closePhone();
 	void rebootPhone();
@@ -72,6 +73,7 @@
 	
 	void setATconfig (unsigned int vendor, unsigned int product);
 	void setP2kconfig (unsigned int vendor, unsigned int product);
+	void setTFCconfig (unsigned int vendor, unsigned int product);
 	void setDevice(char * cmd);
 	int getDevList(devInfo * lst, int cnt);
 
Index: moto_ui/appconfig.h
===================================================================
--- moto_ui/appconfig.h	(revision 88)
+++ moto_ui/appconfig.h	(working copy)
@@ -42,6 +42,8 @@
 	unsigned int cfgATproduct;
 	unsigned int cfgP2Kvendor;
 	unsigned int cfgP2Kproduct;
+	unsigned int cfgTFCvendor;
+	unsigned int cfgTFCproduct;
 	char cfgAutoConnect;
 	char cfgAutoUpdateFileList;
 	char cfgAutoExpandDirTree;
Index: moto_ui/frmconfig.h
===================================================================
--- moto_ui/frmconfig.h	(revision 88)
+++ moto_ui/frmconfig.h	(working copy)
@@ -41,8 +41,10 @@
 	
 	void doactUpdateList();
 	void doactSwitchToP2K();
+	void doactSwitchToP2KfromTFC();
 	void doactSetAT();
 	void doactSetP2K();	
+	void doactSetTFC();
 };
 
 #endif
Index: moto_ui/p2kproc.cpp
===================================================================
--- moto_ui/p2kproc.cpp	(revision 88)
+++ moto_ui/p2kproc.cpp	(working copy)
@@ -122,6 +122,10 @@
 	devlst[2].vendor=DEF_PHONE_P2K_VENDOR;
 	devlst[2].product=DEF_PHONE_P2K_PRODUCT;
 	strcpy(devlst[2].name,"P2K");
+
+	devlst[3].vendor=DEF_PHONE_TFC_VENDOR;
+	devlst[3].product=DEF_PHONE_TFC_PRODUCT;
+	strcpy(devlst[3].name,"TFC");
 }
 
 
@@ -137,6 +141,12 @@
 	devlst[2].product=product;
 }
 
+void P2kProc::setTFCconfig (unsigned int vendor, unsigned int product)
+{
+	devlst[3].vendor=vendor;
+	devlst[3].product=product;
+}
+
 void P2kProc::setDevice(char * cmd)
 {
 	strcpy(ACMdev,cmd);
@@ -259,7 +269,7 @@
 		if (pm==0)
 			postMessage(MSGSTYLE_INFO, QObject::tr("Phone is unpluged"));
 		else
-			postMessage(MSGSTYLE_INFO, QObject::tr("Phone pluged as %1").arg(devlst[pm].name));
+			postMessage(MSGSTYLE_INFO, QObject::tr("Phone plugged as %1").arg(devlst[pm].name));
 		phoneMode=pm;
 	}
 }
@@ -789,7 +799,7 @@
 // Return Current phone state
 int P2kProc::drv_findPhone()
 {
-	for (int i=1; i<=2; i++)
+	for (int i=1; i<=3; i++)
 	{
 		phone=(drv_findDevice(devlst[i].vendor, devlst[i].product));
 		if (phone)  return(i);
@@ -880,6 +890,61 @@
 	return 1;
 }
 
+// Return !=0 if switch is ok.
+int P2kProc::drv_switchP2KfromTFC(struct usb_device *_phone)
+{
+  struct usb_dev_handle* handle;
+  postMessage(MSGSTYLE_INFO, QObject::tr("Switching phone to P2K mode from TFC mode..."));
+  if (_phone!=NULL) handle = usb_open(_phone);
+  else handle = usb_open(phone);
+  if (handle==NULL) {
+    postMessage(MSGSTYLE_ERROR, QObject::tr("Unable to open device"));
+    postMessage(MSGSTYLE_ERROR, QObject::tr("Please check preferences"));
+    return 0;
+  }
+  int ret = usb_claim_interface(handle, 0);
+  if (ret < 0) {
+    postMessage(MSGSTYLE_INFO, QObject::tr("Device busy"));
+    #ifdef LIBUSB_HAS_GET_DRIVER_NP
+    if(errno == EBUSY) {
+      postMessage(MSGSTYLE_INFO, QObject::tr("We try to unbind competing drivers..."));
+      if (usb_detach_kernel_driver_np(handle, 0) < 0) postMessage(MSGSTYLE_INFO, QObject::tr("Detach failed."));
+      else {
+	postMessage(MSGSTYLE_INFO, QObject::tr("Detach succeeded."));
+	if ((ret=usb_claim_interface(handle, 0)) < 0) postMessage(MSGSTYLE_INFO, QObject::tr("But still can't claim :-("));
+      }
+    }
+    #endif
+  }
+  if (ret < 0) {
+    postMessage(MSGSTYLE_INFO, QObject::tr("Can't claim the interface!"));
+    return 0;
+  }
+  else postMessage(MSGSTYLE_INFO, QObject::tr("Interface claimed."));
+
+  char buf[31] = {0x55, 0x53, 0x42, 0x43, // dcbw signature
+		  0x48, 0x5a, 0x9d, 0xff, // dcbw tag
+		  0x00, 0x00, 0x00, 0x00, // dcbw data transfer length, there will be no data transfer
+		  0x00, // flags: 0
+		  0x00, // lun: 0
+		  0x0c, // length of the command block: next 12 bytes
+		  0xd6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, // command
+		  0x00, 0x00, 0x00, 0x00}; // padding
+
+  if (usb_bulk_write(handle, 0x1, buf, 31, 1000) < 0) {
+    postMessage(MSGSTYLE_INFO, QObject::tr("Write failed."));
+    return 0;
+  }
+  if (usb_bulk_write(handle, 0x1, buf, 31, 1000) < 0) {
+    postMessage(MSGSTYLE_INFO, QObject::tr("Second write failed."));
+    return 0;
+  }
+  usb_release_interface(handle, 0);
+  usb_close(handle);
+  sleep(1);
+  return 1;
+}
+
 // Open phone
 int P2kProc::drv_openPhone()
 {
@@ -941,7 +1006,7 @@
 	int ph=drv_findPhone();
 	if (ph==PHONE_NONE)
 	{
-		postMessage(MSGSTYLE_ERROR, QObject::tr("No phone found. Check preferences for AT Vendor/Product ID"));
+		postMessage(MSGSTYLE_ERROR, QObject::tr("No phone found. Check preferences for AT (and TFC) Vendor/Product ID"));
 		RAISE("no phone")
 	}
 	if (ph==PHONE_AT)
@@ -950,6 +1015,12 @@
 		if (!drv_switchP2K())
 			return -1;
 	}
+	if (ph==PHONE_TFC)
+	{
+		postMessage(MSGSTYLE_INFO, QObject::tr("TFC phone found"));
+		if (!drv_switchP2KfromTFC())
+			return -1;
+	}
 
 	int t;
 	t=time(NULL);
Index: moto_ui/form1.cpp
===================================================================
--- moto_ui/form1.cpp	(revision 88)
+++ moto_ui/form1.cpp	(working copy)
@@ -285,6 +285,7 @@
 	phone->setDevice(myCfg->cfgACMdevice);
 	phone->setATconfig(myCfg->cfgATvendor, myCfg->cfgATproduct);
 	phone->setP2kconfig(myCfg->cfgP2Kvendor, myCfg->cfgP2Kproduct);
+	phone->setTFCconfig(myCfg->cfgTFCvendor, myCfg->cfgTFCproduct);
 }
 
 void Form1::doactPreferences()
@@ -306,6 +307,8 @@
 	f1.txtATproduct->setText(QString("%1").arg(myCfg->cfgATproduct,0,16).rightJustify(4,'0'));
 	f1.txtP2Kvendor->setText(QString("%1").arg(myCfg->cfgP2Kvendor,0,16).rightJustify(4,'0'));
 	f1.txtP2Kproduct->setText(QString("%1").arg(myCfg->cfgP2Kproduct,0,16).rightJustify(4,'0'));
+	f1.txtTFCvendor->setText(QString("%1").arg(myCfg->cfgTFCvendor,0,16).rightJustify(4,'0'));
+	f1.txtTFCproduct->setText(QString("%1").arg(myCfg->cfgTFCproduct,0,16).rightJustify(4,'0'));
 	
 	f1.chkAutoConnect->setChecked(myCfg->cfgAutoConnect);
 #ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP
@@ -328,6 +331,8 @@
 	myCfg->cfgATproduct=f1.txtATproduct->text().toUInt(0,16);
 	myCfg->cfgP2Kvendor=f1.txtP2Kvendor->text().toUInt(0,16);
 	myCfg->cfgP2Kproduct=f1.txtP2Kproduct->text().toUInt(0,16);
+	myCfg->cfgTFCvendor=f1.txtTFCvendor->text().toUInt(0,16);
+	myCfg->cfgTFCproduct=f1.txtTFCproduct->text().toUInt(0,16);
 	
 	myCfg->cfgAutoConnect=f1.chkAutoConnect->isChecked();
 #ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP
Index: moto_ui/p2kproc.h
===================================================================
--- moto_ui/p2kproc.h	(revision 88)
+++ moto_ui/p2kproc.h	(working copy)
@@ -37,6 +37,10 @@
 #define DEF_PHONE_P2K_VENDOR 0x22b8
 #define DEF_PHONE_P2K_PRODUCT 0x4901
 
+// Phone P2K Vendor/Product ID
+#define DEF_PHONE_TFC_VENDOR 0x22b8
+#define DEF_PHONE_TFC_PRODUCT 0x4810
+
 // ========================================================
 
 
@@ -62,6 +66,7 @@
 #define PHONE_NONE 0
 #define PHONE_AT 1
 #define PHONE_P2K 2
+#define PHONE_TFC 3
 
 #include <usb.h>
 #include <qevent.h>
@@ -139,11 +144,13 @@
 	
 	void setATconfig (unsigned int vendor, unsigned int product);
 	void setP2kconfig (unsigned int vendor, unsigned int product);
+	void setTFCconfig (unsigned int vendor, unsigned int product);
 	void setDevice(char * cmd);
 	int phGetDevList(devInfo * lst, int cnt);
 	int drv_switchP2K(char * st = NULL);
+	int drv_switchP2KfromTFC(struct usb_device *_phone = NULL);
 private:
-	myDev devlst[3];
+	myDev devlst[4];
 	char ACMdev[1024];
 	QString lastStr;
 	QObject * parent;
