Displaying 20 results from an estimated 6805 matches for "buf".
2007 Apr 18
1
[Bridge] STP Explanation (2)
I saw some big mistakes, here's the correct version :
--------------------------------------------------------------------
void br_send_config_bpdu(struct net_bridge_port *p, struct bpdu *bpdu)
{
unsigned char buf[42];
buf[0] = bpdu->bpdu_header.protocol[0]; //0x00
buf[1] = bpdu->bpdu_header.protocol[1]; //0x00
buf[2] = bpdu->bpdu_header.version; //0x02
buf[3] = BPDU_TYPE_CONFIG;
buf[4] = bpdu->bpdu_body.flags.topo_change;
buf[5] = bpdu->bpdu_body.flags.proposal;
buf[6] = bpdu->bpdu...
2007 Apr 18
0
[Bridge] STP Explanation
...--------------------
but i'm perplex with this following function in br_stp_bpdu.c :
-------------------------------------------------------------------------------------------------------------------------
void br_send_config_bpdu(struct net_bridge_port *p, struct bpdu *bpdu)
{
unsigned char buf[38];
buf[0] = 0x42;
buf[1] = 0x42;
buf[2] = 0x03;
buf[3] = 0;
buf[4] = 0;
buf[5] = 0;
buf[6] = BPDU_TYPE_CONFIG;
buf[7] = (bpdu->topology_change ? 0x01 : 0) |
(bpdu->topology_change_ack ? 0x80 : 0);
buf[8] = bpdu->root.prio[0];
buf[9] = bpdu->root.prio[1];
buf[10] = bpdu-&...
2024 Feb 03
1
a little note on sshbuf_reset()
Hello!
I have a minor observation about code in sshbuf.c, not sure if it would be
useful, but here it is.
sshbuf_reset() is currently implemented like this:
void
sshbuf_reset(struct sshbuf *buf)
{
u_char *d;
if (buf->readonly || buf->refcount > 1) {
/* Nonsensical. Just make buffer appear empty */
buf->off = buf->size;
return;...
2007 Oct 14
2
GetTimeZoneInformation question
...ell for me. I can get
the Bias, StandardName and DaylightName, but everything else is goofed
up. The alignment seems ok, but maybe I''ve missed something or maybe I
have to do extra work to unpack the SYSTEMTIME structures.
require ''windows/time''
include Windows::Time
buf = 0.chr * 172 # sizeof(TIME_ZONE_INFORMATION)
GetTimeZoneInformation(buf)
p buf[0,4].unpack(''L'')[0] # Bias
p buf[4,64].tr("\0",'''') # StandardName
p buf[68,2].unpack(''S'')[0] # Year
p buf[70,2].unpack(''S'')[0]...
2012 Dec 12
2
[PATCHv9 0/2] virtio_console: Add rproc_serial driver
This patch-set introduces a new virtio type "rproc_serial" for communicating
with remote processors over shared memory. The driver depends on the
the remoteproc framework. As preparation for introducing "rproc_serial"
I've done a refactoring of the transmit buffer handling.
NOTE: These two patches are identical to first two patches of the V8 patch-set,
but are rebased to virtio-next.
Regards,
Sjur
Sjur Br?ndeland (2):
virtio_console: Merge struct buffer_token into struct port_buffer
virtio_console: Add support for remoteproc serial
drivers/char/v...
2012 Dec 12
2
[PATCHv9 0/2] virtio_console: Add rproc_serial driver
This patch-set introduces a new virtio type "rproc_serial" for communicating
with remote processors over shared memory. The driver depends on the
the remoteproc framework. As preparation for introducing "rproc_serial"
I've done a refactoring of the transmit buffer handling.
NOTE: These two patches are identical to first two patches of the V8 patch-set,
but are rebased to virtio-next.
Regards,
Sjur
Sjur Br?ndeland (2):
virtio_console: Merge struct buffer_token into struct port_buffer
virtio_console: Add support for remoteproc serial
drivers/char/v...
2012 Sep 25
5
[PATCHv6 0/3] virtio_console: Add rproc_serial device
...Br?ndeland <sjur.brandeland at stericsson.com>
I thought rebasing rproc_serial to linux-next was going to be trivial.
But when starting the merge I realized that I had to refactor the
the patches from Masami Hiramatsu. The splice support has the same issue
as I faced, with different type of buffers in the out_vq.
So I ended up refactoring the splice functionality. The code
size got smaller so hopefully this a step in the right direction.
This refactoring also make introduction of rproc_serial cleaner.
As requested I also added a patch for not initializing buffers.
I have tested the VIR...
2012 Sep 25
5
[PATCHv6 0/3] virtio_console: Add rproc_serial device
...Br?ndeland <sjur.brandeland at stericsson.com>
I thought rebasing rproc_serial to linux-next was going to be trivial.
But when starting the merge I realized that I had to refactor the
the patches from Masami Hiramatsu. The splice support has the same issue
as I faced, with different type of buffers in the out_vq.
So I ended up refactoring the splice functionality. The code
size got smaller so hopefully this a step in the right direction.
This refactoring also make introduction of rproc_serial cleaner.
As requested I also added a patch for not initializing buffers.
I have tested the VIR...
2012 Oct 15
7
[PATCHv7 0/4] virtio_console: Add rproc_serial driver
...ericsson.com>
This patch-set introduces a new virtio type "rproc_serial" for communicating
with remote processors over shared memory. The driver depends on the
the remoteproc framework. As preparation for introducing "rproc_serial"
I've done a refactoring of the transmit buffer handling.
This patch-set is a rework of the patch-set from Sept 25th, hopefully all
review comments has been addressed.
The fist patch is a bugfix and migth be applicable for 3.7.
Thanks,
Sjur
Sjur Br?ndeland (4):
virtio_console: Free buffer if splice fails
virtio_console: Use kmalloc in...
2012 Oct 15
7
[PATCHv7 0/4] virtio_console: Add rproc_serial driver
...ericsson.com>
This patch-set introduces a new virtio type "rproc_serial" for communicating
with remote processors over shared memory. The driver depends on the
the remoteproc framework. As preparation for introducing "rproc_serial"
I've done a refactoring of the transmit buffer handling.
This patch-set is a rework of the patch-set from Sept 25th, hopefully all
review comments has been addressed.
The fist patch is a bugfix and migth be applicable for 3.7.
Thanks,
Sjur
Sjur Br?ndeland (4):
virtio_console: Free buffer if splice fails
virtio_console: Use kmalloc in...
2012 Oct 30
5
[PATCHv8 0/3]virtio_console: Add rproc_serial driver
...ericsson.com>
This patch-set introduces a new virtio type "rproc_serial" for communicating
with remote processors over shared memory. The driver depends on the
the remoteproc framework. As preparation for introducing "rproc_serial"
I've done a refactoring of the transmit buffer handling.
Changes since v7:
- Rebased to virtio-next branch.
- Removed extra added lines.
- Removed superfluous checks before calling reclaim_dma_bufs().
- Rusty raised some question regarding garbage collection of the
out-vq, so I moved this into a separate patch.
Thanks,
Sjur
Sjur Br?nde...
2012 Oct 30
5
[PATCHv8 0/3]virtio_console: Add rproc_serial driver
...ericsson.com>
This patch-set introduces a new virtio type "rproc_serial" for communicating
with remote processors over shared memory. The driver depends on the
the remoteproc framework. As preparation for introducing "rproc_serial"
I've done a refactoring of the transmit buffer handling.
Changes since v7:
- Rebased to virtio-next branch.
- Removed extra added lines.
- Removed superfluous checks before calling reclaim_dma_bufs().
- Rusty raised some question regarding garbage collection of the
out-vq, so I moved this into a separate patch.
Thanks,
Sjur
Sjur Br?nde...
2016 Jun 02
0
[RFC v3 19/45] [media] dma-mapping: Use unsigned long for dma_attrs
Split out subsystem specific changes for easier reviews. This will be
squashed with main commit.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski at samsung.com>
---
drivers/media/platform/sti/bdisp/bdisp-hw.c | 26 +++++++---------------
drivers/media/v4l2-core/videobuf2-dma-contig.c | 30 +++++++++++---------------
drivers/media/v4l2-core/videobuf2-dma-sg.c | 19 ++++------------
include/media/videobuf2-dma-contig.h | 7 ++----
4 files changed, 26 insertions(+), 56 deletions(-)
diff --git a/drivers/media/platform/sti/bdisp/bdisp-hw.c b/drivers/med...
2012 Sep 03
3
[RFC 1/2] virtio_console: Add support for DMA memory allocation
From: Sjur Br?ndeland <sjur.brandeland at stericsson.com>
Add feature VIRTIO_CONSOLE_F_DMA_MEM. If the architecture has
DMA support and this feature bit is set, the virtio data buffers
will be allocated from DMA memory.
This is needed for using virtio_console from the remoteproc
framework.
Signed-off-by: Sjur Br?ndeland <sjur.brandeland at stericsson.com>
cc: Rusty Russell <rusty at rustcorp.com.au>
cc: Michael S. Tsirkin <mst at redhat.com>
cc: Ohad Ben-C...
2012 Sep 03
3
[RFC 1/2] virtio_console: Add support for DMA memory allocation
From: Sjur Br?ndeland <sjur.brandeland at stericsson.com>
Add feature VIRTIO_CONSOLE_F_DMA_MEM. If the architecture has
DMA support and this feature bit is set, the virtio data buffers
will be allocated from DMA memory.
This is needed for using virtio_console from the remoteproc
framework.
Signed-off-by: Sjur Br?ndeland <sjur.brandeland at stericsson.com>
cc: Rusty Russell <rusty at rustcorp.com.au>
cc: Michael S. Tsirkin <mst at redhat.com>
cc: Ohad Ben-C...
2016 Jan 19
6
FWD: [patch] scp + UTF-8
...this under the following conditions:
- It lines out the same way the current scp does for ascii.
- when shrinking the terminal it prints just as much characters
(width) of the filename as ascii would.
- To support terminals larger then MAX_WINSIZE and still be properly
indented I increased the buf size to 4x the size of MAX_WINSIZE,
since the maximum size of an UTF-8 char <should> be 4 bytes.
It's quite a lot more memory, but I reckon it's better then the
horrible indentation we have now.
I primarily developed this with scp and only minimally tested it with
sftp, but it...
2012 Sep 24
2
[PATCHv4] virtio_console: Add support for remoteproc serial
...stericsson.com>
Add a simple serial connection driver called
VIRTIO_ID_RPROC_SERIAL (11) for communicating with a
remote processor in an asymmetric multi-processing
configuration.
This implementation reuses the existing virtio_console
implementation, and adds support for DMA allocation
of data buffers and disables use of tty console and
the virtio control queue.
Signed-off-by: Sjur Br?ndeland <sjur.brandeland at stericsson.com>
cc: Rusty Russell <rusty at rustcorp.com.au>
cc: Michael S. Tsirkin <mst at redhat.com>
cc: Amit Shah <amit.shah at redhat.com>
cc: Ohad Ben-...
2012 Sep 24
2
[PATCHv4] virtio_console: Add support for remoteproc serial
...stericsson.com>
Add a simple serial connection driver called
VIRTIO_ID_RPROC_SERIAL (11) for communicating with a
remote processor in an asymmetric multi-processing
configuration.
This implementation reuses the existing virtio_console
implementation, and adds support for DMA allocation
of data buffers and disables use of tty console and
the virtio control queue.
Signed-off-by: Sjur Br?ndeland <sjur.brandeland at stericsson.com>
cc: Rusty Russell <rusty at rustcorp.com.au>
cc: Michael S. Tsirkin <mst at redhat.com>
cc: Amit Shah <amit.shah at redhat.com>
cc: Ohad Ben-...
2012 Jul 16
2
[PATCH V4] NEW API: add new api xfs_info
...+ if (sscanf (str, "%" SCNu64, &r) != 1) {
+ reply_with_error ("cannot parse numeric field from isoinfo: %s", str);
+ return -1;
+ }
+
+ *ret = r;
+ return 0;
+}
+
+static guestfs_int_xfsinfo *
+parse_xfs_info (char **lines)
+{
+ guestfs_int_xfsinfo *ret;
+ char *buf, *p;
+ size_t i;
+
+ ret = calloc (1, sizeof *ret);
+ if (ret == NULL) {
+ reply_with_error ("calloc");
+ return NULL;
+ }
+
+ for (i = 0; lines[i] != NULL; ++i) {
+ if (p = strstr (lines[i], "meta-data=")) {
+ ret->mntpoint = split_strdup (p + 10);
+...
2002 Feb 06
2
SFTP Status Bar..
...uot;misc.h"
#include "log.h"
#include "xmalloc.h"
+#include "atomicio.h"
/* remove newline at end of string */
char *
@@ -304,6 +305,139 @@
args->list = xrealloc(args->list, args->nalloc * sizeof(char *));
args->list[args->num++] = xstrdup(buf);
args->list[args->num] = NULL;
+}
+
+/* scp/sftp progression meter (from src/usr.bin/ftp/util.c) */
+static int
+foregroundproc(void)
+{
+ static pid_t pgrp = -1;
+ int ctty_pgrp;
+
+ if (pgrp == -1)
+ pgrp = getpgrp();
+
+ return ((ioctl(STDOUT_FILENO, TIOCGPGRP, &ctty_pgrp) != -1 &a...