Skip to contentSkip to conversation

Topcliff: Update PCH_IEEE1588 driver to 2.6.35

PATCH Masayuki Ohtake 2 participants 3 messages Aug 11, 2010

lore
Share & tools
lore
#0 lore raw

Hi Qi-san

I have found Macro 'TRUE' and 'FALSE' are used as setting value in the driver; still, can't I use TRUE/FALSE macro ?
If not, How should we implement ?

+static u32 pch_interrupt_pending(struct pch_dev *pch_pdata) +{
+
+ if (pch_pps_evt_get(pch_pdata) || pch_amms_evt_get(pch_pdata) ||
+ pch_asms_evt_get(pch_pdata) || pch_ttm_evt_get(pch_pdata)) {
+ pending = TRUE;
+ } else {
+ pending = FALSE;
+ }

+static enum pch_status +pch_ptp_port_config_set(enum pch_ptpport ptpport, +{
+
+ if (ptpportmode == PCH_1588PTP_PORT_MASTER) {
+ master_mode = TRUE;
+ timestamp_set = FALSE;
+ } else if (ptpportmode == PCH_1588PTP_PORT_SLAVE) {
+ master_mode = FALSE;
+ timestamp_set = FALSE;
+ } else if (ptpportmode == PCH_1588PTP_PORT_ANYMODE) {
+ master_mode = FALSE;
+ timestamp_set = TRUE;
+ } else {

Thanks, Ohtake

----- Original Message -----
From: "Masayuki Ohtake" <[email protected]>
To: "Wang, Qi" <[email protected]>; "Greg KH" <[email protected]>
Cc: <[email protected]>; "Khor, Andrew Chih Howe" <[email protected]>; "Wang, Yong Y" <[email protected]>; "LKML" <[email protected]>; <[email protected]>
Sent: Wednesday, August 11, 2010 11:31 AM
Subject: Re: [MeeGo-Dev][PATCH] Topcliff: Update PCH_IEEE1588 driver to 2.6.35

Quoted 252 lines

Hi Qi,

Quoted 2 lines

if (a == TRUE).... isn't necessary. Just if (a)... so you needn't 'TRUE'. If (a == FALSE)... isn't necessary also. Just if (!a)..

I understand.
I will delete TRUE/FALSE definition.

Thanks, Ohtake.

----- Original Message -----
From: "Wang, Qi" <[email protected]>
To: "Masayuki Ohtake" <[email protected]>; "Greg KH" <[email protected]>
Cc: <[email protected]>; "Khor, Andrew Chih Howe" <[email protected]>; "Wang, Yong Y" <[email protected]>; "LKML" <[email protected]>; <[email protected]>
Sent: Wednesday, August 11, 2010 11:18 AM
Subject: RE: [MeeGo-Dev][PATCH] Topcliff: Update PCH_IEEE1588 driver to 2.6.35

Quoted 232 lines
Quoted 13 lines

-----Original Message-----
From: Masayuki Ohtake [mailto:[email protected]]
Sent: Wednesday, August 11, 2010 10:15 AM
To: Greg KH; Wang, Qi
Cc: [email protected]; Khor, Andrew Chih Howe; Wang, Yong Y; LKML; [email protected]
Subject: Re: [MeeGo-Dev][PATCH] Topcliff: Update PCH_IEEE1588 driver to 2.6.35

Quoted 4 lines
Quoted 4 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+#define TRUE 1
+#define FALSE 0

These lines should not be needed at all.

Quoted 6 lines
Quoted 1 line

OKI-san, please remove them, Those definition is useless.

Is the above definition is necessary?
I can't find appropriate header file defines 'TRUE' and 'FALSE'. In addition, some drivers have these definitions.
For example, drivers/char/mwave/smapi.h has the above definitions.

if (a == TRUE).... isn't necessary. Just if (a)... so you needn't 'TRUE'. If (a == FALSE)... isn't necessary also. Just if (!a)..

Best Regards,
Qi.

Quoted 205 lines

Thanks, Ohtake
----- Original Message -----
From: "Wang, Qi" <[email protected]>
To: "Greg KH" <[email protected]>; "Masayuki Ohtak" <[email protected]>
Cc: <[email protected]>; "LKML" <[email protected]>; "Wang, Yong Y" <[email protected]>; "Khor, Andrew
Chih Howe" <[email protected]>; <[email protected]>
Sent: Wednesday, August 11, 2010 10:20 AM
Subject: RE: [MeeGo-Dev][PATCH] Topcliff: Update PCH_IEEE1588 driver to 2.6.35

Quoted 9 lines
Quoted 9 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Wednesday, August 11, 2010 1:14 AM
To: Masayuki Ohtak
Cc: [email protected]; LKML; Wang, Qi; Wang, Yong Y; Khor, Andrew Chih Howe; [email protected]
Subject: Re: [MeeGo-Dev][PATCH] Topcliff: Update PCH_IEEE1588 driver to 2.6.35

Quoted 7 lines
Quoted 7 lines · Masayuki Ohtak
Quoted 6 lines

IEEE1588 driver of Topcliff PCH

Topcliff PCH is the platform controller hub that is going to be used in Intel's upcoming general embedded platform. All IO peripherals in Topcliff PCH are actually devices sitting on AMBA bus. Topcliff PCH has IEEE1588 I/F. This driver enables IEEE1588 function on

CAN

Quoted 7 lines
Quoted 5 lines

or

Quoted 1 line

Ethernet communications.

So it's a CAN or Ethernet driver? If so, why isn't this a network driver like the CAN and Ethernet drivers?

This socket CAN drivers which can use Berkeley socket API, and the Linux

network stack and implements the CAN device
drivers as network interfaces.

Quoted 41 lines
Quoted 14 lines

Review

Quoted 12 lines
(quoted diff) +11 -0
+#ifdef __GNUC__
+#define UNUSED __attribute__ ((unused))
+#define UNUSED_ARG(x)
+#else
+#define UNUSED
+#define UNUSED_ARG(x) (void) x
+#endif
+
+
+#define TRUE 1
+#define FALSE 0

These lines should not be needed at all.

OKI-san, please remove them, Those definition is useless.

Quoted 26 lines
Quoted 2 lines

+#define IOC_1588_BASE 0xf8

Do you have documentation for these new ioctls you are creating? It's a lot of them:

Review

Quoted 7 lines
(quoted diff) +7 -0
+#define IOCTL_1588_PORT_CONFIG_SET \
+ _IOW(IOC_1588_BASE, 0, struct pch_portcfg_ioctl)
+
+#define IOCTL_1588_PORT_CONFIG_GET \
+ _IOWR(IOC_1588_BASE, 1, struct pch_portcfg_ioctl)
+
+#define IOCTL_1588_RX_POLL _IOWR(IOC_1588_BASE, 2, struct

pch_rxtxpoll_ioctl)

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+#define IOCTL_1588_TX_POLL _IOWR(IOC_1588_BASE, 3, struct

pch_rxtxpoll_ioctl)

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+#define IOCTL_1588_CAN_POLL _IOWR(IOC_1588_BASE, 4, struct

pch_canpoll_ioctl)

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+#define IOCTL_1588_SYS_TIME_GET _IOR(IOC_1588_BASE, 5, struct

pch_tim_val)

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+#define IOCTL_1588_SYS_TIME_SET _IOW(IOC_1588_BASE, 6, struct

pch_tim_val)

Quoted 6 lines
Quoted 6 lines

Review

Quoted 6 lines
(quoted diff) +6 -0
+
+#define IOCTL_1588_TICK_RATE_SET _IOW(IOC_1588_BASE, 7, __u32)
+
+#define IOCTL_1588_TICK_RATE_GET _IOR(IOC_1588_BASE, 8, __u32)
+
+#define IOCTL_1588_TARG_TIME_INTRPT_ENABLE _IO(IOC_1588_BASE,

9)

Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+#define IOCTL_1588_TARG_TIME_INTRPT_DISABLE

_IO(IOC_1588_BASE,

Quoted 12 lines
Quoted 12 lines

10)

Review

Quoted 11 lines
(quoted diff) +11 -0
+
+#define IOCTL_1588_TARG_TIME_POLL \
+ _IOR(IOC_1588_BASE, 11, struct pch_timepoll_ioctl)
+
+#define IOCTL_1588_TARG_TIME_SET \
+ _IOW(IOC_1588_BASE, 12, struct pch_tim_val)
+
+#define IOCTL_1588_TARG_TIME_GET \
+ _IOR(IOC_1588_BASE, 13, struct pch_tim_val)
+
+#define IOCTL_1588_AUX_TIME_INTRPT_ENABLE

_IOW(IOC_1588_BASE,

Quoted 4 lines
Quoted 4 lines

14,\

Review

Quoted 3 lines

+ enum pch_auxmode)

(quoted diff) +2 -0
+
+#define IOCTL_1588_AUX_TIME_INTRPT_DISABLE

_IOW(IOC_1588_BASE,

Quoted 38 lines
Quoted 38 lines

15,\

Review

Quoted 8 lines

+ enum pch_auxmode)

(quoted diff) +7 -0
+
+#define IOCTL_1588_AUX_TIME_POLL \
+ _IOWR(IOC_1588_BASE, 16, struct pch_timepoll_ioctl)
+
+#define IOCTL_1588_RESET _IO(IOC_1588_BASE, 17)
+
+#define IOCTL_1588_CHNL_RESET _IOW(IOC_1588_BASE, 18, enum

pch_ptpport)

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+#define IOCTL_1588_STATS_GET _IOR(IOC_1588_BASE, 19, struct

pch_stats)

Review

Quoted 6 lines
(quoted diff) +6 -0
+
+#define IOCTL_1588_STATS_RESET _IO(IOC_1588_BASE, 20)
+
+#define IOCTL_1588_SHOW_ALL _IO(IOC_1588_BASE, 21)
+
+#define IOCTL_1588_AUX_TARG_TIME_INTRPT_ENABLE

_IO(IOC_1588_BASE, 22)

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+#define IOCTL_1588_AUX_TARG_TIME_INTRPT_DISABLE

_IO(IOC_1588_BASE, 23)

Review

Quoted 11 lines
(quoted diff) +11 -0
+
+#define IOCTL_1588_AUX_TARG_TIME_POLL \
+ _IOR(IOC_1588_BASE, 24, struct pch_timepoll_ioctl)
+
+#define IOCTL_1588_AUX_TARG_TIME_SET \
+ _IOW(IOC_1588_BASE, 25, struct pch_tim_val)
+
+#define IOCTL_1588_AUX_TARG_TIME_GET \
+ _IOR(IOC_1588_BASE, 26, struct pch_tim_val)
+
+#define IOCTL_1588_PULSE_PER_SEC_INTRPT_ENABLE

_IO(IOC_1588_BASE, 27)

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+#define IOCTL_1588_PULSE_PER_SEC_INTRPT_DISABLE

_IO(IOC_1588_BASE, 28)

Quoted 11 lines
Quoted 11 lines

Review

Quoted 11 lines
(quoted diff) +11 -0
+
+#define IOCTL_1588_TARG_TIME_NOTIFY \
+ _IOR(IOC_1588_BASE, 29, struct pch_tim_val)
+
+#define IOCTL_1588_AUX_TIME_NOTIFY \
+ _IOR(IOC_1588_BASE, 30, struct pch_auxtimeioctl)
+
+#define IOCTL_1588_AUX_TARG_TIME_NOTIFY \
+ _IOR(IOC_1588_BASE, 31, struct pch_tim_val)
+
+#define IOCTL_1588_PULSE_PER_SEC_NOTIFY _IOR(IOC_1588_BASE,

32,

Quoted 7 lines
Quoted 7 lines

__u32)

Review

Quoted 6 lines
(quoted diff) +6 -0
+
+#define IOCTL_1588_TARG_TIME_CLR_NOTIFY _IO(IOC_1588_BASE, 33)
+
+#define IOCTL_1588_AUX_TIME_CLR_NOTIFY _IO(IOC_1588_BASE, 34)
+
+#define IOCTL_1588_AUX_TARG_TIME_CLR_NOTIFY

_IO(IOC_1588_BASE,

Quoted 3 lines
Quoted 3 lines

35)

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+#define IOCTL_1588_PULSE_PER_SEC_CLR_NOTIFY

_IO(IOC_1588_BASE,

Quoted 3 lines
Quoted 3 lines

36)

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+#define IOCTL_1588_PULSE_PER_SEC_TIME_GET _IOR(IOC_1588_BASE,

37,

Quoted 3 lines
Quoted 3 lines

__u32)

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+#define IOCTL_1588_PULSE_PER_SEC_TIME_SET _IOW(IOC_1588_BASE,

38,

Quoted 25 lines
Quoted 16 lines

__u32)

Review

Quoted 12 lines
(quoted diff) +12 -0
+
+#define IOCTL_1588_PORT_VERSION_SET \
+ _IOW(IOC_1588_BASE, 39, struct pch_versionioctl)
+
+#define IOCTL_1588_PORT_VERSION_GET \
+ _IOWR(IOC_1588_BASE, 40, struct pch_versionioctl)
+
+#define IOCTL_1588_PORT_OPERATION_MODE_SET \
+ _IOW(IOC_1588_BASE, 41, struct pch_opemode_ioctl)
+
+#define IOCTL_1588_PORT_OPERATION_MODE_GET \
+ _IOWR(IOC_1588_BASE, 42, struct pch_opemode_ioctl)

Do they all have to be ioctls? What exactly are they doing?

Quoted 5 lines

And are they 32/64bit safe?

thanks,

greg k-h

Best Regards,
Qi

#1 lore raw
Quoted 5 lines · Masayuki Ohtake

Hi Qi-san

I have found Macro 'TRUE' and 'FALSE' are used as setting value in the driver; still, can't I use TRUE/FALSE macro ?
If not, How should we implement ?

Use the 'bool' type, and 'true' and/or 'false' keywords instead. That is the proper C idiom.

thanks,

greg k-h

#2 lore raw

Hi Greg,

Quoted 2 lines

Use the 'bool' type, and 'true' and/or 'false' keywords instead. That is the proper C idiom.

I can do well.

Thanks, Ohtake.

----- Original Message -----
From: "Greg KH" <[email protected]>
To: "Masayuki Ohtake" <[email protected]>
Cc: "Wang, Qi" <[email protected]>; <[email protected]>; "LKML" <[email protected]>; "Wang, Yong Y" <[email protected]>; "Khor, Andrew Chih Howe" <[email protected]>; <[email protected]>
Sent: Wednesday, August 11, 2010 1:39 PM
Subject: Re: [MeeGo-Dev][PATCH] Topcliff: Update PCH_IEEE1588 driver to 2.6.35

Quoted 14 lines · Masayuki Ohtake
Quoted 5 lines

Hi Qi-san

I have found Macro 'TRUE' and 'FALSE' are used as setting value in the driver; still, can't I use TRUE/FALSE macro ?
If not, How should we implement ?

Use the 'bool' type, and 'true' and/or 'false' keywords instead. That is the proper C idiom.

thanks,

greg k-h