summaryrefslogtreecommitdiff
path: root/src/eventcomm.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-05-31 13:51:53 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-05-31 14:43:59 +1000
commitdfee7c3f99c1ac5aeba7feed96f30b6b96739c73 (patch)
tree81942ed3a1c15d8ac205f8b3ceca9c2436bc853a /src/eventcomm.c
parentf37c67fc6ca929aabc3ad47d5294efb0a58c0644 (diff)
Replace xf86Msg with xf86IDrvMsg
xf86IDrvMsg automatically logs driver and device name. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/eventcomm.c')
-rw-r--r--src/eventcomm.c62
1 files changed, 30 insertions, 32 deletions
diff --git a/src/eventcomm.c b/src/eventcomm.c
index ba3f36b..9cabd14 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -77,8 +77,8 @@ EventDeviceOnHook(InputInfoPtr pInfo, SynapticsParameters *para)
int ret;
SYSCALL(ret = ioctl(pInfo->fd, EVIOCGRAB, (pointer)1));
if (ret < 0) {
- xf86Msg(X_WARNING, "%s can't grab event device, errno=%d\n",
- pInfo->name, errno);
+ xf86IDrvMsg(pInfo, X_WARNING, "can't grab event device, errno=%d\n",
+ errno);
}
}
@@ -215,15 +215,16 @@ event_query_model(int fd, enum TouchpadModel *model_out, unsigned short *vendor_
* @return Zero on success, or errno otherwise.
*/
static int
-event_get_abs(int fd, int code, int *min, int *max, int *fuzz, int *res)
+event_get_abs(InputInfoPtr pInfo, int fd, int code,
+ int *min, int *max, int *fuzz, int *res)
{
int rc;
struct input_absinfo abs = {0};
SYSCALL(rc = ioctl(fd, EVIOCGABS(code), &abs));
if (rc < 0) {
- xf86Msg(X_ERROR, "%s: EVIOCGABS error on %d (%s)\n",
- __func__, code, strerror(rc));
+ xf86IDrvMsg(pInfo, X_ERROR, "%s EVIOCGABS error on %d (%s)\n",
+ __func__, code, strerror(rc));
return errno;
}
@@ -254,10 +255,10 @@ event_query_axis_ranges(InputInfoPtr pInfo)
/* The kernel's fuzziness concept seems a bit weird, but it can more or
* less be applied as hysteresis directly, i.e. no factor here. */
- event_get_abs(pInfo->fd, ABS_X, &priv->minx, &priv->maxx,
+ event_get_abs(pInfo, pInfo->fd, ABS_X, &priv->minx, &priv->maxx,
&priv->synpara.hyst_x, &priv->resx);
- event_get_abs(pInfo->fd, ABS_Y, &priv->miny, &priv->maxy,
+ event_get_abs(pInfo, pInfo->fd, ABS_Y, &priv->miny, &priv->maxy,
&priv->synpara.hyst_y, &priv->resy);
priv->has_pressure = FALSE;
@@ -269,15 +270,14 @@ event_query_axis_ranges(InputInfoPtr pInfo)
priv->has_width = (BitIsOn(absbits, ABS_TOOL_WIDTH) != 0);
}
else
- xf86Msg(X_ERROR, "%s: failed to query ABS bits (%s)\n", pInfo->name,
- strerror(errno));
+ xf86IDrvMsg(pInfo, X_ERROR, "failed to query ABS bits (%s)\n", strerror(errno));
if (priv->has_pressure)
- event_get_abs(pInfo->fd, ABS_PRESSURE, &priv->minp, &priv->maxp,
+ event_get_abs(pInfo, pInfo->fd, ABS_PRESSURE, &priv->minp, &priv->maxp,
NULL, NULL);
if (priv->has_width)
- event_get_abs(pInfo->fd, ABS_TOOL_WIDTH,
+ event_get_abs(pInfo, pInfo->fd, ABS_TOOL_WIDTH,
&priv->minw, &priv->maxw,
NULL, NULL);
@@ -298,23 +298,22 @@ event_query_axis_ranges(InputInfoPtr pInfo)
}
/* Now print the device information */
- xf86Msg(X_PROBED, "%s: x-axis range %d - %d\n", pInfo->name,
- priv->minx, priv->maxx);
- xf86Msg(X_PROBED, "%s: y-axis range %d - %d\n", pInfo->name,
- priv->miny, priv->maxy);
+ xf86IDrvMsg(pInfo, X_PROBED, "x-axis range %d - %d\n",
+ priv->minx, priv->maxx);
+ xf86IDrvMsg(pInfo, X_PROBED, "y-axis range %d - %d\n",
+ priv->miny, priv->maxy);
if (priv->has_pressure)
- xf86Msg(X_PROBED, "%s: pressure range %d - %d\n", pInfo->name,
- priv->minp, priv->maxp);
+ xf86IDrvMsg(pInfo, X_PROBED, "pressure range %d - %d\n",
+ priv->minp, priv->maxp);
else
- xf86Msg(X_INFO,
- "%s: device does not report pressure, will use touch data.\n",
- pInfo->name);
+ xf86IDrvMsg(pInfo, X_INFO,
+ "device does not report pressure, will use touch data.\n");
if (priv->has_width)
- xf86Msg(X_PROBED, "%s: finger width range %d - %d\n", pInfo->name,
- abs.minimum, abs.maximum);
+ xf86IDrvMsg(pInfo, X_PROBED, "finger width range %d - %d\n",
+ abs.minimum, abs.maximum);
else
- xf86Msg(X_INFO,
- "%s: device does not report finger width.\n", pInfo->name);
+ xf86IDrvMsg(pInfo, X_INFO,
+ "device does not report finger width.\n");
if (priv->has_left)
strcat(buf, " left");
@@ -329,7 +328,7 @@ event_query_axis_ranges(InputInfoPtr pInfo)
if (priv->has_scrollbuttons)
strcat(buf, " scroll-buttons");
- xf86Msg(X_PROBED, "%s: buttons:%s\n", pInfo->name, buf);
+ xf86IDrvMsg(pInfo, X_PROBED, "buttons:%s\n", buf);
}
static Bool
@@ -341,7 +340,7 @@ EventQueryHardware(InputInfoPtr pInfo)
if (!event_query_is_touchpad(pInfo->fd, (proto_data) ? proto_data->need_grab : TRUE))
return FALSE;
- xf86Msg(X_PROBED, "%s: touchpad found\n", pInfo->name);
+ xf86IDrvMsg(pInfo, X_PROBED, "touchpad found\n");
return TRUE;
}
@@ -536,12 +535,11 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char *device)
i = scandir(DEV_INPUT_EVENT, &namelist, EventDevOnly, alphasort);
if (i < 0) {
- xf86Msg(X_ERROR, "Couldn't open %s\n", DEV_INPUT_EVENT);
+ xf86IDrvMsg(pInfo, X_ERROR, "Couldn't open %s\n", DEV_INPUT_EVENT);
return FALSE;
}
else if (i == 0) {
- xf86Msg(X_ERROR, "%s The /dev/input/event* device nodes seem to be missing\n",
- pInfo->name);
+ xf86IDrvMsg(pInfo, X_ERROR, "The /dev/input/event* device nodes seem to be missing\n");
free(namelist);
return FALSE;
}
@@ -558,8 +556,8 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char *device)
if (event_query_is_touchpad(fd, TRUE)) {
touchpad_found = TRUE;
- xf86Msg(X_PROBED, "%s auto-dev sets device to %s\n",
- pInfo->name, fname);
+ xf86IDrvMsg(pInfo, X_PROBED, "auto-dev sets device to %s\n",
+ fname);
pInfo->options =
xf86ReplaceStrOption(pInfo->options, "Device", fname);
}
@@ -571,7 +569,7 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char *device)
free(namelist);
if (!touchpad_found) {
- xf86Msg(X_ERROR, "%s no synaptics event device found\n", pInfo->name);
+ xf86IDrvMsg(pInfo, X_ERROR, "no synaptics event device found\n");
return FALSE;
}