iPXE
Data Structures | Macros | Enumerations | Functions
iphone.h File Reference

iPhone USB Ethernet driver More...

#include <stdint.h>
#include <ipxe/usb.h>
#include <ipxe/usbnet.h>
#include <ipxe/process.h>
#include <ipxe/timer.h>
#include <ipxe/retry.h>
#include <ipxe/tcp.h>
#include <ipxe/x509.h>
#include <ipxe/privkey.h>

Go to the source code of this file.

Data Structures

struct  icert
 An iPhone pairing certificate set. More...
 
struct  imux_header
 An iPhone USB multiplexed packet header. More...
 
struct  imux_header_version
 An iPhone USB multiplexed version message header. More...
 
struct  imux_header_log
 An iPhone USB multiplexed log message header. More...
 
struct  imux_header_tcp
 An iPhone USB multiplexed pseudo-TCP message header. More...
 
struct  imux
 An iPhone USB multiplexer. More...
 
struct  ipair_header
 An iPhone USB multiplexed pseudo-TCP XML message header. More...
 
struct  ipair
 An iPhone pairing client. More...
 
struct  iphone
 An iPhone network device. More...
 

Macros

#define IMUX_PORT_LOCAL   0x18ae
 Local port number. More...
 
#define IMUX_PORT_LOCKDOWND   62078
 Lockdown daemon port number. More...
 
#define IMUX_WINDOW   0x0200
 Advertised TCP window. More...
 
#define IMUX_IN_MAX_FILL   1
 Multiplexer bulk IN maximum fill level. More...
 
#define IMUX_IN_MTU   4096
 Multiplexer bulk IN buffer size. More...
 
#define IPAIR_RETRY_DELAY   ( 1 * TICKS_PER_SEC )
 Pairing retry delay. More...
 
#define IPHONE_GET_MAC
 Get MAC address. More...
 
#define IPHONE_GET_LINK
 Get link status. More...
 
#define IPHONE_IN_PAD   2
 Bulk IN padding. More...
 
#define IPHONE_IN_MTU   ( ETH_FRAME_LEN + IPHONE_IN_PAD )
 Bulk IN buffer size. More...
 
#define IPHONE_IN_MAX_FILL   8
 Bulk IN maximum fill level. More...
 
#define IPHONE_LINK_CHECK_INTERVAL   ( 5 * TICKS_PER_SEC )
 Link check interval. More...
 

Enumerations

enum  imux_protocol { IMUX_VERSION = 0, IMUX_LOG = 1, IMUX_TCP = IP_TCP }
 iPhone USB multiplexer protocols More...
 
enum  ipair_flags { IPAIR_REQUEST = 0x0001, IPAIR_RX_LEN = 0x0002, IPAIR_TLS = 0x0004 }
 Pairing client state flags. More...
 
enum  iphone_link_status { IPHONE_LINK_DISABLED = 0x03, IPHONE_LINK_UP = 0x04, IPHONE_LINK_UNKNOWN = -1U }
 An iPhone link status. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 

Detailed Description

iPhone USB Ethernet driver

Definition in file iphone.h.

Macro Definition Documentation

◆ IMUX_PORT_LOCAL

#define IMUX_PORT_LOCAL   0x18ae

Local port number.

This is a policy decision.

Definition at line 102 of file iphone.h.

◆ IMUX_PORT_LOCKDOWND

#define IMUX_PORT_LOCKDOWND   62078

Lockdown daemon port number.

Definition at line 105 of file iphone.h.

◆ IMUX_WINDOW

#define IMUX_WINDOW   0x0200

Advertised TCP window.

This is a policy decision.

Definition at line 111 of file iphone.h.

◆ IMUX_IN_MAX_FILL

#define IMUX_IN_MAX_FILL   1

Multiplexer bulk IN maximum fill level.

This is a policy decision.

Definition at line 158 of file iphone.h.

◆ IMUX_IN_MTU

#define IMUX_IN_MTU   4096

Multiplexer bulk IN buffer size.

This is a policy decision.

Definition at line 164 of file iphone.h.

◆ IPAIR_RETRY_DELAY

#define IPAIR_RETRY_DELAY   ( 1 * TICKS_PER_SEC )

Pairing retry delay.

This is a policy decision.

Definition at line 224 of file iphone.h.

◆ IPHONE_GET_MAC

#define IPHONE_GET_MAC
Value:
USB_REQUEST_TYPE ( 0x00 ) )
#define USB_TYPE_VENDOR
Vendor-specific request type.
Definition: usb.h:92
#define USB_DIR_IN
Data transfer is from device to host.
Definition: usb.h:83
#define USB_RECIP_DEVICE
Request recipient is the device.
Definition: usb.h:98

Get MAC address.

Definition at line 234 of file iphone.h.

◆ IPHONE_GET_LINK

#define IPHONE_GET_LINK
Value:
USB_REQUEST_TYPE ( 0x45 ) )
#define USB_TYPE_VENDOR
Vendor-specific request type.
Definition: usb.h:92
#define USB_DIR_IN
Data transfer is from device to host.
Definition: usb.h:83
#define USB_RECIP_DEVICE
Request recipient is the device.
Definition: usb.h:98

Get link status.

Definition at line 239 of file iphone.h.

◆ IPHONE_IN_PAD

#define IPHONE_IN_PAD   2

Bulk IN padding.

Definition at line 271 of file iphone.h.

◆ IPHONE_IN_MTU

#define IPHONE_IN_MTU   ( ETH_FRAME_LEN + IPHONE_IN_PAD )

Bulk IN buffer size.

This is a policy decision.

Definition at line 277 of file iphone.h.

◆ IPHONE_IN_MAX_FILL

#define IPHONE_IN_MAX_FILL   8

Bulk IN maximum fill level.

This is a policy decision.

Definition at line 283 of file iphone.h.

◆ IPHONE_LINK_CHECK_INTERVAL

#define IPHONE_LINK_CHECK_INTERVAL   ( 5 * TICKS_PER_SEC )

Link check interval.

This is a policy decision.

Definition at line 289 of file iphone.h.

Enumeration Type Documentation

◆ imux_protocol

iPhone USB multiplexer protocols

Enumerator
IMUX_VERSION 

Version number.

IMUX_LOG 

Log message.

IMUX_TCP 

TCP packet.

Definition at line 63 of file iphone.h.

63  {
64  /** Version number */
65  IMUX_VERSION = 0,
66  /** Log message */
67  IMUX_LOG = 1,
68  /** TCP packet */
69  IMUX_TCP = IP_TCP,
70 };
TCP packet.
Definition: iphone.h:69
Log message.
Definition: iphone.h:67
Version number.
Definition: iphone.h:65
#define IP_TCP
Definition: in.h:13

◆ ipair_flags

Pairing client state flags.

Enumerator
IPAIR_REQUEST 

Request a new pairing.

IPAIR_RX_LEN 

Standalone length has been received.

IPAIR_TLS 

TLS session has been started.

Definition at line 211 of file iphone.h.

211  {
212  /** Request a new pairing */
213  IPAIR_REQUEST = 0x0001,
214  /** Standalone length has been received */
215  IPAIR_RX_LEN = 0x0002,
216  /** TLS session has been started */
217  IPAIR_TLS = 0x0004,
218 };
Standalone length has been received.
Definition: iphone.h:215
Request a new pairing.
Definition: iphone.h:213
TLS session has been started.
Definition: iphone.h:217

◆ iphone_link_status

An iPhone link status.

Enumerator
IPHONE_LINK_DISABLED 

Personal Hotspot is disabled.

IPHONE_LINK_UP 

Link up.

IPHONE_LINK_UNKNOWN 

Link not yet determined.

Definition at line 244 of file iphone.h.

244  {
245  /** Personal Hotspot is disabled */
246  IPHONE_LINK_DISABLED = 0x03,
247  /** Link up */
248  IPHONE_LINK_UP = 0x04,
249  /** Link not yet determined */
250  IPHONE_LINK_UNKNOWN = -1U,
251 };
Personal Hotspot is disabled.
Definition: iphone.h:246
Link not yet determined.
Definition: iphone.h:250
Link up.
Definition: iphone.h:248

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )