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

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)
 FILE_SECBOOT (PERMITTED)

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 103 of file iphone.h.

Referenced by imux_probe().

◆ IMUX_PORT_LOCKDOWND

#define IMUX_PORT_LOCKDOWND   62078

Lockdown daemon port number.

Definition at line 106 of file iphone.h.

Referenced by imux_tx_tcp().

◆ IMUX_WINDOW

#define IMUX_WINDOW   0x0200

Advertised TCP window.

This is a policy decision.

Definition at line 112 of file iphone.h.

Referenced by imux_tx_tcp().

◆ IMUX_IN_MAX_FILL

#define IMUX_IN_MAX_FILL   1

Multiplexer bulk IN maximum fill level.

This is a policy decision.

Definition at line 159 of file iphone.h.

Referenced by imux_probe().

◆ IMUX_IN_MTU

#define IMUX_IN_MTU   4096

Multiplexer bulk IN buffer size.

This is a policy decision.

Definition at line 165 of file iphone.h.

Referenced by imux_probe().

◆ IPAIR_RETRY_DELAY

#define IPAIR_RETRY_DELAY   ( 1 * TICKS_PER_SEC )

Pairing retry delay.

This is a policy decision.

Definition at line 225 of file iphone.h.

Referenced by ipair_rx_pair_error().

◆ IPHONE_GET_MAC

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

Get MAC address.

Definition at line 235 of file iphone.h.

235#define IPHONE_GET_MAC \
236 ( USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE | \
237 USB_REQUEST_TYPE ( 0x00 ) )

Referenced by iphone_probe().

◆ IPHONE_GET_LINK

#define IPHONE_GET_LINK
Value:
USB_REQUEST_TYPE ( 0x45 ) )

Get link status.

Definition at line 240 of file iphone.h.

240#define IPHONE_GET_LINK \
241 ( USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE | \
242 USB_REQUEST_TYPE ( 0x45 ) )

Referenced by iphone_check_link().

◆ IPHONE_IN_PAD

#define IPHONE_IN_PAD   2

Bulk IN padding.

Definition at line 272 of file iphone.h.

Referenced by iphone_in_complete().

◆ 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 278 of file iphone.h.

Referenced by iphone_probe().

◆ IPHONE_IN_MAX_FILL

#define IPHONE_IN_MAX_FILL   8

Bulk IN maximum fill level.

This is a policy decision.

Definition at line 284 of file iphone.h.

Referenced by iphone_probe().

◆ IPHONE_LINK_CHECK_INTERVAL

#define IPHONE_LINK_CHECK_INTERVAL   ( 5 * TICKS_PER_SEC )

Link check interval.

This is a policy decision.

Definition at line 290 of file iphone.h.

Referenced by iphone_expired().

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 64 of file iphone.h.

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

◆ 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 212 of file iphone.h.

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

◆ 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 245 of file iphone.h.

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

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )