Minor patch for ipheth (iPhone ethernet interface)

From: Dirk-Willem van Gulik <dirkx_at_webweaving.org>
Date: Wed, 14 Aug 2024 18:59:12 UTC
Trivial suggested patch - as I keep having to reconstruct this from time to time. And my guess is that anyone who uses ipheth(4) will need to contract this regardless. 

Or is it better to propose a /etc/devd/ipheth.conf to be added when ipheth(4) is installed ?

Dw

*** ipheth.4.orig Wed Aug 14 20:43:06 2024
--- ipheth.4 Wed Aug 14 20:54:50 2024
***************
*** 154,159 ****
--- 154,191 ----
  That is it.
  The machine should now be connected to the network via USB tethering.
  .El
+ .Sh DEVD
+  
+ It is possible to automaticaly bring up the iphone ethernet interface using.
+ device state change daemon (
+ .Xr devd 8
+ ) integration.  For this - add the following lines to  
+ .Xr devd.conf 5
+ or, alternatively,  by creating a file in /usr/local/etc/devd/ipheth.conf with:
+ .Bd -literal -offset 2n
+ notify 100 {
+         match "system"          "USB";
+         match "subsystem"       "INTERFACE";
+         match "type"            "ATTACH";
+  
+         match "vendor"         "0x05ac";
+         match "product" "0x12a8";
+  
+         action "logger iPhone detected, configuring for tethering";
+         # see the ipheth man page on how to derive the number '3' in below.
+         action "/usr/sbin/usbconfig -d $cdev set_config 3";
+ };
+ .Ed
+ .Pp
+ Once added; restart the  
+ .Xr devd 8
+ daemon with:
+ .Bd -literal -offset 2n
+ .Li # Ic service devd restart
+ .Ed
+ .Pp
+ .Xr ipheth 4 should now be brought up each time an iPhone is plugged in.
+ .El
  .Sh SEE ALSO
  .Xr arp 4 ,
  .Xr cdce 4 ,