Lines Matching refs:pv

71 	struct hvterm_priv *pv = hvterm_privs[vtermno];  in hvterm_raw_get_chars()  local
76 if (WARN_ON(!pv)) in hvterm_raw_get_chars()
79 spin_lock_irqsave(&pv->buf_lock, flags); in hvterm_raw_get_chars()
81 if (pv->left == 0) { in hvterm_raw_get_chars()
82 pv->offset = 0; in hvterm_raw_get_chars()
83 pv->left = hvc_get_chars(pv->termno, pv->buf, count); in hvterm_raw_get_chars()
89 for (i = 1; i < pv->left; ++i) { in hvterm_raw_get_chars()
90 if (pv->buf[i] == 0 && pv->buf[i-1] == '\r') { in hvterm_raw_get_chars()
91 --pv->left; in hvterm_raw_get_chars()
92 if (i < pv->left) { in hvterm_raw_get_chars()
93 memmove(&pv->buf[i], &pv->buf[i+1], in hvterm_raw_get_chars()
94 pv->left - i); in hvterm_raw_get_chars()
100 got = min(count, pv->left); in hvterm_raw_get_chars()
101 memcpy(buf, &pv->buf[pv->offset], got); in hvterm_raw_get_chars()
102 pv->offset += got; in hvterm_raw_get_chars()
103 pv->left -= got; in hvterm_raw_get_chars()
105 spin_unlock_irqrestore(&pv->buf_lock, flags); in hvterm_raw_get_chars()
121 struct hvterm_priv *pv = hvterm_privs[vtermno]; in hvterm_raw_put_chars() local
123 if (WARN_ON(!pv)) in hvterm_raw_put_chars()
126 return hvc_put_chars(pv->termno, buf, count); in hvterm_raw_put_chars()
139 struct hvterm_priv *pv = hvterm_privs[vtermno]; in hvterm_hvsi_get_chars() local
141 if (WARN_ON(!pv)) in hvterm_hvsi_get_chars()
144 return hvsilib_get_chars(&pv->hvsi, buf, count); in hvterm_hvsi_get_chars()
150 struct hvterm_priv *pv = hvterm_privs[vtermno]; in hvterm_hvsi_put_chars() local
152 if (WARN_ON(!pv)) in hvterm_hvsi_put_chars()
155 return hvsilib_put_chars(&pv->hvsi, buf, count); in hvterm_hvsi_put_chars()
160 struct hvterm_priv *pv = hvterm_privs[hp->vtermno]; in hvterm_hvsi_open() local
163 pr_devel("HVSI@%x: open !\n", pv->termno); in hvterm_hvsi_open()
169 return hvsilib_open(&pv->hvsi, hp); in hvterm_hvsi_open()
174 struct hvterm_priv *pv = hvterm_privs[hp->vtermno]; in hvterm_hvsi_close() local
176 pr_devel("HVSI@%x: do close !\n", pv->termno); in hvterm_hvsi_close()
178 hvsilib_close(&pv->hvsi, hp); in hvterm_hvsi_close()
185 struct hvterm_priv *pv = hvterm_privs[hp->vtermno]; in hvterm_hvsi_hangup() local
187 pr_devel("HVSI@%x: do hangup !\n", pv->termno); in hvterm_hvsi_hangup()
189 hvsilib_close(&pv->hvsi, hp); in hvterm_hvsi_hangup()
196 struct hvterm_priv *pv = hvterm_privs[hp->vtermno]; in hvterm_hvsi_tiocmget() local
198 if (!pv) in hvterm_hvsi_tiocmget()
200 return pv->hvsi.mctrl; in hvterm_hvsi_tiocmget()
206 struct hvterm_priv *pv = hvterm_privs[hp->vtermno]; in hvterm_hvsi_tiocmset() local
209 pv->termno, set, clear); in hvterm_hvsi_tiocmset()
212 hvsilib_write_mctrl(&pv->hvsi, 1); in hvterm_hvsi_tiocmset()
214 hvsilib_write_mctrl(&pv->hvsi, 0); in hvterm_hvsi_tiocmset()
303 struct hvterm_priv *pv; in hvc_vio_probe() local
329 pv = hvterm_privs[0]; in hvc_vio_probe()
341 pv = kzalloc(sizeof(struct hvterm_priv), GFP_KERNEL); in hvc_vio_probe()
342 if (!pv) in hvc_vio_probe()
344 pv->termno = vdev->unit_address; in hvc_vio_probe()
345 pv->proto = proto; in hvc_vio_probe()
346 spin_lock_init(&pv->buf_lock); in hvc_vio_probe()
347 hvterm_privs[termno] = pv; in hvc_vio_probe()
348 hvsilib_init(&pv->hvsi, hvc_get_chars, hvc_put_chars, in hvc_vio_probe()
349 pv->termno, 0); in hvc_vio_probe()