]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
caif: Add debug connection type for CAIF.
authorSjur Braendeland <sjur.brandeland@stericsson.com>
Thu, 17 Jun 2010 06:55:41 +0000 (06:55 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Jun 2010 02:46:07 +0000 (19:46 -0700)
Added new CAIF protocol type CAIFPROTO_DEBUG for accessing
CAIF debug on the ST Ericsson modems.

There are two debug servers on the modem, one for radio related
debug (CAIF_RADIO_DEBUG_SERVICE) and the other for
communication/application related debug (CAIF_COM_DEBUG_SERVICE).

The debug connection can contain trace debug printouts or
interactive debug used for debugging and test.

Debug connections can be of type STREAM or SEQPACKET.

Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/caif/caif_socket.h
net/caif/caif_config_util.c

index 2a61eb1beb85318bcd1972014a52fd8e3dff6519..d9cb19b7cff79c03feaed0421169ada719fd2b2b 100644 (file)
@@ -62,6 +62,7 @@ enum caif_channel_priority {
  * @CAIFPROTO_DATAGRAM_LOOP:   Datagram loopback channel, used for testing.
  * @CAIFPROTO_UTIL:            Utility (Psock) channel.
  * @CAIFPROTO_RFM:             Remote File Manager
+ * @CAIFPROTO_DEBUG:           Debug link
  *
  * This enum defines the CAIF Channel type to be used. This defines
  * the service to connect to on the modem.
@@ -72,6 +73,7 @@ enum caif_protocol_type {
        CAIFPROTO_DATAGRAM_LOOP,
        CAIFPROTO_UTIL,
        CAIFPROTO_RFM,
+       CAIFPROTO_DEBUG,
        _CAIFPROTO_MAX
 };
 #define        CAIFPROTO_MAX _CAIFPROTO_MAX
@@ -83,6 +85,28 @@ enum caif_protocol_type {
 enum caif_at_type {
        CAIF_ATTYPE_PLAIN = 2
 };
+ /**
+ * enum caif_debug_type - Content selection for debug connection
+ * @CAIF_DEBUG_TRACE_INTERACTIVE: Connection will contain
+ *                             both trace and interactive debug.
+ * @CAIF_DEBUG_TRACE:          Connection contains trace only.
+ * @CAIF_DEBUG_INTERACTIVE:    Connection to interactive debug.
+ */
+enum caif_debug_type {
+       CAIF_DEBUG_TRACE_INTERACTIVE = 0,
+       CAIF_DEBUG_TRACE,
+       CAIF_DEBUG_INTERACTIVE,
+};
+
+/**
+ * enum caif_debug_service - Debug Service Endpoint
+ * @CAIF_RADIO_DEBUG_SERVICE:  Debug service on the Radio sub-system
+ * @CAIF_APP_DEBUG_SERVICE:    Debug for the applications sub-system
+ */
+enum caif_debug_service {
+       CAIF_RADIO_DEBUG_SERVICE = 1,
+       CAIF_APP_DEBUG_SERVICE
+};
 
 /**
  * struct sockaddr_caif - the sockaddr structure for CAIF sockets.
@@ -109,6 +133,12 @@ enum caif_at_type {
  *
  * @u.rfm.volume:            Volume to mount.
  *
+ * @u.dbg:                   Applies when family = CAIFPROTO_DEBUG.
+ *
+ * @u.dbg.type:                             Type of debug connection to set up
+ *                           (caif_debug_type).
+ *
+ * @u.dbg.service:           Service sub-system to connect (caif_debug_service
  * Description:
  * This structure holds the connect parameters used for setting up a
  * CAIF Channel. It defines the service to connect to on the modem.
@@ -130,6 +160,10 @@ struct sockaddr_caif {
                        __u32 connection_id;
                        char      volume[16];
                } rfm;                          /* CAIFPROTO_RFM */
+               struct {
+                       __u8  type;             /* type:enum caif_debug_type */
+                       __u8  service;          /* service:caif_debug_service */
+               } dbg;                          /* CAIFPROTO_DEBUG */
        } u;
 };
 
index 6f36580366f0c2c5ecd1347f72098aaf06d78e5a..76ae68303d3a3675265e61eccc213a0c4526d4e1 100644 (file)
@@ -79,6 +79,11 @@ int connect_req_to_link_param(struct cfcnfg *cnfg,
                memcpy(l->u.utility.params, s->param.data,
                       l->u.utility.paramlen);
 
+               break;
+       case CAIFPROTO_DEBUG:
+               l->linktype = CFCTRL_SRV_DBG;
+               l->endpoint = s->sockaddr.u.dbg.service;
+               l->chtype = s->sockaddr.u.dbg.type;
                break;
        default:
                return -EINVAL;