Skip to content

Commit b3d6255

Browse files
Kumar Sanghvidavem330
authored andcommitted
Phonet: 'connect' socket implementation for Pipe controller
Based on suggestion by Rémi Denis-Courmont to implement 'connect' for Pipe controller logic, this patch implements 'connect' socket call for the Pipe controller logic. The patch does following:- - Removes setsockopts for PNPIPE_CREATE and PNPIPE_DESTROY - Adds setsockopt for setting the Pipe handle value - Implements connect socket call - Updates the Pipe controller logic User-space should now follow below sequence with Pipe controller:- -socket -bind -setsockopt for PNPIPE_PIPE_HANDLE -connect -setsockopt for PNPIPE_ENCAP_IP -setsockopt for PNPIPE_ENABLE GPRS/3G data has been tested working fine with this. Signed-off-by: Kumar Sanghvi <kumar.sanghvi@stericsson.com> Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 7368ddf commit b3d6255

4 files changed

Lines changed: 215 additions & 191 deletions

File tree

‎include/linux/phonet.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@
3636
/* Socket options for SOL_PNPIPE level */
3737
#define PNPIPE_ENCAP 1
3838
#define PNPIPE_IFINDEX 2
39-
#define PNPIPE_CREATE 3
39+
#define PNPIPE_PIPE_HANDLE 3
4040
#define PNPIPE_ENABLE 4
4141
/* unused slot */
42-
#define PNPIPE_DESTROY 6
4342

4443
#define PNADDR_ANY 0
4544
#define PNADDR_BROADCAST 0xFC

‎include/net/phonet/pep.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ struct pep_sock {
4646
u8 init_enable; /* auto-enable at creation */
4747
u8 aligned;
4848
#ifdef CONFIG_PHONET_PIPECTRLR
49-
u16 remote_pep;
50-
u8 pipe_state;
49+
u8 pipe_state;
50+
struct sockaddr_pn remote_pep;
5151
#endif
5252
};
5353

0 commit comments

Comments
 (0)